aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJernej Skrabec <jernej.skrabec@siol.net>2018-03-01 16:34:28 -0500
committerMaxime Ripard <maxime.ripard@bootlin.com>2018-03-02 02:42:20 -0500
commit4fd8ae912f9829c4324fa85d945cc0288c218bc5 (patch)
treedd9c4820c96db0d52d146dbd014ed92b770bbea6 /drivers
parent2d2b61c13a4b39c8ba6b9c1daa79d5891689864e (diff)
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 <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun8i-h3.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
index 29bc0566b776..b9f39078c0b2 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
@@ -69,17 +69,18 @@ static SUNXI_CCU_NM_WITH_SDM_GATE_LOCK(pll_audio_base_clk, "pll-audio-base",
69 BIT(28), /* lock */ 69 BIT(28), /* lock */
70 CLK_SET_RATE_UNGATE); 70 CLK_SET_RATE_UNGATE);
71 71
72static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_video_clk, "pll-video", 72static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN(pll_video_clk, "pll-video",
73 "osc24M", 0x0010, 73 "osc24M", 0x0010,
74 8, 7, /* N */ 74 192000000, /* Minimum rate */
75 0, 4, /* M */ 75 8, 7, /* N */
76 BIT(24), /* frac enable */ 76 0, 4, /* M */
77 BIT(25), /* frac select */ 77 BIT(24), /* frac enable */
78 270000000, /* frac rate 0 */ 78 BIT(25), /* frac select */
79 297000000, /* frac rate 1 */ 79 270000000, /* frac rate 0 */
80 BIT(31), /* gate */ 80 297000000, /* frac rate 1 */
81 BIT(28), /* lock */ 81 BIT(31), /* gate */
82 CLK_SET_RATE_UNGATE); 82 BIT(28), /* lock */
83 CLK_SET_RATE_UNGATE);
83 84
84static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve", 85static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve",
85 "osc24M", 0x0018, 86 "osc24M", 0x0018,