aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJernej Skrabec <jernej.skrabec@siol.net>2018-08-09 12:52:15 -0400
committerMaxime Ripard <maxime.ripard@bootlin.com>2018-08-27 03:18:09 -0400
commitb16fb66915fcfc6b1a7eb48225b6b30b69bb721b (patch)
treeecfd56a4d164a451cfa5986d6bb2ccfaa7d5cb5b
parent02d7901695afd1dcbec7182d878927893c07174e (diff)
clk: sunxi-ng: r40: Add max. rate constraint to video PLLs
Video PLLs on R40 can be set to higher rate that it is actually supported by HW. Limit maximum rate to 1008 MHz. This is the maximum allowed rate by BSP clock driver. Interestengly, user manual specifies maximum frequency to be 600 MHz. Historically, this data was wrong in some user manuals for other SoCs, so more faith is put in BSP clock driver. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun8i-r40.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
index 0f388f6944d5..582ebd41d20d 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
@@ -65,19 +65,19 @@ static SUNXI_CCU_NM_WITH_GATE_LOCK(pll_audio_base_clk, "pll-audio-base",
65 BIT(28), /* lock */ 65 BIT(28), /* lock */
66 CLK_SET_RATE_UNGATE); 66 CLK_SET_RATE_UNGATE);
67 67
68/* TODO: The result of N/M is required to be in [8, 25] range. */ 68static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX(pll_video0_clk, "pll-video0",
69static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN(pll_video0_clk, "pll-video0", 69 "osc24M", 0x0010,
70 "osc24M", 0x0010, 70 192000000, /* Minimum rate */
71 192000000, /* Minimum rate */ 71 1008000000, /* Maximum rate */
72 8, 7, /* N */ 72 8, 7, /* N */
73 0, 4, /* M */ 73 0, 4, /* M */
74 BIT(24), /* frac enable */ 74 BIT(24), /* frac enable */
75 BIT(25), /* frac select */ 75 BIT(25), /* frac select */
76 270000000, /* frac rate 0 */ 76 270000000, /* frac rate 0 */
77 297000000, /* frac rate 1 */ 77 297000000, /* frac rate 1 */
78 BIT(31), /* gate */ 78 BIT(31), /* gate */
79 BIT(28), /* lock */ 79 BIT(28), /* lock */
80 CLK_SET_RATE_UNGATE); 80 CLK_SET_RATE_UNGATE);
81 81
82/* TODO: The result of N/M is required to be in [8, 25] range. */ 82/* TODO: The result of N/M is required to be in [8, 25] range. */
83static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve", 83static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve",
@@ -152,19 +152,19 @@ static struct ccu_nk pll_periph1_clk = {
152 }, 152 },
153}; 153};
154 154
155/* TODO: The result of N/M is required to be in [8, 25] range. */ 155static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX(pll_video1_clk, "pll-video1",
156static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN(pll_video1_clk, "pll-video1", 156 "osc24M", 0x030,
157 "osc24M", 0x030, 157 192000000, /* Minimum rate */
158 192000000, /* Minimum rate */ 158 1008000000, /* Maximum rate */
159 8, 7, /* N */ 159 8, 7, /* N */
160 0, 4, /* M */ 160 0, 4, /* M */
161 BIT(24), /* frac enable */ 161 BIT(24), /* frac enable */
162 BIT(25), /* frac select */ 162 BIT(25), /* frac select */
163 270000000, /* frac rate 0 */ 163 270000000, /* frac rate 0 */
164 297000000, /* frac rate 1 */ 164 297000000, /* frac rate 1 */
165 BIT(31), /* gate */ 165 BIT(31), /* gate */
166 BIT(28), /* lock */ 166 BIT(28), /* lock */
167 CLK_SET_RATE_UNGATE); 167 CLK_SET_RATE_UNGATE);
168 168
169static struct ccu_nkm pll_sata_clk = { 169static struct ccu_nkm pll_sata_clk = {
170 .enable = BIT(31), 170 .enable = BIT(31),