Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp5880167imm; Sat, 19 May 2018 11:36:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoD6dtRCTtT7J3yfipp5VUbU3rJ9FsvnsHCietpFfCwBhYJyOZhfz1jU7LYaeYb+sfoIzPN X-Received: by 2002:a62:8910:: with SMTP id v16-v6mr13945275pfd.13.1526754972370; Sat, 19 May 2018 11:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526754972; cv=none; d=google.com; s=arc-20160816; b=fR5I49hMBD0IxyC9OZ7vdeY6yt/mhTqF/zxIW0JvNdUhiCyRLalxYZhxi8YDiyFIbl fiMnudj53yygAFJU/D3fVcExM8KGiCl0mjYnGzf7V+cpB34tEu7Kc9HNAXR0nMkrwzl/ l3psy73HPNdgwGhs/pZLz+akMkNK7XWGHBiZqoYa2I3iqmjXQFp7541GxDWxO3o5DzV4 u93vFXGz93POL4i9OAwIGF2PonbPZ4Nrfo5J5JP2caMNY9apHkC0ViK6bV7ts00tkcrk SLeFJVLxQExR5cStAe/ipyc3G1KYCdDQqRUFW1B5dgXiQfzXi9o22bt+Fgbna20LX0+9 M5QA== 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=QpvUEJwDmYkEe/WnoL03hI3Tj29Rb5zTXWiUgHR3+MU=; b=x0uNhUV/b0DcPp5drwto9+etURF1irX8R2v+whsGPw4otW8sZPDvcshH3F4J5QilA7 Fv0MdiasmmP1rXl3ggZEedRkTGxxgyGwyMGuhJCi29UwAcy2pDPmV9atH2l0UnQt63a+ rJHDw50UVC2OKqCRVMpSomokHsoXMxKhTqpzFd15uo2nUWGVlRRsH7WDaRzXMaxHZWts SNcFp485EFh7XnMnMCR9kCx8s//L80QFzLvSRo5Z3jPhws5Bf/Ju+x2IfgxagLiqedFu 0UjlLc8l8RH/JOoWFHbLyx73JNYB1u3QOZmRJf/5xWOTKuQEjk3j8EY7+iIUq2eDDi3Q QQ6w== 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 q66-v6si10174589pfi.235.2018.05.19.11.35.58; Sat, 19 May 2018 11:36:12 -0700 (PDT) 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 S1752626AbeESSck (ORCPT + 99 others); Sat, 19 May 2018 14:32:40 -0400 Received: from mailout6.siol.net ([213.250.19.133]:34646 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752534AbeESSc3 (ORCPT ); Sat, 19 May 2018 14:32:29 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id 368E6520640; Sat, 19 May 2018 20:32:28 +0200 (CEST) X-Virus-Scanned: amavisd-new at psrvmta10.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta10.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id S-NZ6-510ePV; Sat, 19 May 2018 20:32:27 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id AA1DF5206A0; Sat, 19 May 2018 20:32:27 +0200 (CEST) Received: from localhost.localdomain (unknown [194.152.15.144]) (Authenticated sender: 031275009) by mail.siol.net (Postfix) with ESMTPSA id E747D520640; Sat, 19 May 2018 20:32:23 +0200 (CEST) From: Jernej Skrabec To: maxime.ripard@bootlin.com, wens@csie.org, robh+dt@kernel.org Cc: mark.rutland@arm.com, 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 01/15] clk: sunxi-ng: r40: Add minimal rate for video PLLs Date: Sat, 19 May 2018 20:31:13 +0200 Message-Id: <20180519183127.2718-2-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180519183127.2718-1-jernej.skrabec@siol.net> References: <20180519183127.2718-1-jernej.skrabec@siol.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 R40 video PLLs to 192 MHz. Signed-off-by: Jernej Skrabec --- drivers/clk/sunxi-ng/ccu-sun8i-r40.c | 46 +++++++++++++++------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c index 933f2e68f42a..c16a62a7bdbd 100644 --- a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c +++ b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c @@ -65,17 +65,18 @@ static SUNXI_CCU_NM_WITH_GATE_LOCK(pll_audio_base_clk, "pll-audio-base", CLK_SET_RATE_UNGATE); /* TODO: The result of N/M is required to be in [8, 25] range. */ -static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_video0_clk, "pll-video0", - "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_video0_clk, "pll-video0", + "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); /* TODO: The result of N/M is required to be in [8, 25] range. */ static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve", @@ -151,17 +152,18 @@ static struct ccu_nk pll_periph1_clk = { }; /* TODO: The result of N/M is required to be in [8, 25] range. */ -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 struct ccu_nkm pll_sata_clk = { .enable = BIT(31), -- 2.17.0