Skip to contentSkip to conversation

clk: add clock driver for MediaTek MT7620 SoC

PATCH New Weijie Gao 1 participant 1 message Oct 16, 2020

Subsystems (3)
lore
Share & tools
lore

Weijie Gao

author
#0 lore raw

PATCH 9/18 clk: add clock driver for MediaTek MT7620 SoC

This patch adds a clock driver for MediaTek MT7620 SoC.
This driver provides clock gate control as well as getting clock frequency for CPU/SYS/XTAL and some peripherals.

---
 drivers/clk/mtmips/Makefile            |   1 +
 drivers/clk/mtmips/clk-mt7620.c        | 154 +++++++++++++++++++++++++
 include/dt-bindings/clock/mt7620-clk.h |  40 +++++++
 3 files changed, 195 insertions(+)
 create mode 100644 drivers/clk/mtmips/clk-mt7620.c
 create mode 100644 include/dt-bindings/clock/mt7620-clk.h
drivers/clk/mtmips/Makefile +1 -0
index e1938418da..732e7f2545 100644
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
 
+obj-$(CONFIG_SOC_MT7620) += clk-mt7620.o
 obj-$(CONFIG_SOC_MT7628) += clk-mt7628.o
drivers/clk/mtmips/clk-mt7620.c new file +154 -0

154 lines not on this page · raw message

include/dt-bindings/clock/mt7620-clk.h new file +40 -0
new file mode 100644
index 0000000000..3bb91ebdf1
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 MediaTek Inc.
+ *
+ * Author:  Weijie Gao <[email protected]>
+ */
+
+#ifndef _DT_BINDINGS_MT7620_CLK_H_
+#define _DT_BINDINGS_MT7620_CLK_H_
+
+/* Base clocks */
+#define CLK_SYS				34
+#define CLK_CPU				33
+#define CLK_XTAL			32
+
+/* Peripheral clocks */
+#define CLK_SDHC			30
+#define CLK_MIPS_CNT			28
+#define CLK_PCIE			26
+#define CLK_UPHY_12M			25
+#define CLK_EPHY			24
+#define CLK_ESW				23
+#define CLK_UPHY_48M			22
+#define CLK_FE				21
+#define CLK_UARTL			19
+#define CLK_SPI				18
+#define CLK_I2S				17
+#define CLK_I2C				16
+#define CLK_NAND			15
+#define CLK_GDMA			14
+#define CLK_PIO				13
+#define CLK_UARTF			12
+#define CLK_PCM				11
+#define CLK_MC				10
+#define CLK_INTC			9
+#define CLK_TIMER			8
+#define CLK_GE2				7
+#define CLK_GE1				6
+
+#endif /* _DT_BINDINGS_MT7620_CLK_H_ */
Signature · 1 line
2.17.1