Skip to contentSkip to conversation

sh: sh7305: add TMU0 clock support

PATCH New Artem Novak 1 participant 3 messages Nov 11 SuperH

lore
Share & tools
lore
#0 lore raw

v4 cover sh: sh7305: add TMU0 clock support

This series adds Common Clock Framework support for the SH7305.

The existing SH7305 clock implementation is converted to CCF, including the master clock, CPU, bus and peripheral divider clocks, and the TMU0 module clock gate.
The legacy CPG clock framework is then excluded for SH7305 to avoid enabling both clock implementations.

The series consists of:

sh: sh7305: add TMU0 clock support
Convert the SH7305 clock implementation to CCF and provide the TMU0 functional clock through clkdev.

sh: sh7305: exclude from legacy CPG clock framework Exclude SH7305 from SH_CLK_CPG_LEGACY.

Changes since v3:
- Split the legacy CPG exclusion into a separate second patch.
- Keep the SH7305 CCF clock implementation and TMU0 gate together in the first patch.

Artem Novak (2):
sh: sh7305: add TMU0 clock support
sh: sh7305: exclude from legacy CPG clock framework

 arch/sh/Kconfig                        |   2 +-
 arch/sh/include/asm/clock-sh7305.h     |  11 ++
 arch/sh/kernel/cpu/sh4a/clock-sh7305.c | 262 +++++++++++++++++--------
 3 files changed, 196 insertions(+), 79 deletions(-)
 create mode 100644 arch/sh/include/asm/clock-sh7305.h
Signature · 1 line
2.56.0
#1 lore raw

PATCH v4 1/2 sh: sh7305: add TMU0 clock support

Convert the SH7305 clock implementation to the Common Clock Framework.

Register the master clock and the CPU, bus and peripheral divider clocks, and add the TMU0 module clock gate.

Provide a clkdev mapping for the TMU0 functional clock so the TMU driver can acquire it through its existing clock lookup.

---
 arch/sh/include/asm/clock-sh7305.h     |  11 ++
 arch/sh/kernel/cpu/sh4a/clock-sh7305.c | 262 +++++++++++++++++--------
 2 files changed, 195 insertions(+), 78 deletions(-)
 create mode 100644 arch/sh/include/asm/clock-sh7305.h
arch/sh/include/asm/clock-sh7305.h new file +11 -0
new file mode 100644
index 000000000000..2ef73845eacc
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __ASM_SH_CLOCK_SH7305_H
+#define __ASM_SH_CLOCK_SH7305_H
+
+#include <linux/init.h>
+
+int __init sh7305_clk_init(void);
+
+void __init sh7305_of_setup(char **cmdline_p);
+
+#endif /* __ASM_SH_CLOCK_SH7305_H */
arch/sh/kernel/cpu/sh4a/clock-sh7305.c +184 -78

334 lines not on this page · raw message

Signature · 1 line
2.56.0
#2 lore raw

PATCH v4 2/2 sh: sh7305: exclude from legacy CPG clock framework

In reply to Artem Novak

SH7305 now uses its own Common Clock Framework clock implementation.

Exclude SH7305 from SH_CLK_CPG_LEGACY to prevent the legacy CPG clock framework from being enabled for this CPU subtype.

---
 arch/sh/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/Kconfig +1 -1
index 5ce7df11c3ec..c5cc486eb1a3 100644
@@ -536,7 +536,7 @@ config SH_CLK_CPG_LEGACY
 	def_bool y if !CPU_SUBTYPE_SH7785 && !ARCH_SHMOBILE && \
 		      !CPU_SHX3 && !CPU_SUBTYPE_SH7757 && \
 		      !CPU_SUBTYPE_SH7734 && !CPU_SUBTYPE_SH7264 && \
-		      !CPU_SUBTYPE_SH7269
+		      !CPU_SUBTYPE_SH7269 && !CPU_SUBTYPE_SH7305
 
 endmenu
 
Signature · 1 line
2.56.0