From: "周琰杰 (Zhou Yanjie)" <zhouyanjie@wanyeetech.com>
To: sboyd@kernel.org, robh+dt@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, mturquette@baylibre.com,
dongsheng.qiu@ingenic.com, aric.pzqi@ingenic.com,
rick.tyliu@ingenic.com, yanfei.li@ingenic.com,
sihui.liu@ingenic.com, sernia.zhou@foxmail.com,
paul@crapouillou.net
Subject: [PATCH v4 3/5] clk: Ingenic: Fix problem of MAC clock in Ingenic X1000 and X1830.
Date: Mon, 21 Dec 2020 23:52:49 +0800 [thread overview]
Message-ID: <1608565971-23895-4-git-send-email-zhouyanjie@wanyeetech.com> (raw)
In-Reply-To: <1608565971-23895-1-git-send-email-zhouyanjie@wanyeetech.com>
X1000 and X1830 have two MAC related clocks, one is MACPHY, which is
controlled by MACCDR register, the other is MAC, which is controlled
by the MAC bit in the CLKGR register (with CLK_AHB2 as the parent).
The original driver mistakenly mixed the two clocks together.
Signed-off-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
---
Notes:
v2:
New patch.
v2->v3:
No change.
v3->v4:
No change.
drivers/clk/ingenic/x1000-cgu.c | 11 ++++++++---
drivers/clk/ingenic/x1830-cgu.c | 11 ++++++++---
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/ingenic/x1000-cgu.c b/drivers/clk/ingenic/x1000-cgu.c
index 9aa20b5..53e5fe0 100644
--- a/drivers/clk/ingenic/x1000-cgu.c
+++ b/drivers/clk/ingenic/x1000-cgu.c
@@ -296,12 +296,11 @@ static const struct ingenic_cgu_clk_info x1000_cgu_clocks[] = {
.gate = { CGU_REG_CLKGR, 31 },
},
- [X1000_CLK_MAC] = {
- "mac", CGU_CLK_MUX | CGU_CLK_DIV | CGU_CLK_GATE,
+ [X1000_CLK_MACPHY] = {
+ "mac_phy", CGU_CLK_MUX | CGU_CLK_DIV,
.parents = { X1000_CLK_SCLKA, X1000_CLK_MPLL },
.mux = { CGU_REG_MACCDR, 31, 1 },
.div = { CGU_REG_MACCDR, 0, 1, 8, 29, 28, 27 },
- .gate = { CGU_REG_CLKGR, 25 },
},
[X1000_CLK_LCD] = {
@@ -452,6 +451,12 @@ static const struct ingenic_cgu_clk_info x1000_cgu_clocks[] = {
.parents = { X1000_CLK_EXCLK, -1, -1, -1 },
.gate = { CGU_REG_CLKGR, 21 },
},
+
+ [X1000_CLK_MAC] = {
+ "mac", CGU_CLK_GATE,
+ .parents = { X1000_CLK_AHB2 },
+ .gate = { CGU_REG_CLKGR, 25 },
+ },
};
static void __init x1000_cgu_init(struct device_node *np)
diff --git a/drivers/clk/ingenic/x1830-cgu.c b/drivers/clk/ingenic/x1830-cgu.c
index 950aee2..59342bc 100644
--- a/drivers/clk/ingenic/x1830-cgu.c
+++ b/drivers/clk/ingenic/x1830-cgu.c
@@ -270,13 +270,12 @@ static const struct ingenic_cgu_clk_info x1830_cgu_clocks[] = {
.gate = { CGU_REG_CLKGR0, 31 },
},
- [X1830_CLK_MAC] = {
- "mac", CGU_CLK_MUX | CGU_CLK_DIV | CGU_CLK_GATE,
+ [X1830_CLK_MACPHY] = {
+ "mac_phy", CGU_CLK_MUX | CGU_CLK_DIV,
.parents = { X1830_CLK_SCLKA, X1830_CLK_MPLL,
X1830_CLK_VPLL, X1830_CLK_EPLL },
.mux = { CGU_REG_MACCDR, 30, 2 },
.div = { CGU_REG_MACCDR, 0, 1, 8, 29, 28, 27 },
- .gate = { CGU_REG_CLKGR1, 4 },
},
[X1830_CLK_LCD] = {
@@ -428,6 +427,12 @@ static const struct ingenic_cgu_clk_info x1830_cgu_clocks[] = {
.gate = { CGU_REG_CLKGR1, 1 },
},
+ [X1830_CLK_MAC] = {
+ "mac", CGU_CLK_GATE,
+ .parents = { X1830_CLK_AHB2 },
+ .gate = { CGU_REG_CLKGR1, 4 },
+ },
+
[X1830_CLK_OST] = {
"ost", CGU_CLK_GATE,
.parents = { X1830_CLK_EXCLK, -1, -1, -1 },
--
2.7.4
next prev parent reply other threads:[~2020-12-21 15:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-21 15:52 [PATCH v4 0/5] Add new clocks and fix bugs for Ingenic SoCs 周琰杰 (Zhou Yanjie)
2020-12-21 15:52 ` [PATCH v4 1/5] clk: JZ4780: Add function for disable the second core 周琰杰 (Zhou Yanjie)
2020-12-21 15:52 ` [PATCH v4 2/5] dt-bindings: clock: Add missing clocks for Ingenic SoCs 周琰杰 (Zhou Yanjie)
2020-12-21 15:52 ` 周琰杰 (Zhou Yanjie) [this message]
2020-12-21 15:52 ` [PATCH v4 4/5] clk: Ingenic: " 周琰杰 (Zhou Yanjie)
2020-12-23 12:29 ` Paul Cercueil
2020-12-23 14:03 ` Zhou Yanjie
2020-12-21 15:52 ` [PATCH v4 5/5] clk: Ingenic: Clean up and reformat the code 周琰杰 (Zhou Yanjie)
2020-12-23 12:39 ` Paul Cercueil
2020-12-23 14:12 ` Zhou Yanjie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1608565971-23895-4-git-send-email-zhouyanjie@wanyeetech.com \
--to=zhouyanjie@wanyeetech.com \
--cc=aric.pzqi@ingenic.com \
--cc=devicetree@vger.kernel.org \
--cc=dongsheng.qiu@ingenic.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=paul@crapouillou.net \
--cc=rick.tyliu@ingenic.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=sernia.zhou@foxmail.com \
--cc=sihui.liu@ingenic.com \
--cc=yanfei.li@ingenic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).