Skip to content

Commit a08f0ac

Browse files
committed
Merge tag 'riscv-sophgo-clk-for-v6.16' of https://github.com/sophgo/linux into clk-sophgo
Pull RISC-V Sophgo clk driver updates from Chen Wang: - Replace compatible for Sophgo CV1800 series SoC - Add clock support for Sophgo SG2044 * tag 'riscv-sophgo-clk-for-v6.16' of https://github.com/sophgo/linux: clk: sophgo: Add clock controller support for SG2044 SoC clk: sophgo: Add PLL clock controller support for SG2044 SoC dt-bindings: clock: sophgo: add clock controller for SG2044 dt-bindings: soc: sophgo: Add SG2044 top syscon device clk: sophgo: Add support for newly added precise compatible dt-bindings: clock: sophgo: Use precise compatible for CV1800 series SoC
2 parents 0af2f6b + 41b0861 commit a08f0ac

File tree

10 files changed

+2803
-4
lines changed

10 files changed

+2803
-4
lines changed

Documentation/devicetree/bindings/clock/sophgo,cv1800-clk.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@ maintainers:
1111

1212
properties:
1313
compatible:
14-
enum:
15-
- sophgo,cv1800-clk
16-
- sophgo,cv1810-clk
17-
- sophgo,sg2000-clk
14+
oneOf:
15+
- enum:
16+
- sophgo,cv1800b-clk
17+
- sophgo,cv1812h-clk
18+
- sophgo,sg2000-clk
19+
- items:
20+
- const: sophgo,sg2002-clk
21+
- const: sophgo,sg2000-clk
22+
- const: sophgo,cv1800-clk
23+
deprecated: true
24+
- const: sophgo,cv1810-clk
25+
deprecated: true
1826

1927
reg:
2028
maxItems: 1
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/sophgo,sg2044-clk.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Sophgo SG2044 Clock Controller
8+
9+
maintainers:
10+
- Inochi Amaoto <inochiama@gmail.com>
11+
12+
description: |
13+
The Sophgo SG2044 clock controller requires an external oscillator
14+
as input clock.
15+
16+
All available clocks are defined as preprocessor macros in
17+
include/dt-bindings/clock/sophgo,sg2044-clk.h
18+
19+
properties:
20+
compatible:
21+
const: sophgo,sg2044-clk
22+
23+
reg:
24+
maxItems: 1
25+
26+
clocks:
27+
items:
28+
- description: fpll0
29+
- description: fpll1
30+
- description: fpll2
31+
- description: dpll0
32+
- description: dpll1
33+
- description: dpll2
34+
- description: dpll3
35+
- description: dpll4
36+
- description: dpll5
37+
- description: dpll6
38+
- description: dpll7
39+
- description: mpll0
40+
- description: mpll1
41+
- description: mpll2
42+
- description: mpll3
43+
- description: mpll4
44+
- description: mpll5
45+
46+
clock-names:
47+
items:
48+
- const: fpll0
49+
- const: fpll1
50+
- const: fpll2
51+
- const: dpll0
52+
- const: dpll1
53+
- const: dpll2
54+
- const: dpll3
55+
- const: dpll4
56+
- const: dpll5
57+
- const: dpll6
58+
- const: dpll7
59+
- const: mpll0
60+
- const: mpll1
61+
- const: mpll2
62+
- const: mpll3
63+
- const: mpll4
64+
- const: mpll5
65+
66+
'#clock-cells':
67+
const: 1
68+
69+
required:
70+
- compatible
71+
- reg
72+
- clocks
73+
- '#clock-cells'
74+
75+
additionalProperties: false
76+
77+
examples:
78+
- |
79+
#include <dt-bindings/clock/sophgo,sg2044-pll.h>
80+
81+
clock-controller@50002000 {
82+
compatible = "sophgo,sg2044-clk";
83+
reg = <0x50002000 0x1000>;
84+
#clock-cells = <1>;
85+
clocks = <&syscon CLK_FPLL0>, <&syscon CLK_FPLL1>,
86+
<&syscon CLK_FPLL2>, <&syscon CLK_DPLL0>,
87+
<&syscon CLK_DPLL1>, <&syscon CLK_DPLL2>,
88+
<&syscon CLK_DPLL3>, <&syscon CLK_DPLL4>,
89+
<&syscon CLK_DPLL5>, <&syscon CLK_DPLL6>,
90+
<&syscon CLK_DPLL7>, <&syscon CLK_MPLL0>,
91+
<&syscon CLK_MPLL1>, <&syscon CLK_MPLL2>,
92+
<&syscon CLK_MPLL3>, <&syscon CLK_MPLL4>,
93+
<&syscon CLK_MPLL5>;
94+
clock-names = "fpll0", "fpll1", "fpll2", "dpll0",
95+
"dpll1", "dpll2", "dpll3", "dpll4",
96+
"dpll5", "dpll6", "dpll7", "mpll0",
97+
"mpll1", "mpll2", "mpll3", "mpll4",
98+
"mpll5";
99+
};
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/soc/sophgo/sophgo,sg2044-top-syscon.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Sophgo SG2044 SoC TOP system controller
8+
9+
maintainers:
10+
- Inochi Amaoto <inochiama@gmail.com>
11+
12+
description:
13+
The Sophgo SG2044 TOP system controller is a hardware block grouping
14+
multiple small functions, such as clocks and some other internal
15+
function.
16+
17+
properties:
18+
compatible:
19+
items:
20+
- const: sophgo,sg2044-top-syscon
21+
- const: syscon
22+
23+
reg:
24+
maxItems: 1
25+
26+
clocks:
27+
maxItems: 1
28+
29+
'#clock-cells':
30+
const: 1
31+
description:
32+
See <dt-bindings/clock/sophgo,sg2044-pll.h> for valid clock.
33+
34+
required:
35+
- compatible
36+
- reg
37+
- clocks
38+
- '#clock-cells'
39+
40+
additionalProperties: false
41+
42+
examples:
43+
- |
44+
syscon@50000000 {
45+
compatible = "sophgo,sg2044-top-syscon", "syscon";
46+
reg = <0x50000000 0x1000>;
47+
#clock-cells = <1>;
48+
clocks = <&osc>;
49+
};

drivers/clk/sophgo/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,22 @@ config CLK_SOPHGO_SG2042_RPGATE
3737
This clock IP depends on SG2042 Clock Generator because it uses
3838
clock from Clock Generator IP as input.
3939
This driver provides Gate function for RP.
40+
41+
config CLK_SOPHGO_SG2044
42+
tristate "Sophgo SG2044 clock controller support"
43+
depends on ARCH_SOPHGO || COMPILE_TEST
44+
help
45+
This driver supports the clock controller on the Sophgo SG2044
46+
SoC. This controller requires mulitple PLL clock as input.
47+
This clock control provides PLL clocks and common clock function
48+
for various IPs on the SoC.
49+
50+
config CLK_SOPHGO_SG2044_PLL
51+
tristate "Sophgo SG2044 PLL clock controller support"
52+
depends on ARCH_SOPHGO || COMPILE_TEST
53+
select MFD_SYSCON
54+
select REGMAP_MMIO
55+
help
56+
This driver supports the PLL clock controller on the Sophgo
57+
SG2044 SoC. This controller requires 25M oscillator as input.
58+
This clock control provides PLL clocks on the SoC.

drivers/clk/sophgo/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ clk-sophgo-cv1800-y += clk-cv18xx-pll.o
99
obj-$(CONFIG_CLK_SOPHGO_SG2042_CLKGEN) += clk-sg2042-clkgen.o
1010
obj-$(CONFIG_CLK_SOPHGO_SG2042_PLL) += clk-sg2042-pll.o
1111
obj-$(CONFIG_CLK_SOPHGO_SG2042_RPGATE) += clk-sg2042-rpgate.o
12+
obj-$(CONFIG_CLK_SOPHGO_SG2044) += clk-sg2044.o
13+
obj-$(CONFIG_CLK_SOPHGO_SG2044_PLL) += clk-sg2044-pll.o

drivers/clk/sophgo/clk-cv1800.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,9 @@ static int cv1800_clk_probe(struct platform_device *pdev)
15191519

15201520
static const struct of_device_id cv1800_clk_ids[] = {
15211521
{ .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc },
1522+
{ .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },
15221523
{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc },
1524+
{ .compatible = "sophgo,cv1812h-clk", .data = &cv1810_desc },
15231525
{ .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc },
15241526
{ }
15251527
};

0 commit comments

Comments
 (0)