From: Artem Novak <artem122novak@gmail.com>
To: glaubitz@physik.fu-berlin.de, dalias@libc.org
Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org,
Artem Novak <artem122novak@gmail.com>
Subject: [PATCH] sh: sh7305: add TMU0 module clock gate
Date: Wed, 21 Oct 2026 23:10:21 -0600 [thread overview]
Message-ID: <20261022051021.322705-1-artem122novak@gmail.com> (raw)
Register the SH7305 TMU0 module-stop clock using MSTPCR0 bit 15.
Provide the fck clock lookup for the sh-tmu.0 platform device.
Signed-off-by: Artem Novak <artem122novak@gmail.com>
---
arch/sh/kernel/cpu/clock-cpg.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c
index 5b75a384cbf3..5a1f1479416b 100644
--- a/arch/sh/kernel/cpu/clock-cpg.c
+++ b/arch/sh/kernel/cpu/clock-cpg.c
@@ -16,6 +16,20 @@ static struct clk peripheral_clk = {
.flags = CLK_ENABLE_ON_INIT,
};
+#ifdef CONFIG_CPU_SUBTYPE_SH7305
+/*
+ * SH7305 TMU0 module clock.
+ *
+ * MSTPCR0 bit 15 gates the peripheral clock to TMU0.
+ * Early platform initialization enables the gate before timer setup.
+ */
+static struct clk sh7305_tmu0_clk =
+ SH_CLK_MSTP32(&peripheral_clk, 0xa4150030, 15, 0);
+
+static struct clk_lookup sh7305_tmu0_lookup =
+ CLKDEV_ICK_ID("fck", "sh-tmu.0", &sh7305_tmu0_clk);
+#endif
+
static struct clk bus_clk = {
.parent = &master_clk,
.flags = CLK_ENABLE_ON_INIT,
@@ -58,7 +72,15 @@ int __init __deprecated cpg_clk_init(void)
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
clk_add_alias("fck", "sh-tmu-sh3.0", "peripheral_clk", NULL);
+#ifdef CONFIG_CPU_SUBTYPE_SH7305
+ if (!ret) {
+ ret = sh_clk_mstp_register(&sh7305_tmu0_clk, 1);
+ if (!ret)
+ clkdev_add(&sh7305_tmu0_lookup);
+ }
+#else
clk_add_alias("fck", "sh-tmu.0", "peripheral_clk", NULL);
+#endif
clk_add_alias("fck", "sh-tmu.1", "peripheral_clk", NULL);
clk_add_alias("fck", "sh-tmu.2", "peripheral_clk", NULL);
clk_add_alias("fck", "sh-mtu2", "peripheral_clk", NULL);
--
2.56.0
next reply other threads:[~2026-10-22 5:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 5:10 Artem Novak [this message]
2026-10-30 10:56 ` Geert Uytterhoeven
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=20261022051021.322705-1-artem122novak@gmail.com \
--to=artem122novak@gmail.com \
--cc=dalias@libc.org \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
/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
all inboxes | Powered by JetHome®