From patchwork Mon Mar 25 11:11:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10868837 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A10561669 for ; Mon, 25 Mar 2019 11:12:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 883BA2930D for ; Mon, 25 Mar 2019 11:12:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8643129323; Mon, 25 Mar 2019 11:12:31 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 207B12932B for ; Mon, 25 Mar 2019 11:12:31 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=rQ9w4DLEAIYlBtf9HBsktEwZ521NvF3vxtv+x/1dPec=; b=iLz0iv9ua0R1fa RPmDHTAa6mrStQU/TVMr/qL2FUlVQ16aWAZrQgCcGz0dcVLVH/4jRt8LYP0JGAxfzD/Tyo66pW7cG hrAQCZky5+EOnMzeMITbkgD0eS51iAEXG6zGpg8tD0kmZnXuWtFfoF0l0XDOx2gE0mz3uqtOfy4Ii RzIEEjBSvB37U0kEkI/RlIBkqIZC6t9Nlbg3udx2PpUcPppg4BPj3pB0LP/VbQZhPef5Qs/+S7XX2 +4lo8cyhdjf0VxoGrkDR/vHuuY3WlqGdec1w31tyaMLCWDE6WQrteI7D4k5P5V5kO0SDjaqRxD6lj DNJkLSqhLf+Ly0WYOn4w==; 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 1h8NWn-00074H-1o; Mon, 25 Mar 2019 11:12:29 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8NWg-0006wc-1z for linux-amlogic@lists.infradead.org; Mon, 25 Mar 2019 11:12:27 +0000 Received: by mail-wr1-x444.google.com with SMTP id g3so6120107wrx.9 for ; Mon, 25 Mar 2019 04:12:20 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=ni9wuRQYti+VN96MUqmtZken5FIKCN6vt8HcbUKOpXk=; b=Ob4wr/p7CWJ0/0rb9BiX/8sfRVwR/RvMNb1rQR4KEx5nw/PtNynhStx9LaWhSq0GIP xR+C5qFlH4eONwWVhTSqBRlO5OzIDe11Xop0RGfFTLs/8fMOUKuIXIbK1ciFfnkhs0iN V6RXmZbqDSOg6MeWgSp6ICBq9mmNE5q8pgR2Zv72oiXpvVphSuXMbBQoZWlTMAQ3gfIm xi8bDZS2bD3NZuCZWfJiS95K96NVuddvWL3LoNaAmKDR9lbmL+y7hA2n1TTPBStgBuTw YuM/hqcL6Jc7VKb6YlJT4Qfmq6jh8gakcKYYua1swt8xgKWBqIJ9DC2cXnfb/HQyvDin XO7w== 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:mime-version:content-transfer-encoding; bh=ni9wuRQYti+VN96MUqmtZken5FIKCN6vt8HcbUKOpXk=; b=dBakwfd36ZqW2drztydd3VKMcCFcmwVkwBmu62SMxm/dhhXUNRi9o/NjaXxXpwtCxM YSxLHpLMHSq06oMDJM1Cu9ECAmEAr9Se4PK8H1sGT9nwFA03eJ+dhatpbvyYQWKE+CFD A5IPeGHxXQYmgNsq3bc/JdRSdXRX/SyAXHge5tkWsq58y8/LfBRngZvs6UduJcAIdG+a nr/Bojk5dDfqH5vfKcbTDL0B6tv+BA2zEPb0pvOB3RO9kM0wQvEtCYynbQmyE2CX896E N8vv/FaqDLbUsPOR2iOLlE942sXDRFBdy3uOQUMpWS83IYbf5z65EXNVdXIQcPjHf0q9 cVgw== X-Gm-Message-State: APjAAAV/YlLPGJUZhyJlH7pnee/r+QRD6Gs3hmgO13yn4X0HeYuxeANM WsAcK3ascWPIndgHWuXoETOE9g== X-Google-Smtp-Source: APXvYqwcFxJqyNOkSqAjk6X+AhxICLKJQREHSLxv7WELpuv38fpDdjQoI7dcc0hb9DhLMJnBEaY8XQ== X-Received: by 2002:a5d:68cf:: with SMTP id p15mr11536669wrw.301.1553512329569; Mon, 25 Mar 2019 04:12:09 -0700 (PDT) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id n188sm15134301wme.13.2019.03.25.04.12.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Mar 2019 04:12:08 -0700 (PDT) From: Jerome Brunet To: Neil Armstrong Subject: [PATCH 1/4] clk: meson: mpll: add init callback and regs Date: Mon, 25 Mar 2019 12:11:57 +0100 Message-Id: <20190325111200.15940-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190325111200.15940-1-jbrunet@baylibre.com> References: <20190325111200.15940-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_041222_098089_DFC777DE X-CRM114-Status: GOOD ( 15.42 ) 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-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Until now (gx and axg), the mpll setting on boot (whatever the bootloader) was good enough generate a clean fractional division. It is not the case on the g12a. While moving away from the vendor u-boot, it was noticed the fractional part of the divider was no longer applied. Like on the pll, some magic settings need to applied on the mpll register. This change adds the ability to do that on the mpll driver. Signed-off-by: Jerome Brunet --- drivers/clk/meson/clk-mpll.c | 33 +++++++++++++++++++++++---------- drivers/clk/meson/clk-mpll.h | 2 ++ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/drivers/clk/meson/clk-mpll.c b/drivers/clk/meson/clk-mpll.c index f76850d99e59..64d31c8ba3d0 100644 --- a/drivers/clk/meson/clk-mpll.c +++ b/drivers/clk/meson/clk-mpll.c @@ -115,21 +115,12 @@ static int mpll_set_rate(struct clk_hw *hw, else __acquire(mpll->lock); - /* Enable and set the fractional part */ + /* Set the fractional part */ meson_parm_write(clk->map, &mpll->sdm, sdm); - meson_parm_write(clk->map, &mpll->sdm_en, 1); - - /* Set additional fractional part enable if required */ - if (MESON_PARM_APPLICABLE(&mpll->ssen)) - meson_parm_write(clk->map, &mpll->ssen, 1); /* Set the integer divider part */ meson_parm_write(clk->map, &mpll->n2, n2); - /* Set the magic misc bit if required */ - if (MESON_PARM_APPLICABLE(&mpll->misc)) - meson_parm_write(clk->map, &mpll->misc, 1); - if (mpll->lock) spin_unlock_irqrestore(mpll->lock, flags); else @@ -138,6 +129,27 @@ static int mpll_set_rate(struct clk_hw *hw, return 0; } +static void mpll_init(struct clk_hw *hw) +{ + struct clk_regmap *clk = to_clk_regmap(hw); + struct meson_clk_mpll_data *mpll = meson_clk_mpll_data(clk); + + if (mpll->init_count) + regmap_multi_reg_write(clk->map, mpll->init_regs, + mpll->init_count); + + /* Enable the fractional part */ + meson_parm_write(clk->map, &mpll->sdm_en, 1); + + /* Set additional fractional part enable if required */ + if (MESON_PARM_APPLICABLE(&mpll->ssen)) + meson_parm_write(clk->map, &mpll->ssen, 1); + + /* Set the magic misc bit if required */ + if (MESON_PARM_APPLICABLE(&mpll->misc)) + meson_parm_write(clk->map, &mpll->misc, 1); +} + const struct clk_ops meson_clk_mpll_ro_ops = { .recalc_rate = mpll_recalc_rate, .round_rate = mpll_round_rate, @@ -148,6 +160,7 @@ const struct clk_ops meson_clk_mpll_ops = { .recalc_rate = mpll_recalc_rate, .round_rate = mpll_round_rate, .set_rate = mpll_set_rate, + .init = mpll_init, }; EXPORT_SYMBOL_GPL(meson_clk_mpll_ops); diff --git a/drivers/clk/meson/clk-mpll.h b/drivers/clk/meson/clk-mpll.h index cf79340006dd..2925fb939fdd 100644 --- a/drivers/clk/meson/clk-mpll.h +++ b/drivers/clk/meson/clk-mpll.h @@ -18,6 +18,8 @@ struct meson_clk_mpll_data { struct parm n2; struct parm ssen; struct parm misc; + const struct reg_sequence *init_regs; + unsigned int init_count; spinlock_t *lock; u8 flags; }; From patchwork Mon Mar 25 11:11:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10868829 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB94A13B5 for ; Mon, 25 Mar 2019 11:12:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A36082930F for ; Mon, 25 Mar 2019 11:12:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A149729311; Mon, 25 Mar 2019 11:12:25 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 4B3A329314 for ; Mon, 25 Mar 2019 11:12:25 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=pAZIspwSxd4VFqso0zSp1lLIDyaifidqvQEcV1gYmI8=; b=hLlnbIwP6ThOJO wK3nwN0d5owz/BVxg35MD3bmUYYIDj5awGYIVWvPGIpktAWFQIU12Xr3EmBEnvyr4HmL+VWurVTHS REMV/XBsPimtoW1Tk8xiK/76nbgZjBpTrCpfTWZh6faW3VQf2nNMKVUo3Xueso4hNNvp5eyI9GzUf giFFF+JPnTG8/4KD8Fs6DynmUdMj+pSK8jSuMpyF1P3Nms401Gn5FVaxK5SrFEkyuf91k3fFQc3A9 Ecfgie5WJvma8V4DGDV9uZFQYJA2nVE9wOHx6PJepnvjS9onl9yb+DE3vq5oORLVyPbK54uQEkg4z 2LLmtwifKoFpICl7cCtw==; 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 1h8NWi-00070O-Hb; Mon, 25 Mar 2019 11:12:24 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8NWZ-0006wo-W9 for linux-amlogic@lists.infradead.org; Mon, 25 Mar 2019 11:12:22 +0000 Received: by mail-wm1-x343.google.com with SMTP id a188so8550962wmf.3 for ; Mon, 25 Mar 2019 04:12:13 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=qSTs5pvYtXziAiN+RG5xFnEp9XYC2fpG75vZzF22hfs=; b=r3pB7Xygzu97DmUwohN4so1YlPfsLTJ88ye6r8Q2iVezfT/WFu9hwCEU1PXM1tjKII PxuYgGCi4bDjes2TRQ4hQQHItbg62/GmXe9EKrvRDG1PArBeWJaO7zjKj4AyUao8kS2o wkdmW4+IaPU1bd8yO74i685YPAtjkUqGMBwqDwNCHtKDFtvbKsmZ0OfmlWU8bNx025Md G0IFYc1IrmdqROt6L2exGp7vHh1pHrosX/x7TGxpWzh+AOWsCWXlN5n2Oz9b3HqKNLOm ltljs3l5jY4xRBTlvZiWcD+AVvy0QMgnAl1+aP34cu+46Qkn6UUH4H6lUw1yILBgWxCG OlUw== 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:mime-version:content-transfer-encoding; bh=qSTs5pvYtXziAiN+RG5xFnEp9XYC2fpG75vZzF22hfs=; b=sQ92dSppmuyRLvxILV/aDCihCdGUC9eqeCyH9LfugaZZV8KF6MkY+VzZQtKu6j+Na/ KNgQuxzLpqNrcSinUGcOzR87bVXHuvRjNzH3MKb6hj4YDaUJR1h5Mr9I/RIUHA/DzPyd VeUEq6ONqpnUCCxKFEUYvHnTyiBuksSdUSB83fyY+RBTaVvgeZGJtbnkUBwd+1y8JddC bIc6Ld15MI/tDG6+3zvfCtzPe5z2Pv+lxCqzoKyo1H0wn2oqqbWt8FPZ7Vr67w4i+haK 71SiUklwYSh04+OWpgJZMnw3CSM3IXQDJdglEXVKGx/rkaNNk/iKNxJY3lY9s0RtPiv4 MZAg== X-Gm-Message-State: APjAAAXbysYja7M8e4F4qFNUrmuqIZcSF6OOKcGHu3DC+fqWasPhSKje zw5urWFGLx+xd+805i758EP4QA== X-Google-Smtp-Source: APXvYqwbT8APELDi6g2qSkQz94txZgo1z92evuBUYL68fQZejF9n6rSg43J6ivlL4CwiNuv+RYquIA== X-Received: by 2002:a7b:cd9a:: with SMTP id y26mr5392149wmj.31.1553512330909; Mon, 25 Mar 2019 04:12:10 -0700 (PDT) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id n188sm15134301wme.13.2019.03.25.04.12.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Mar 2019 04:12:10 -0700 (PDT) From: Jerome Brunet To: Neil Armstrong Subject: [PATCH 2/4] clk: meson: g12a: add mpll register init sequences Date: Mon, 25 Mar 2019 12:11:58 +0100 Message-Id: <20190325111200.15940-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190325111200.15940-1-jbrunet@baylibre.com> References: <20190325111200.15940-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_041216_034721_8331CD05 X-CRM114-Status: UNSURE ( 9.02 ) X-CRM114-Notice: Please train this message. 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-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add the required init of each MPLL of the g12a. Signed-off-by: Jerome Brunet --- drivers/clk/meson/g12a.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c index d3f53a9b97dc..6a01f8fd8114 100644 --- a/drivers/clk/meson/g12a.c +++ b/drivers/clk/meson/g12a.c @@ -577,6 +577,10 @@ static struct clk_fixed_factor g12a_mpll_prediv = { }, }; +static const struct reg_sequence g12a_mpll0_init_regs[] = { + { .reg = HHI_MPLL_CNTL2, .def = 0x40000033 }, +}; + static struct clk_regmap g12a_mpll0_div = { .data = &(struct meson_clk_mpll_data){ .sdm = { @@ -600,6 +604,8 @@ static struct clk_regmap g12a_mpll0_div = { .width = 1, }, .lock = &meson_clk_lock, + .init_regs = g12a_mpll0_init_regs, + .init_count = ARRAY_SIZE(g12a_mpll0_init_regs), }, .hw.init = &(struct clk_init_data){ .name = "mpll0_div", @@ -623,6 +629,10 @@ static struct clk_regmap g12a_mpll0 = { }, }; +static const struct reg_sequence g12a_mpll1_init_regs[] = { + { .reg = HHI_MPLL_CNTL4, .def = 0x40000033 }, +}; + static struct clk_regmap g12a_mpll1_div = { .data = &(struct meson_clk_mpll_data){ .sdm = { @@ -646,6 +656,8 @@ static struct clk_regmap g12a_mpll1_div = { .width = 1, }, .lock = &meson_clk_lock, + .init_regs = g12a_mpll1_init_regs, + .init_count = ARRAY_SIZE(g12a_mpll1_init_regs), }, .hw.init = &(struct clk_init_data){ .name = "mpll1_div", @@ -669,6 +681,10 @@ static struct clk_regmap g12a_mpll1 = { }, }; +static const struct reg_sequence g12a_mpll2_init_regs[] = { + { .reg = HHI_MPLL_CNTL6, .def = 0x40000033 }, +}; + static struct clk_regmap g12a_mpll2_div = { .data = &(struct meson_clk_mpll_data){ .sdm = { @@ -692,6 +708,8 @@ static struct clk_regmap g12a_mpll2_div = { .width = 1, }, .lock = &meson_clk_lock, + .init_regs = g12a_mpll2_init_regs, + .init_count = ARRAY_SIZE(g12a_mpll2_init_regs), }, .hw.init = &(struct clk_init_data){ .name = "mpll2_div", @@ -715,6 +733,10 @@ static struct clk_regmap g12a_mpll2 = { }, }; +static const struct reg_sequence g12a_mpll3_init_regs[] = { + { .reg = HHI_MPLL_CNTL8, .def = 0x40000033 }, +}; + static struct clk_regmap g12a_mpll3_div = { .data = &(struct meson_clk_mpll_data){ .sdm = { @@ -738,6 +760,8 @@ static struct clk_regmap g12a_mpll3_div = { .width = 1, }, .lock = &meson_clk_lock, + .init_regs = g12a_mpll3_init_regs, + .init_count = ARRAY_SIZE(g12a_mpll3_init_regs), }, .hw.init = &(struct clk_init_data){ .name = "mpll3_div", From patchwork Mon Mar 25 11:11:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10868839 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E1041669 for ; Mon, 25 Mar 2019 11:12:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5314829327 for ; Mon, 25 Mar 2019 11:12:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 473EA29325; Mon, 25 Mar 2019 11:12:33 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 ED56029322 for ; Mon, 25 Mar 2019 11:12: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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=4msddlzpiXZ06vfPhpJselgeZec9jOGX8CJoNY0DeL0=; b=WwE9nkn4y0wSrm vzSIqQy4a57vLQWWYYdrCgbQMLOz1RiVM0vdaIZQQehWav+rrJ6X31ea1nYtQub/2z46BccyCmrdU 8VDgOhcqSq4g0urjyjVhxkHUx1sqcR6jxCsuq83lYABV7ZRp/R/ng9H8ZqQ91VkJBRCNosE579lmo wPfhJ9IS+dd/tO3L4cuxnMA2uvnT4WYFFfWf40bRWcfpJHxrCHs3a64FVf6ZR2CiWPFsjkuNXpghn zZl/8XGBvZTZk+xxVOTzN0QsiypwD8jaFi0/tNglZv3C7gHQHn//kzMZQMJy06tYuMGY7XaSpCkIi mQg4EzZyWIae6PSGsy0w==; 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 1h8NWp-00076o-Vm; Mon, 25 Mar 2019 11:12:31 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8NWb-0006wp-TM for linux-amlogic@lists.infradead.org; Mon, 25 Mar 2019 11:12:28 +0000 Received: by mail-wr1-x442.google.com with SMTP id g3so6120301wrx.9 for ; Mon, 25 Mar 2019 04:12:14 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=fKq0Xmw2ntAqrTVNaEz/XqYkib9vFynLezQDvMrUHDU=; b=HLJdfe4usokrPovRQReXb3u4/AX4uD/nG1dOjRXM6qMGCuiE5XhVyoMWmgp32yaGTl kEu0Zh5L1k0o/ERmTU8U4rscsJj0nWj/V8kyY7/Bt8NiBAJZwpypz4lHJDmu7veLelcC XFrn4pOXj2r+UCdQ63gUljC2h3SYDRx4RIzmUHYMAwr3oppJcj7pTt1Ikg+9OVQvPZ5j 12nBK8Y+Lk+jVhREudTFRTbR0LmKuV/FaWQ3jzZNNIOI9e1jYSt9Fp6qhik5niLFfWxP RI2/3IbJD+kOC/TGr6o3PqhrD8VcUs1GmsRyOeyJov2zDMq9j2mjxDABZe8u2bfXWS7z OpEA== 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:mime-version:content-transfer-encoding; bh=fKq0Xmw2ntAqrTVNaEz/XqYkib9vFynLezQDvMrUHDU=; b=QNx58aCnKoCUaOwoRPJFvBjKm0zI8AxEAiewgyyIqI8rbNvRmQUkMFcW1dHWBaC4BK c3/ezlARn4tGGJ2pbOXrw8aWUUieX+6ip3Ts6QZtGtKiLXuGtkzWbQwLccEgAZaGPbGO /kFi2754zktFkvkexZAbefi7morR/8QM367tz/6CaTgL/4Nbc+v47WbJOlVV8TYuI2jW 9+sc5W+7whZ7Fy4eowAKHkRcP6Vmk3rWPpHQuh/jfboI0F0lYXbH84xsSTvRIHyM2HtQ nBtvwyBN3D27dx59PKgiWjwEfyl5Tcfq5JyBxq60Hx14KqqfwkD2jrUuOxRLc5oQ8Nx4 r4CA== X-Gm-Message-State: APjAAAUiHuGRm5bg+2tSIBqvkInkrBKTVo849VOa/KAaU4CEH64AWgD5 VvA+6G5HnnEG7SNkH2U097V+Jw== X-Google-Smtp-Source: APXvYqzuscNSf995R6bIjyFx5XSYb8F+ngHC5dvyb/ItWnCgkc4V1XJlyCosXz1frjAulr1d0+N0lg== X-Received: by 2002:adf:dcca:: with SMTP id x10mr15173526wrm.57.1553512332252; Mon, 25 Mar 2019 04:12:12 -0700 (PDT) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id n188sm15134301wme.13.2019.03.25.04.12.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Mar 2019 04:12:11 -0700 (PDT) From: Jerome Brunet To: Neil Armstrong Subject: [PATCH 3/4] clk: meson: eeclk: add init regs Date: Mon, 25 Mar 2019 12:11:59 +0100 Message-Id: <20190325111200.15940-4-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190325111200.15940-1-jbrunet@baylibre.com> References: <20190325111200.15940-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_041217_995251_8EA57A80 X-CRM114-Status: GOOD ( 12.17 ) 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-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Like the PLL and MPLL, the controller may require some magic setting to be applied on startup. This is needed when the initial setting is not applied by the boot ROM. The controller need to do it when the setting applies to several clock, like all the MPLLs in the case of g12a. Signed-off-by: Jerome Brunet --- drivers/clk/meson/meson-eeclk.c | 3 +++ drivers/clk/meson/meson-eeclk.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/clk/meson/meson-eeclk.c b/drivers/clk/meson/meson-eeclk.c index 37a34c9c3885..6ba2094be257 100644 --- a/drivers/clk/meson/meson-eeclk.c +++ b/drivers/clk/meson/meson-eeclk.c @@ -34,6 +34,9 @@ int meson_eeclkc_probe(struct platform_device *pdev) return PTR_ERR(map); } + if (data->init_count) + regmap_multi_reg_write(map, data->init_regs, data->init_count); + input = meson_clk_hw_register_input(dev, "xtal", IN_PREFIX "xtal", 0); if (IS_ERR(input)) { ret = PTR_ERR(input); diff --git a/drivers/clk/meson/meson-eeclk.h b/drivers/clk/meson/meson-eeclk.h index 1b809b1419fe..9ab5d6fa7ccb 100644 --- a/drivers/clk/meson/meson-eeclk.h +++ b/drivers/clk/meson/meson-eeclk.h @@ -17,6 +17,8 @@ struct platform_device; struct meson_eeclkc_data { struct clk_regmap *const *regmap_clks; unsigned int regmap_clk_num; + const struct reg_sequence *init_regs; + unsigned int init_count; struct clk_hw_onecell_data *hw_onecell_data; }; From patchwork Mon Mar 25 11:12:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10868835 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2ABC81669 for ; Mon, 25 Mar 2019 11:12:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13BFD2930D for ; Mon, 25 Mar 2019 11:12:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1231629323; Mon, 25 Mar 2019 11:12:27 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 C6E4E2930D for ; Mon, 25 Mar 2019 11:12:26 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=x/uA8llBAishuLR7ttGeHlw2cscYkon28UbDjWHY8GM=; b=Rn0aMptCrLYywO ayqpOCFwxx/iB3RztTD2PI5MgXHBBsctRpxXl2lhSSuxnPlcmMtqhy57uTGz6eLQxjZw7BfgZEb6k PQgg0kw4FyVmdXvh14eOZYMj92nxnpSa+MuZuUc5ij5IdclraliNVHLu+cT+OrEmilg5CAHD6FHm7 5XI6AmPY3Cnps0qwPU8QEy1CT8YDfNMSreH6szY3yAb2O9UmMqROZpntekwLTL57QgCJIjDWvz+l6 b+YtVErgYqsn6lM5Zba4F1kLyUQZ2iHEH4fThxo7Kn3XVxyEmELFLyzhm/vGhN5JmnMa2CcGedqaY 00ZB1KTJOElrPO5Df5xg==; 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 1h8NWj-00071B-7u; Mon, 25 Mar 2019 11:12:25 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8NWb-0006wr-MO for linux-amlogic@lists.infradead.org; Mon, 25 Mar 2019 11:12:23 +0000 Received: by mail-wr1-x443.google.com with SMTP id q1so9636950wrp.0 for ; Mon, 25 Mar 2019 04:12:16 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=lAGWjMAs38DEOf/pdjEPeHnYiewe/7N+ZGB7ijz15Bo=; b=ql/x+8w0gvnjiOmBFCOu+1IvlNLQrImu2eLZMJAVSkLr+jZwuMb9B181TuREU+XAE7 AxWFjEkwgWAtQz8ra2n8+XBQUjum6z8lqsIkhKPmHwi1T/6VtQWZs2Ou5gB/WiPlXqp7 WjqxS3r7Km2Rg0CeuCwrSSsRtMJt80f4kssIE4in9qlkvCWBH/FRXYlGIAorh1uOZbhD jvNLGG3NEJv+asBYQrBn5AAvwc1ohR449SBgeSO3FuNCmubw0+2ajLv45dF9/0NqaHAu 8orkzxE6+8FxHDbRqYLun476oiFoNcwtEJoP5VVRQ1duMwJSLqFiaRbNV6lka/ptUdjk WJdw== 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:mime-version:content-transfer-encoding; bh=lAGWjMAs38DEOf/pdjEPeHnYiewe/7N+ZGB7ijz15Bo=; b=Bv3guuhe/I+5lt+o7hfeefNyhHT71Z6lIo0aKiG0ncuaTeOVAW6MYmiU1TM4IqivmW D3v8f9jfmKZNlV16g9Pc30tOMSeKtpjB/NfjElxjHBnz9xeVN6I9rXbShizyKYGYDJPr mN+oGdKT/dareW3B9n7gbNDiPp83wrEF1npyh/LuYQRg1+iN42AH9VQDW6KMPP1Z3bUN RVmvM6Ub8aCW+deFVEbrR+1yrTxA1Jzj6iCCDgdRBb7qiQI5fsF/CsaVKgHsIvT2kLgM uX4m3ZsUZc9NKRKFNIbPQ+prPKM7UaYOXkh1AOaN+qG2fgV9bx5yNZf7Ku6cLPz1rD0a V3Lw== X-Gm-Message-State: APjAAAUYgLevtdwzfbVjTdvkIhaMQVuGS/CehoDwQrGGuwCG3w1h1QkB zcZdfSCvL/m9reHgPQEu22/gfQ== X-Google-Smtp-Source: APXvYqw/+i+ZkuaKLPTf9yiwTZxD3nYX18DOHDoDAnF8ffCGsjZFKs7JKpqeEN6Fg3pqiwin2yIPwQ== X-Received: by 2002:a5d:6682:: with SMTP id l2mr14687126wru.33.1553512333489; Mon, 25 Mar 2019 04:12:13 -0700 (PDT) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id n188sm15134301wme.13.2019.03.25.04.12.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Mar 2019 04:12:12 -0700 (PDT) From: Jerome Brunet To: Neil Armstrong Subject: [PATCH 4/4] clk: meson: g12a: add controller register init Date: Mon, 25 Mar 2019 12:12:00 +0100 Message-Id: <20190325111200.15940-5-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190325111200.15940-1-jbrunet@baylibre.com> References: <20190325111200.15940-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_041217_728054_2EABA378 X-CRM114-Status: GOOD ( 10.44 ) 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-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add the MPLL common register initial setting Signed-off-by: Jerome Brunet --- drivers/clk/meson/g12a.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c index 6a01f8fd8114..493db74270ac 100644 --- a/drivers/clk/meson/g12a.c +++ b/drivers/clk/meson/g12a.c @@ -2361,10 +2361,16 @@ static struct clk_regmap *const g12a_clk_regmaps[] = { &g12a_mpll_50m, }; +static const struct reg_sequence g12a_init_regs[] = { + { .reg = HHI_MPLL_CNTL0, .def = 0x00000543 }, +}; + static const struct meson_eeclkc_data g12a_clkc_data = { .regmap_clks = g12a_clk_regmaps, .regmap_clk_num = ARRAY_SIZE(g12a_clk_regmaps), - .hw_onecell_data = &g12a_hw_onecell_data + .hw_onecell_data = &g12a_hw_onecell_data, + .init_regs = g12a_init_regs, + .init_count = ARRAY_SIZE(g12a_init_regs), }; static const struct of_device_id clkc_match_table[] = {