Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2163378imm; Mon, 3 Sep 2018 21:43:16 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb18ysIO7eX8X4XTvFRh/NPME3LhReSwTppXxgRErGKEaEiNcAexz8j0u+Ap/BsWwivupqv X-Received: by 2002:a62:2459:: with SMTP id r86-v6mr33050105pfj.31.1536036196180; Mon, 03 Sep 2018 21:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536036196; cv=none; d=google.com; s=arc-20160816; b=I3IkHKWiT/mJO7m9lxhJ9rjJ6mJpA0DlM9UtL8OkDFifG/ahQZJtVm/azcaKmOodAC dB9ODzXIccKycPiFh6PLK2THCtLhP6/he86gpanWkzSaQX7gw0bl+Z4+LfQJ3VmGH1L8 LQpn5dCKGK/UYhcBT6hbjX/gsSOrKWfTf3oC10F5AmrRiALLtnBMSVrJdazR0xULaRUS I82IivgDYRdJGc1FL3k15pH5uq4cOs/LPtF7DgagBJeNJryH/AAq5T4oZCQnXzvU89o3 ndOsrc+SVOfcv3ddXrjgLnXy42K7xS0p3rn8LqSgH5/OhFtrGJ0gJjukXYgoZT+ELIoZ Z/dg== 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=wiMeHuQG/fajeRIdCCqcTDxJCQ6KvnQUcXj71NfRMoM=; b=oXZLfhqqE5ucGT9UFi+ua6iUGebemJawis6N/P+9FsfnYE1bYVgqX4Yc5myJ+Xo3f9 uzl+qG5O01DLDXYghT+CmDddcqwwjs6vWGa+zeRsac5gtZNJU5CJoIUdur0SyveVWagf eTznJqOXd9KjFNx5QY5m8aLgtW38ye0mtF2vPt197tkkPiZJwV2nrpn7K27jJ4t2sAjM Rm/9obPRpVGqX/ItA7AYVM+Di0GTIf9pUoq/wd9qtkUFL7Yu4UiWC8gygh/B1sauGrNY PBXXmXKOEFVwOAW4MIQ9HPYw7t3ENO2gqycAtBiZkFZB+54Ry0zeO9sYhJNiSYo3iMFW rYgw== 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 81-v6si20487910pgd.57.2018.09.03.21.43.01; Mon, 03 Sep 2018 21:43:16 -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 S1727258AbeIDJFD (ORCPT + 99 others); Tue, 4 Sep 2018 05:05:03 -0400 Received: from hermes.aosc.io ([199.195.250.187]:44925 "EHLO hermes.aosc.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726093AbeIDJFC (ORCPT ); Tue, 4 Sep 2018 05:05:02 -0400 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id ECB5A5A0D3; Tue, 4 Sep 2018 04:41:38 +0000 (UTC) From: Icenowy Zheng To: Maxime Ripard , Chen-Yu Tsai , Jagan Teki , Jernej Skrabec 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 Subject: [PATCH v4 02/11] clk: sunxi-ng: a64: Add max. rate constraint to video PLLs Date: Tue, 4 Sep 2018 12:40:44 +0800 Message-Id: <20180904044053.15425-3-icenowy@aosc.io> In-Reply-To: <20180904044053.15425-1-icenowy@aosc.io> References: <20180904044053.15425-1-icenowy@aosc.io> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Icenowy Zheng --- New patch in v4. drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 50 ++++++++++++++------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c index d0e30192f0cf..5f80eb018014 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c @@ -64,18 +64,19 @@ 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_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_MIN_MAX(pll_video0_clk, "pll-video0", + "osc24M", 0x010, + 192000000, /* Minimum rate */ + 1008000000, /* Maximum 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, @@ -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", - "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_MIN_MAX(pll_video1_clk, "pll-video1", + "osc24M", 0x030, + 192000000, /* Minimum rate */ + 1008000000, /* Maximum 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