Received: by 10.223.185.116 with SMTP id b49csp7953364wrg; Thu, 1 Mar 2018 14:12:29 -0800 (PST) X-Google-Smtp-Source: AG47ELurLPJVKo5wiRnLcUf6mzelQb2/ZnVzLEwVdTW5QJ0ymC6OCXprIPlS7x7Gy20htjxam83i X-Received: by 10.101.73.7 with SMTP id p7mr2748436pgs.250.1519942349740; Thu, 01 Mar 2018 14:12:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519942349; cv=none; d=google.com; s=arc-20160816; b=sd6NQ+wthEnftTUBIm9VTpNLmFSOTxvOLYBTW1g66aCQTISCJRp2oxTxVa+yn2Df5k d3q8REPlEt6Hgh2APwBVKD+cClNGIdAbhyM3YwIdE4bHxrOCq6Fivu4cCcFvxa24fWkG KaNmriRb+ONN0m7w0b5QSrzsJuf29hrqDs7ooR2jyz72i/U52P283ZKE/Su6g19W93NG kXCu+StjxtjLSaoqS5ZWVxB3nFxch4zrb7bjArkJUvgfGG45vm50FS/rhrAApi5/IM5f XqvyHBqfIar7RtFSENGOzXQzdnr3JPOlDMJznhgayzNVzJ2PpwXs50H/OL6/ZqgaVU8i V7Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=dnMQ5erGlpjHDjaGRPC+ugZEib9V480xkYPOrdAw/J8=; b=ik6l67u/QuYMPQI5JOC/17IaUN27FmqfcRyPoAHLBwykuJT+1WPs8aw/ZtatQyOmZJ UX1Ddl9tsGBDLY8g8M37zrqEVO5Cfy3yAz3EARSuOrVtG26gNm5bmlUXEIyV9nHDprEN WaHWlyKe0yi1LeU65F4fgadA+O2ZRdMVeUEp8V20ppLFPjofSoWfiRdV8xpqVyn07RzP F75CyJ2MOQY4PnTVyi7p9j/DTZJtvA2cc+pK9tmhfcbSJuvg0kJfMKLcTy7mYYVYDu2b fDVAWMnnZdnVtvv+Q7sGFt0b0t1YUumUJGy3+/umyGqT7ATZGwOiZ9jLkeuXA6ipweSn 6fag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si3655135pfb.377.2018.03.01.14.12.14; Thu, 01 Mar 2018 14:12:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162541AbeCAWLZ (ORCPT + 99 others); Thu, 1 Mar 2018 17:11:25 -0500 Received: from mailoutvs4.siol.net ([213.250.19.137]:42612 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1162480AbeCAWLW (ORCPT ); Thu, 1 Mar 2018 17:11:22 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id 0EB2E522F8B; Thu, 1 Mar 2018 22:34:58 +0100 (CET) X-Virus-Scanned: amavisd-new at psrvmta11.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta11.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id RAF48hYqC12n; Thu, 1 Mar 2018 22:34:57 +0100 (CET) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id 91008522F8A; Thu, 1 Mar 2018 22:34:57 +0100 (CET) Received: from localhost.localdomain (cpe-86-58-68-135.ftth.triera.net [86.58.68.135]) (Authenticated sender: 031275009) by mail.siol.net (Postfix) with ESMTPSA id 0121A522F8B; Thu, 1 Mar 2018 22:34:54 +0100 (CET) From: Jernej Skrabec To: maxime.ripard@free-electrons.com, wens@csie.org, airlied@linux.ie, robh+dt@kernel.org, mark.rutland@arm.com, mturquette@baylibre.com, sboyd@kernel.org Cc: jernej.skrabec@siol.net, 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 Subject: [PATCH v3 02/16] clk: sunxi-ng: h3: h5: Add minimal rate for video PLL Date: Thu, 1 Mar 2018 22:34:28 +0100 Message-Id: <20180301213442.16677-3-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180301213442.16677-1-jernej.skrabec@siol.net> References: <20180301213442.16677-1-jernej.skrabec@siol.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 23 ++++++++++++----------- 1 file 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", BIT(28), /* lock */ CLK_SET_RATE_UNGATE); -static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_video_clk, "pll-video", - "osc24M", 0x0010, - 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_video_clk, "pll-video", + "osc24M", 0x0010, + 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", 0x0018, -- 2.16.2