Skip to content

Commit f37f6ba

Browse files
committed
Merge tag 'spacemit-clk-for-6.16-1' of https://github.com/spacemit-com/linux into clk-spacemit
Pull SpacemiT clk driver updates from Yixun Lan: - Add clock driver for SpacemiT K1 SoC - Add TWSI8 clock, workaround the read quirk * tag 'spacemit-clk-for-6.16-1' of https://github.com/spacemit-com/linux: clk: spacemit: k1: Add TWSI8 bus and function clocks clk: spacemit: Add clock support for SpacemiT K1 SoC dt-bindings: clock: spacemit: Add spacemit,k1-pll dt-bindings: soc: spacemit: Add spacemit,k1-syscon
2 parents 0af2f6b + 49625c6 commit f37f6ba

File tree

15 files changed

+2474
-0
lines changed

15 files changed

+2474
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/spacemit,k1-pll.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: SpacemiT K1 PLL
8+
9+
maintainers:
10+
- Haylen Chu <heylenay@4d2.org>
11+
12+
properties:
13+
compatible:
14+
const: spacemit,k1-pll
15+
16+
reg:
17+
maxItems: 1
18+
19+
clocks:
20+
description: External 24MHz oscillator
21+
22+
spacemit,mpmu:
23+
$ref: /schemas/types.yaml#/definitions/phandle
24+
description:
25+
Phandle to the "Main PMU (MPMU)" syscon. It is used to check PLL
26+
lock status.
27+
28+
"#clock-cells":
29+
const: 1
30+
description:
31+
See <dt-bindings/clock/spacemit,k1-syscon.h> for valid indices.
32+
33+
required:
34+
- compatible
35+
- reg
36+
- clocks
37+
- spacemit,mpmu
38+
- "#clock-cells"
39+
40+
additionalProperties: false
41+
42+
examples:
43+
- |
44+
clock-controller@d4090000 {
45+
compatible = "spacemit,k1-pll";
46+
reg = <0xd4090000 0x1000>;
47+
clocks = <&vctcxo_24m>;
48+
spacemit,mpmu = <&sysctl_mpmu>;
49+
#clock-cells = <1>;
50+
};
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/soc/spacemit/spacemit,k1-syscon.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: SpacemiT K1 SoC System Controller
8+
9+
maintainers:
10+
- Haylen Chu <heylenay@4d2.org>
11+
12+
description:
13+
System controllers found on SpacemiT K1 SoC, which are capable of
14+
clock, reset and power-management functions.
15+
16+
properties:
17+
compatible:
18+
enum:
19+
- spacemit,k1-syscon-apbc
20+
- spacemit,k1-syscon-apmu
21+
- spacemit,k1-syscon-mpmu
22+
23+
reg:
24+
maxItems: 1
25+
26+
clocks:
27+
maxItems: 4
28+
29+
clock-names:
30+
items:
31+
- const: osc
32+
- const: vctcxo_1m
33+
- const: vctcxo_3m
34+
- const: vctcxo_24m
35+
36+
"#clock-cells":
37+
const: 1
38+
description:
39+
See <dt-bindings/clock/spacemit,k1-syscon.h> for valid indices.
40+
41+
"#power-domain-cells":
42+
const: 1
43+
44+
"#reset-cells":
45+
const: 1
46+
47+
required:
48+
- compatible
49+
- reg
50+
- clocks
51+
- clock-names
52+
- "#clock-cells"
53+
- "#reset-cells"
54+
55+
allOf:
56+
- if:
57+
properties:
58+
compatible:
59+
contains:
60+
const: spacemit,k1-syscon-apbc
61+
then:
62+
properties:
63+
"#power-domain-cells": false
64+
else:
65+
required:
66+
- "#power-domain-cells"
67+
68+
additionalProperties: false
69+
70+
examples:
71+
- |
72+
system-controller@d4050000 {
73+
compatible = "spacemit,k1-syscon-mpmu";
74+
reg = <0xd4050000 0x209c>;
75+
clocks = <&osc>, <&vctcxo_1m>, <&vctcxo_3m>, <&vctcxo_24m>;
76+
clock-names = "osc", "vctcxo_1m", "vctcxo_3m", "vctcxo_24m";
77+
#clock-cells = <1>;
78+
#power-domain-cells = <1>;
79+
#reset-cells = <1>;
80+
};

drivers/clk/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ source "drivers/clk/samsung/Kconfig"
517517
source "drivers/clk/sifive/Kconfig"
518518
source "drivers/clk/socfpga/Kconfig"
519519
source "drivers/clk/sophgo/Kconfig"
520+
source "drivers/clk/spacemit/Kconfig"
520521
source "drivers/clk/sprd/Kconfig"
521522
source "drivers/clk/starfive/Kconfig"
522523
source "drivers/clk/sunxi/Kconfig"

drivers/clk/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ obj-$(CONFIG_COMMON_CLK_SAMSUNG) += samsung/
145145
obj-$(CONFIG_CLK_SIFIVE) += sifive/
146146
obj-y += socfpga/
147147
obj-y += sophgo/
148+
obj-y += spacemit/
148149
obj-$(CONFIG_PLAT_SPEAR) += spear/
149150
obj-y += sprd/
150151
obj-$(CONFIG_ARCH_STI) += st/

drivers/clk/spacemit/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
3+
config SPACEMIT_CCU
4+
tristate "Clock support for SpacemiT SoCs"
5+
depends on ARCH_SPACEMIT || COMPILE_TEST
6+
select MFD_SYSCON
7+
help
8+
Say Y to enable clock controller unit support for SpacemiT SoCs.
9+
10+
if SPACEMIT_CCU
11+
12+
config SPACEMIT_K1_CCU
13+
tristate "Support for SpacemiT K1 SoC"
14+
depends on ARCH_SPACEMIT || COMPILE_TEST
15+
help
16+
Support for clock controller unit in SpacemiT K1 SoC.
17+
18+
endif

drivers/clk/spacemit/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
obj-$(CONFIG_SPACEMIT_K1_CCU) = spacemit-ccu-k1.o
4+
spacemit-ccu-k1-y = ccu_pll.o ccu_mix.o ccu_ddn.o
5+
spacemit-ccu-k1-y += ccu-k1.o

0 commit comments

Comments
 (0)