From patchwork Fri Jul 28 16:32:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 9869115 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 5DEC260382 for ; Fri, 28 Jul 2017 16:33:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EB9C287A4 for ; Fri, 28 Jul 2017 16:33:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 634FB2887F; Fri, 28 Jul 2017 16:33:38 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 21470287A4 for ; Fri, 28 Jul 2017 16:33:38 +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: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:In-Reply-To: References:List-Owner; bh=s+K9BWB/V+7KEBW8q67ELlwmmPqtJnyjRDsEMrG6yIY=; b=jIo ZXrs+RpxTx0IJwZaoao2hqkG4lQRKY3xkHpdIUd/XuaPEqe5hp44AeqokvC7m5PiKAVs0FmPbCWV7 7YtsFW8gyG5ezD6p9/eI/vqclUkrItfZPhaJA6wWPxUel7LRqPwqdgkNCbXVzqTC2rne5y1kSNDAF llRiyyGwBvrltLnhDVPWNhxajqgBgRb7l4li0S1QWi5M0mSIlJ1Bt5gX0OQquFIRwsulT3BrVmTYv ghVa6CRwtqg/+dpJzGhhAo7rDCCOenrb2zcfSEKOCXCPUIFJOMQrxK3uCBFcmXSj2PIJ+xmVlO3D4 OjFJPpzLFRX2xux3OnYTqee/rZ9KrpQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1db8Ck-0005RC-LT; Fri, 28 Jul 2017 16:33:34 +0000 Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1db8C6-0004q4-9O for linux-arm-kernel@lists.infradead.org; Fri, 28 Jul 2017 16:32:58 +0000 Received: by mail-wr0-x234.google.com with SMTP id 12so157282662wrb.1 for ; Fri, 28 Jul 2017 09:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=858//qIgMH87QWzyrE9thf6NrYEO1SGBN5EYbC0RLrE=; b=VYjZ+8hoFpuZthgS68Nu8LpxIlOBfbvXOvVztby22OWBqMgmj3DywwRdrRDdrcu3XZ r771jjq4t7dvfLCaRLuHjILcpy5zKNsrz2XpqMpBsU8JdgrXY1tpTTvBTmv+bqnnGoUe Iq7m47p/6hecgO+kxFCIyuz7ygnH1Lizd9ta3Ua5OILP0T4y4I3qvr7Kl8hKG3brErWE u24fbpkjTEtxcvWwLPj/EyPmvZW+kNb8okwd2CTDOWv4i+vukF+U4UI+mP1+3iW6vxAV 4h7e9vLFAfL2SDX69tW7kw0KGg/SFSBhlV71RK+qeMyDh+kZXIYM62aG3exFe8EYdPMD w0qw== 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; bh=858//qIgMH87QWzyrE9thf6NrYEO1SGBN5EYbC0RLrE=; b=GW1ynhtyniz2b0bu8yvtB1exAzY9XcNryoxOXqtJCgTBV+obeqJJaAJje4t+/e/5z6 GgazzY7rv4ogL9kvRx+D5s+75e9F9V8K+2EbLFkItPSj8TARTISFFFKWo9mVf1iZsLVX iHuQf/7HE6FNNuiKg0GEQxrj1et/hg6xgzqmoKJz1YzBbSEktiDKPH2gkq/idq0U9JOi WaCViRM2hBdIlP7Heo2nKe+kJBbne9E30LVQ/S24JnB0ALBVC1HnNKxX+ttIsGTNaVeN guwqTe0O00Yg3Yi/7F7XpvlJMnszTCqRWSq1hNzZOboNPrWb9h4/Y64LsCCKQ43svDVt yXTA== X-Gm-Message-State: AIVw113SXprvp3MtFdRsNgPju9qC5D0BTghhNeGUHUkSUK+X9H5e+cZm qXaH/7+RTtGHgQCs X-Received: by 10.223.179.13 with SMTP id j13mr6295182wrd.228.1501259552244; Fri, 28 Jul 2017 09:32:32 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id 15sm4714353wmo.7.2017.07.28.09.32.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jul 2017 09:32:31 -0700 (PDT) From: Jerome Brunet To: Neil Armstrong , Michael Turquette , Stephen Boyd , Kevin Hilman Subject: [PATCH] clk: meson: mpll: fix mpll0 fractional part ignored Date: Fri, 28 Jul 2017 18:32:28 +0200 Message-Id: <20170728163228.10879-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.9.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170728_093254_628245_D83ACFB2 X-CRM114-Status: GOOD ( 11.86 ) 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: linux-kernel@vger.kernel.org, Carlo Caione , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet 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 mpll0 clock is special compared to the other mplls. It needs another bit (ssen) to be set to activate the fractional part the mpll divider Fixes: 007e6e5c5f01 ("clk: meson: mpll: add rw operation") Signed-off-by: Jerome Brunet --- drivers/clk/meson/clk-mpll.c | 7 +++++++ drivers/clk/meson/clkc.h | 1 + drivers/clk/meson/gxbb.c | 5 +++++ drivers/clk/meson/meson8b.c | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/drivers/clk/meson/clk-mpll.c b/drivers/clk/meson/clk-mpll.c index 39eab69fe51a..44a5a535ca63 100644 --- a/drivers/clk/meson/clk-mpll.c +++ b/drivers/clk/meson/clk-mpll.c @@ -161,6 +161,13 @@ static int mpll_set_rate(struct clk_hw *hw, reg = PARM_SET(p->width, p->shift, reg, 1); writel(reg, mpll->base + p->reg_off); + p = &mpll->ssen; + if (p->width != 0) { + reg = readl(mpll->base + p->reg_off); + reg = PARM_SET(p->width, p->shift, reg, 1); + writel(reg, mpll->base + p->reg_off); + } + p = &mpll->n2; reg = readl(mpll->base + p->reg_off); reg = PARM_SET(p->width, p->shift, reg, n2); diff --git a/drivers/clk/meson/clkc.h b/drivers/clk/meson/clkc.h index d6feafe8bd6c..1629da9b4141 100644 --- a/drivers/clk/meson/clkc.h +++ b/drivers/clk/meson/clkc.h @@ -118,6 +118,7 @@ struct meson_clk_mpll { struct parm sdm_en; struct parm n2; struct parm en; + struct parm ssen; spinlock_t *lock; }; diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 59a296b119ea..79b195b4df03 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -528,6 +528,11 @@ static struct meson_clk_mpll gxbb_mpll0 = { .shift = 14, .width = 1, }, + .ssen = { + .reg_off = HHI_MPLL_CNTL, + .shift = 25, + .width = 1, + }, .lock = &clk_lock, .hw.init = &(struct clk_init_data){ .name = "mpll0", diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index bb3f1de876b1..6ec512ad2598 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -267,6 +267,11 @@ static struct meson_clk_mpll meson8b_mpll0 = { .shift = 14, .width = 1, }, + .ssen = { + .reg_off = HHI_MPLL_CNTL, + .shift = 25, + .width = 1, + }, .lock = &clk_lock, .hw.init = &(struct clk_init_data){ .name = "mpll0",