clk: thead: Port clock controller driver of TH1520 SoC

The driver is adapted from Linux kernel's version of clk-th1520-ap.c,
with only output clocks for external sensors, which are barely useful in
bootloaders, removed.

Same as the mainline driver, it currently lacks of ability to enable and
reconfigure PLLs, which could be implemented later.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
This commit is contained in:
Yao Zi 2025-05-16 03:05:23 +00:00 committed by Leo Yu-Chi Liang
parent ce8f49ece2
commit e6bfa6fc94
5 changed files with 1057 additions and 0 deletions

View File

@ -271,6 +271,7 @@ source "drivers/clk/starfive/Kconfig"
source "drivers/clk/stm32/Kconfig"
source "drivers/clk/tegra/Kconfig"
source "drivers/clk/ti/Kconfig"
source "drivers/clk/thead/Kconfig"
source "drivers/clk/uniphier/Kconfig"
endmenu

View File

@ -20,6 +20,7 @@ obj-y += imx/
obj-$(CONFIG_CLK_JH7110) += starfive/
obj-y += tegra/
obj-y += ti/
obj-$(CONFIG_CLK_THEAD) += thead/
obj-$(CONFIG_$(PHASE_)CLK_INTEL) += intel/
obj-$(CONFIG_ARCH_ASPEED) += aspeed/
obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/

19
drivers/clk/thead/Kconfig Normal file
View File

@ -0,0 +1,19 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (c) 2025, Yao Zi <ziyao@disroot.org>
config CLK_THEAD
bool "Clock support for T-Head SoCs"
depends on CLK
if CLK_THEAD
config CLK_THEAD_TH1520_AP
bool "T-Head TH1520 AP clock support"
select CLK_CCF
default THEAD_TH1520
help
This enables support clock driver for T-Head TH1520 Application
processor.
endif

View File

@ -0,0 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2025 Yao Zi <ziyao@disroot.org>
obj-$(CONFIG_CLK_THEAD_TH1520_AP) += clk-th1520-ap.o

File diff suppressed because it is too large Load Diff