linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Icenowy Zheng <icenowy@aosc.io>
To: Maxime Ripard <maxime.ripard@bootlin.com>,
	Rob Herring <robh+dt@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Jernej Skrabec <jernej.skrabec@siol.net>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-sunxi@googlegroups.com, Icenowy Zheng <icenowy@aosc.io>
Subject: [PATCH v3.1 01/10] clk: sunxi-ng: a64: Add minimal rate for video PLLs
Date: Fri, 27 Jul 2018 01:12:48 +0800	[thread overview]
Message-ID: <20180726171257.6688-2-icenowy@aosc.io> (raw)
In-Reply-To: <20180726171257.6688-1-icenowy@aosc.io>

From: Jagan Teki <jagan@amarulasolutions.com>

According to documentation and experience with other similar SoCs, video
PLLs don't work stable if their output frequency is set below 192 MHz.

Because of that, set minimal rate to both A64 video PLLs to 192 MHz.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes for v3.1, v3:
- none 
Changes for v2:
- New patch

 drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 46 ++++++++++++++-------------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
index ee9c12cf3f08..d0e30192f0cf 100644
--- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
@@ -64,17 +64,18 @@ static SUNXI_CCU_NM_WITH_GATE_LOCK(pll_audio_base_clk, "pll-audio-base",
 				   BIT(28),	/* lock */
 				   CLK_SET_RATE_UNGATE);
 
-static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_video0_clk, "pll-video0",
-					"osc24M", 0x010,
-					8, 7,		/* N */
-					0, 4,		/* M */
-					BIT(24),	/* frac enable */
-					BIT(25),	/* frac select */
-					270000000,	/* frac rate 0 */
-					297000000,	/* frac rate 1 */
-					BIT(31),	/* gate */
-					BIT(28),	/* lock */
-					CLK_SET_RATE_UNGATE);
+static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN(pll_video0_clk, "pll-video0",
+					    "osc24M", 0x010,
+					    192000000,	/* Minimum rate */
+					    8, 7,		/* N */
+					    0, 4,		/* M */
+					    BIT(24),	/* frac enable */
+					    BIT(25),	/* frac select */
+					    270000000,	/* frac rate 0 */
+					    297000000,	/* frac rate 1 */
+					    BIT(31),	/* gate */
+					    BIT(28),	/* lock */
+					    CLK_SET_RATE_UNGATE);
 
 static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve",
 					"osc24M", 0x018,
@@ -125,17 +126,18 @@ static struct ccu_nk pll_periph1_clk = {
 	},
 };
 
-static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_video1_clk, "pll-video1",
-					"osc24M", 0x030,
-					8, 7,		/* N */
-					0, 4,		/* M */
-					BIT(24),	/* frac enable */
-					BIT(25),	/* frac select */
-					270000000,	/* frac rate 0 */
-					297000000,	/* frac rate 1 */
-					BIT(31),	/* gate */
-					BIT(28),	/* lock */
-					CLK_SET_RATE_UNGATE);
+static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN(pll_video1_clk, "pll-video1",
+					    "osc24M", 0x030,
+					    192000000,	/* Minimum rate */
+					    8, 7,		/* N */
+					    0, 4,		/* M */
+					    BIT(24),	/* frac enable */
+					    BIT(25),	/* frac select */
+					    270000000,	/* frac rate 0 */
+					    297000000,	/* frac rate 1 */
+					    BIT(31),	/* gate */
+					    BIT(28),	/* lock */
+					    CLK_SET_RATE_UNGATE);
 
 static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_gpu_clk, "pll-gpu",
 					"osc24M", 0x038,
-- 
2.18.0


  reply	other threads:[~2018-07-26 17:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 17:12 [PATCH v3.1 00/10] arm64: allwinner: Add A64 DE2 HDMI support Icenowy Zheng
2018-07-26 17:12 ` Icenowy Zheng [this message]
2018-07-26 17:53   ` [linux-sunxi] [PATCH v3.1 01/10] clk: sunxi-ng: a64: Add minimal rate for video PLLs Jernej Škrabec
2018-07-26 17:12 ` [PATCH v3.1 02/10] dt-bindings: display: Add compatible for A64 DE2 display pipeline Icenowy Zheng
2018-07-26 17:12 ` [PATCH v3.1 03/10] drm/sun4i: Add support for A64 mixers Icenowy Zheng
2018-07-26 17:56   ` [linux-sunxi] " Jernej Škrabec
2018-07-26 17:12 ` [PATCH v3.1 04/10] drm/sun4i: Add support for A64 display engine Icenowy Zheng
2018-07-26 17:12 ` [PATCH v3.1 05/10] dt-bindings: display: Add compatible for A64 HDMI Icenowy Zheng
2018-07-26 17:12 ` [PATCH v3.1 06/10] dt-bindings: clock: sun50i-a64-ccu: Add PLL_VIDEO[0-1] macros Icenowy Zheng
2018-07-26 17:59   ` [linux-sunxi] " Jernej Škrabec
2018-07-26 17:12 ` [PATCH v3.1 07/10] arm64: dts: allwinner: a64: Add display pipeline Icenowy Zheng
2018-07-26 18:01   ` [linux-sunxi] " Jernej Škrabec
2018-07-27 15:42   ` Icenowy Zheng
2018-07-26 17:12 ` [PATCH v3.1 08/10] dt-bindings: sun4i-drm: add HDMI VCC supply property for sun8i-dw-hdmi Icenowy Zheng
2018-07-30 23:12   ` Rob Herring
2018-07-30 23:51     ` Icenowy Zheng
2018-07-26 17:12 ` [PATCH v3.1 09/10] drm/sun4i: Add support for HDMI voltage regulator Icenowy Zheng
2018-07-26 17:12 ` [PATCH v3.1 10/10] arm64: dts: allwinner: a64: Enable HDMI output on A64 boards w/ HDMI Icenowy Zheng
2018-07-26 18:03   ` [linux-sunxi] " Jernej Škrabec
2018-07-27  0:44     ` Icenowy Zheng
2018-07-27 12:56   ` Maxime Ripard
2018-07-27 13:26     ` Icenowy Zheng
2018-07-27 13:57       ` Jagan Teki
2018-07-27 14:11         ` [linux-sunxi] " Icenowy Zheng
2018-07-27 14:20         ` Icenowy Zheng
2018-07-27 14:00       ` Maxime Ripard
2018-07-27 15:42         ` Icenowy Zheng
2018-07-27 15:44           ` [linux-sunxi] " Jernej Škrabec
2018-07-27 12:59 ` [PATCH v3.1 00/10] arm64: allwinner: Add A64 DE2 HDMI support Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180726171257.6688-2-icenowy@aosc.io \
    --to=icenowy@aosc.io \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@siol.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=robh+dt@kernel.org \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).