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: 9869113 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 D648160382 for ; Fri, 28 Jul 2017 16:33:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E745A287A4 for ; Fri, 28 Jul 2017 16:33:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBE872887F; Fri, 28 Jul 2017 16:33:32 +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 690F4287A4 for ; Fri, 28 Jul 2017 16:33:32 +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=oXqjjDfpSPwtX00y0NOKbAr2K+1sMXXGCfa/+EGj5W4=; b=Xpo Yinwp6QrM00rN7iBowRrkuDcngvrzgownOmEjyrV9wh78k7j0IS9jjVsauUhYznAnobN7hz1wO3IH uALjNDiZbxWjy99rEscI53yOHDrc+vH6B3uWkI+LOoS1f6WpELYwR6mag/8CGICFlkUzX2rNn+cyb AqDqDC2c40UNE5l5UdymRC4YEUvojhAMGTf0tmt6arWTYPjclMz4mv70+zkMZkO9zh/d6PUTEfzyU UaDte4x0cKI1QRi13+0UBUpZPvPv7E8JU0t8jpzpEy+/M1wGSjk20UzKBKy1oAGzbujfjgKvgDJaq M6r6QhIsf2PXi8TvtwAFapiLk3YvIWw==; 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 1db8Ch-0005PQ-NI; Fri, 28 Jul 2017 16:33:31 +0000 Received: from mail-wr0-x233.google.com ([2a00:1450:400c:c0c::233]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1db8C6-0004q3-DT for linux-amlogic@lists.infradead.org; Fri, 28 Jul 2017 16:32:58 +0000 Received: by mail-wr0-x233.google.com with SMTP id 12so157282661wrb.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=dqMfRmfyHaNoNWDBxdM4EnfwTcoXDSHc1u1scqLyBhuAa59tT/hiS9+VZlmb1wZBKp aFT4fYL6nkuhB1/zwqU+9vI2nPEn8terVlz/+ce/dt2oLwQvQ0ubg/LtFferRqQ0AVby 2B5dgODsYKBf+sx2feCLvUL1f9txzr7UenfU1Hg60tzIoB6X2S3SGrLKEga+QG9bH2RX P3nMdYOOOVrnaR87LPxKZmo71Te0Sd9yaX6FTwIRV5YH+dl8Lo/YscSSKNZh++epsX9q 0jdYJ6uIY0YdQHMJFPkyXjvy1QrLEhKVIPyhuH+4EyHexRAMilijum64GqE2mJgtVVdP BBHQ== X-Gm-Message-State: AIVw112lPlQ52a8g32pYwKO/dF39gDga3oj7pNAgN38IvJRcW3LWbHgo dV9rM6gbCdcCE3uL 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_684787_4B395E17 X-CRM114-Status: GOOD ( 10.53 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=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",