Skip to content

Commit 48df7a2

Browse files
parakabebarino
authored andcommitted
clk: ralink: add clock driver for mt7621 SoC
The documentation for this SOC only talks about two registers regarding to the clocks: * SYSC_REG_CPLL_CLKCFG0 - provides some information about boostrapped refclock. PLL and dividers used for CPU and some sort of BUS. * SYSC_REG_CPLL_CLKCFG1 - a banch of gates to enable/disable clocks for all or some ip cores. Looking into driver code, and some openWRT patched there are another frequencies which are used in some drivers (uart, sd...). According to all of this information the clock plan for this SoC is set as follows: - Main top clock "xtal" from where all the rest of the world is derived. - CPU clock "cpu" derived from "xtal" frequencies and a bunch of register reads and predividers. - BUS clock "bus" derived from "cpu" and with (cpu / 4) MHz. - Fixed clocks from "xtal": * "50m": 50 MHz. * "125m": 125 MHz. * "150m": 150 MHz. * "250m": 250 MHz. * "270m": 270 MHz. We also have a buch of gate clocks with their parents: * "hsdma": "150m" * "fe": "250m" * "sp_divtx": "270m" * "timer": "50m" * "pcm": "270m" * "pio": "50m" * "gdma": "bus" * "nand": "125m" * "i2c": "50m" * "i2s": "270m" * "spi": "bus" * "uart1": "50m" * "uart2": "50m" * "uart3": "50m" * "eth": "50m" * "pcie0": "125m" * "pcie1": "125m" * "pcie2": "125m" * "crypto": "250m" * "shxc": "50m" With this information the clk driver will provide clock and gates functionality from a a set of hardcoded clocks allowing to define a nice device tree without fixed clocks. Signed-off-by: Sergio Paracuellos <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 704f6af commit 48df7a2

File tree

5 files changed

+510
-0
lines changed

5 files changed

+510
-0
lines changed

drivers/clk/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ source "drivers/clk/meson/Kconfig"
390390
source "drivers/clk/mstar/Kconfig"
391391
source "drivers/clk/mvebu/Kconfig"
392392
source "drivers/clk/qcom/Kconfig"
393+
source "drivers/clk/ralink/Kconfig"
393394
source "drivers/clk/renesas/Kconfig"
394395
source "drivers/clk/rockchip/Kconfig"
395396
source "drivers/clk/samsung/Kconfig"

drivers/clk/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ obj-$(CONFIG_COMMON_CLK_NXP) += nxp/
100100
obj-$(CONFIG_MACH_PISTACHIO) += pistachio/
101101
obj-$(CONFIG_COMMON_CLK_PXA) += pxa/
102102
obj-$(CONFIG_COMMON_CLK_QCOM) += qcom/
103+
obj-y += ralink/
103104
obj-y += renesas/
104105
obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
105106
obj-$(CONFIG_COMMON_CLK_SAMSUNG) += samsung/

drivers/clk/ralink/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
#
3+
# MediaTek Mt7621 Clock Driver
4+
#
5+
config CLK_MT7621
6+
bool "Clock driver for MediaTek MT7621"
7+
depends on SOC_MT7621 || COMPILE_TEST
8+
default SOC_MT7621
9+
select MFD_SYSCON
10+
help
11+
This driver supports MediaTek MT7621 basic clocks.

drivers/clk/ralink/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
obj-$(CONFIG_CLK_MT7621) += clk-mt7621.o

0 commit comments

Comments
 (0)