From patchwork Wed Jul 18 10:54:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10532083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 43A326020A for ; Wed, 18 Jul 2018 10:55:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B95F28FA9 for ; Wed, 18 Jul 2018 10:55:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EAD128FBA; Wed, 18 Jul 2018 10:55:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CABD828FAB for ; Wed, 18 Jul 2018 10:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=icj6Dw7bbJunI39o5zpic1DTuqmVfjxaX8cbsEiqS8s=; b=VWi1gAGqP0g1aldHXLinqbklox qqOgJZU5hYUr56GuJkyoLbLiVDSUA8zJEc63oD/i+dGOzpR7Sxuad+YV2ftgSWqZ28AHr4wqqLG6M j1deK1yhypPo2DyzSBrpMJZ8PpIPBj12mOWCTYC5la0lrytHs2kciITFCxm3UuWJ//Z1Tk2HyWG/a Hm6C3hs2TcbHrplTo2Wv6d5K8xdBHq17qmNXxePNbsMR3oKa0kF7cW/rboOfOFH2/uJD8pqShHP/X Sl6LQ383TiqnFPtV5V4z8rsGQoa+Y4ui+h+v/FDoYbhTOAySqZzL43rNWtPmYWM+kZDFEMM+RRcHS 6ruWPrrg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffk7X-0001Vl-Pm; Wed, 18 Jul 2018 10:55:47 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffk7J-0001Dc-Qg for linux-arm-kernel@lists.infradead.org; Wed, 18 Jul 2018 10:55:37 +0000 Received: by mail-pf0-x242.google.com with SMTP id j26-v6so2020885pfi.10 for ; Wed, 18 Jul 2018 03:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aS0R/TfkevDrS2zrgOVE3mC2tHeBQtHUwt/i9SJ6RdQ=; b=bRpFOgwsjxueMyoRklMpe6OyzlctIVML7jQ2K122JHIHQlkTrL7FDk8DfztJSKc1ZU F/eE8DhKQ55Up9ADd/V/wmhV4DTOzN/sNneVYXUiZvNxGVX2f1y8pMX42yLtCm8lDsMd S6ScFR4KdXRx+UWBeQv9UFXyL437ybhFh9xKY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aS0R/TfkevDrS2zrgOVE3mC2tHeBQtHUwt/i9SJ6RdQ=; b=SbAfkEEY6PHVvm+K56kmM2aFF5itqoPS0P3jHG+hix68i1oCfYK5uiIh2oXnI4RVu5 1O0Vf3y3jpZ//BQZlWQ7eqXvpMuqLpxXTEBXcy+7O8Sx38PY/LHnG/4PsnjgsWz01cMZ MJM7pYZNr5zJlmvPho40jbsODNCTo+b4LuJXJxraovu7lRiTUTd9H/1DR1w1h9UW/eP6 FCaKkE+OUYxrqTFOuuWU8ykg19rBCRymMURTWdMZ45yMul0U75SIYFfEkVClMA62Xn8+ IsPdkYZZcbxnTgJwFriLzLRbcEQRjxdabEG+bJDq6CYMXgeXIjS4VyKuEn0sqyMhb/ue wOvw== X-Gm-Message-State: AOUpUlHtcdQKnqkyLO2wiqhfsXdasCcJ06LskMT0CMTPoW2VlhvWVqGa A/ocNPF7jS4um+vVrI7Hf5JC/A== X-Google-Smtp-Source: AAOMgpexv8XeWifkwa8eM7i0s4XNhCvlsvMMmLUA8TXbdBnNATebixVwUROGtBNsWgG/eOPOmTpmxA== X-Received: by 2002:a63:3046:: with SMTP id w67-v6mr878042pgw.176.1531911323248; Wed, 18 Jul 2018 03:55:23 -0700 (PDT) Received: from localhost.localdomain ([183.82.229.107]) by smtp.gmail.com with ESMTPSA id x25-v6sm4644452pgv.63.2018.07.18.03.55.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 03:55:22 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 01/18] clk: sunxi-ng: a64: Add minimal rate for video PLLs Date: Wed, 18 Jul 2018 16:24:41 +0530 Message-Id: <20180718105458.22304-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180718105458.22304-1-jagan@amarulasolutions.com> References: <20180718105458.22304-1-jagan@amarulasolutions.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180718_035534_205433_E7777A4D X-CRM114-Status: GOOD ( 13.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Changes for 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,