Skip to content

Commit b7d950b

Browse files
fancerbebarino
authored andcommitted
clk: Add Baikal-T1 CCU PLLs driver
Baikal-T1 is supposed to be supplied with a high-frequency external oscillator. But in order to create signals suitable for each IP-block embedded into the SoC the oscillator output is primarily connected to a set of CCU PLLs. There are five of them to create clocks for the MIPS P5600 cores, an embedded DDR controller, SATA, Ethernet and PCIe domains. The last three domains though named by the biggest system interfaces in fact include nearly all of the rest SoC peripherals. Each of the PLLs is based on True Circuits TSMC CLN28HPM IP-core with an interface wrapper (so called safe PLL' clocks switcher) to simplify the PLL configuration procedure. This driver creates the of-based hardware clocks to use them then in the corresponding subsystems. In order to simplify the driver code we split the functionality up into the PLLs clocks operations and hardware clocks declaration/registration procedures. Even though the PLLs are based on the same IP-core, they may have some differences. In particular, some CCU PLLs support the output clock change without gating them (like CPU or PCIe PLLs), while the others don't, some CCU PLLs are critical and aren't supposed to be gated. In order to cover all of these cases the hardware clocks driver is designed with an info-descriptor pattern. So there are special static descriptors declared for each PLL, which is then used to create a hardware clock with proper operations. Additionally debugfs-files are provided for each PLL' field to make sure the implemented rate-PLLs-dividers calculation algorithm is correct. Signed-off-by: Serge Semin <[email protected]> Cc: Alexey Malahov <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Rob Herring <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] [[email protected]: Silence sparse warning about initializing structs with NULL vs. integer] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 11ea09b commit b7d950b

File tree

7 files changed

+860
-0
lines changed

7 files changed

+860
-0
lines changed

drivers/clk/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ config COMMON_CLK_FIXED_MMIO
341341

342342
source "drivers/clk/actions/Kconfig"
343343
source "drivers/clk/analogbits/Kconfig"
344+
source "drivers/clk/baikal-t1/Kconfig"
344345
source "drivers/clk/bcm/Kconfig"
345346
source "drivers/clk/hisilicon/Kconfig"
346347
source "drivers/clk/imgtec/Kconfig"

drivers/clk/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ obj-y += analogbits/
7575
obj-$(CONFIG_COMMON_CLK_AT91) += at91/
7676
obj-$(CONFIG_ARCH_ARTPEC) += axis/
7777
obj-$(CONFIG_ARC_PLAT_AXS10X) += axs10x/
78+
obj-$(CONFIG_CLK_BAIKAL_T1) += baikal-t1/
7879
obj-y += bcm/
7980
obj-$(CONFIG_ARCH_BERLIN) += berlin/
8081
obj-$(CONFIG_ARCH_DAVINCI) += davinci/

drivers/clk/baikal-t1/Kconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
config CLK_BAIKAL_T1
3+
bool "Baikal-T1 Clocks Control Unit interface"
4+
depends on (MIPS_BAIKAL_T1 && OF) || COMPILE_TEST
5+
default MIPS_BAIKAL_T1
6+
help
7+
Clocks Control Unit is the core of Baikal-T1 SoC System Controller
8+
responsible for the chip subsystems clocking and resetting. It
9+
consists of multiple global clock domains, which can be reset by
10+
means of the CCU control registers. These domains and devices placed
11+
in them are fed with clocks generated by a hierarchy of PLLs,
12+
configurable and fixed clock dividers. Enable this option to be able
13+
to select Baikal-T1 CCU PLLs and Dividers drivers.
14+
15+
if CLK_BAIKAL_T1
16+
17+
config CLK_BT1_CCU_PLL
18+
bool "Baikal-T1 CCU PLLs support"
19+
select MFD_SYSCON
20+
default MIPS_BAIKAL_T1
21+
help
22+
Enable this to support the PLLs embedded into the Baikal-T1 SoC
23+
System Controller. These are five PLLs placed at the root of the
24+
clocks hierarchy, right after an external reference oscillator
25+
(normally of 25MHz). They are used to generate high frequency
26+
signals, which are either directly wired to the consumers (like
27+
CPUs, DDR, etc.) or passed over the clock dividers to be only
28+
then used as an individual reference clock of a target device.
29+
30+
endif

drivers/clk/baikal-t1/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-only
2+
obj-$(CONFIG_CLK_BT1_CCU_PLL) += ccu-pll.o clk-ccu-pll.o

0 commit comments

Comments
 (0)