Commit 5de39aca authored by Icenowy Zheng's avatar Icenowy Zheng Committed by Maxime Ripard

clk: sunxi-ng: a64: Add max. rate constraint to video PLLs

Video PLLs on A64 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: default avatarIcenowy Zheng <icenowy@aosc.io>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
parent 65b1e8a6
...@@ -64,18 +64,19 @@ static SUNXI_CCU_NM_WITH_GATE_LOCK(pll_audio_base_clk, "pll-audio-base", ...@@ -64,18 +64,19 @@ static SUNXI_CCU_NM_WITH_GATE_LOCK(pll_audio_base_clk, "pll-audio-base",
BIT(28), /* lock */ BIT(28), /* lock */
CLK_SET_RATE_UNGATE); CLK_SET_RATE_UNGATE);
static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN(pll_video0_clk, "pll-video0", static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX(pll_video0_clk, "pll-video0",
"osc24M", 0x010, "osc24M", 0x010,
192000000, /* Minimum rate */ 192000000, /* Minimum rate */
8, 7, /* N */ 1008000000, /* Maximum rate */
0, 4, /* M */ 8, 7, /* N */
BIT(24), /* frac enable */ 0, 4, /* M */
BIT(25), /* frac select */ BIT(24), /* frac enable */
270000000, /* frac rate 0 */ BIT(25), /* frac select */
297000000, /* frac rate 1 */ 270000000, /* frac rate 0 */
BIT(31), /* gate */ 297000000, /* frac rate 1 */
BIT(28), /* lock */ BIT(31), /* gate */
CLK_SET_RATE_UNGATE); BIT(28), /* lock */
CLK_SET_RATE_UNGATE);
static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve", static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve",
"osc24M", 0x018, "osc24M", 0x018,
...@@ -126,18 +127,19 @@ static struct ccu_nk pll_periph1_clk = { ...@@ -126,18 +127,19 @@ static struct ccu_nk pll_periph1_clk = {
}, },
}; };
static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN(pll_video1_clk, "pll-video1", static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX(pll_video1_clk, "pll-video1",
"osc24M", 0x030, "osc24M", 0x030,
192000000, /* Minimum rate */ 192000000, /* Minimum rate */
8, 7, /* N */ 1008000000, /* Maximum rate */
0, 4, /* M */ 8, 7, /* N */
BIT(24), /* frac enable */ 0, 4, /* M */
BIT(25), /* frac select */ BIT(24), /* frac enable */
270000000, /* frac rate 0 */ BIT(25), /* frac select */
297000000, /* frac rate 1 */ 270000000, /* frac rate 0 */
BIT(31), /* gate */ 297000000, /* frac rate 1 */
BIT(28), /* lock */ BIT(31), /* gate */
CLK_SET_RATE_UNGATE); BIT(28), /* lock */
CLK_SET_RATE_UNGATE);
static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_gpu_clk, "pll-gpu", static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_gpu_clk, "pll-gpu",
"osc24M", 0x038, "osc24M", 0x038,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment