Skip to content

Commit 54cb3bb

Browse files
committed
Merge tag 'riscv-sg2042-clk-for-v6.11' of https://github.com/sophgo/linux into clk-sophgo
Pull RISC-V SG2042 clock driver changes from Chen Wang: - Add sg2042 clk driver * tag 'riscv-sg2042-clk-for-v6.11' of https://github.com/sophgo/linux: clk: sophgo: Add SG2042 clock driver dt-bindings: clock: sophgo: add clkgen for SG2042 dt-bindings: clock: sophgo: add RP gate clocks for SG2042 dt-bindings: clock: sophgo: add pll clocks for SG2042
2 parents 1613e60 + 48cf7e0 commit 54cb3bb

File tree

12 files changed

+2409
-0
lines changed

12 files changed

+2409
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/sophgo,sg2042-clkgen.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Sophgo SG2042 Clock Generator for divider/mux/gate
8+
9+
maintainers:
10+
- Chen Wang <[email protected]>
11+
12+
properties:
13+
compatible:
14+
const: sophgo,sg2042-clkgen
15+
16+
reg:
17+
maxItems: 1
18+
19+
clocks:
20+
items:
21+
- description: Main PLL
22+
- description: Fixed PLL
23+
- description: DDR PLL 0
24+
- description: DDR PLL 1
25+
26+
clock-names:
27+
items:
28+
- const: mpll
29+
- const: fpll
30+
- const: dpll0
31+
- const: dpll1
32+
33+
'#clock-cells':
34+
const: 1
35+
description:
36+
See <dt-bindings/clock/sophgo,sg2042-clkgen.h> for valid indices.
37+
38+
required:
39+
- compatible
40+
- reg
41+
- clocks
42+
- clock-names
43+
- '#clock-cells'
44+
45+
additionalProperties: false
46+
47+
examples:
48+
- |
49+
clock-controller@30012000 {
50+
compatible = "sophgo,sg2042-clkgen";
51+
reg = <0x30012000 0x1000>;
52+
clocks = <&pllclk 0>,
53+
<&pllclk 1>,
54+
<&pllclk 2>,
55+
<&pllclk 3>;
56+
clock-names = "mpll",
57+
"fpll",
58+
"dpll0",
59+
"dpll1";
60+
#clock-cells = <1>;
61+
};
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/sophgo,sg2042-pll.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Sophgo SG2042 PLL Clock Generator
8+
9+
maintainers:
10+
- Chen Wang <[email protected]>
11+
12+
properties:
13+
compatible:
14+
const: sophgo,sg2042-pll
15+
16+
reg:
17+
maxItems: 1
18+
19+
clocks:
20+
items:
21+
- description: Oscillator(Clock Generation IC) for Main/Fixed PLL (25 MHz)
22+
- description: Oscillator(Clock Generation IC) for DDR PLL 0 (25 MHz)
23+
- description: Oscillator(Clock Generation IC) for DDR PLL 1 (25 MHz)
24+
25+
clock-names:
26+
items:
27+
- const: cgi_main
28+
- const: cgi_dpll0
29+
- const: cgi_dpll1
30+
31+
'#clock-cells':
32+
const: 1
33+
description:
34+
See <dt-bindings/clock/sophgo,sg2042-pll.h> for valid indices.
35+
36+
required:
37+
- compatible
38+
- reg
39+
- clocks
40+
- clock-names
41+
- '#clock-cells'
42+
43+
additionalProperties: false
44+
45+
examples:
46+
- |
47+
clock-controller@10000000 {
48+
compatible = "sophgo,sg2042-pll";
49+
reg = <0x10000000 0x10000>;
50+
clocks = <&cgi_main>, <&cgi_dpll0>, <&cgi_dpll1>;
51+
clock-names = "cgi_main", "cgi_dpll0", "cgi_dpll1";
52+
#clock-cells = <1>;
53+
};
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/clock/sophgo,sg2042-rpgate.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Sophgo SG2042 Gate Clock Generator for RP(riscv processors) subsystem
8+
9+
maintainers:
10+
- Chen Wang <[email protected]>
11+
12+
properties:
13+
compatible:
14+
const: sophgo,sg2042-rpgate
15+
16+
reg:
17+
maxItems: 1
18+
19+
clocks:
20+
items:
21+
- description: Gate clock for RP subsystem
22+
23+
clock-names:
24+
items:
25+
- const: rpgate
26+
27+
'#clock-cells':
28+
const: 1
29+
description:
30+
See <dt-bindings/clock/sophgo,sg2042-rpgate.h> for valid indices.
31+
32+
required:
33+
- compatible
34+
- reg
35+
- clocks
36+
- clock-names
37+
- '#clock-cells'
38+
39+
additionalProperties: false
40+
41+
examples:
42+
- |
43+
clock-controller@20000000 {
44+
compatible = "sophgo,sg2042-rpgate";
45+
reg = <0x20000000 0x10000>;
46+
clocks = <&clkgen 85>;
47+
clock-names = "rpgate";
48+
#clock-cells = <1>;
49+
};

drivers/clk/sophgo/Kconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,31 @@ config CLK_SOPHGO_CV1800
99
The driver require a 25MHz Oscillator to function generate clock.
1010
It includes PLLs, common clock function and some vendor clock for
1111
IPs of CV18XX series SoC
12+
13+
config CLK_SOPHGO_SG2042_PLL
14+
tristate "Sophgo SG2042 PLL clock support"
15+
depends on ARCH_SOPHGO || COMPILE_TEST
16+
help
17+
This driver supports the PLL clock controller on the
18+
Sophgo SG2042 SoC. This clock IP uses three oscillators with
19+
frequency of 25 MHz as input, which are used for Main/Fixed
20+
PLL, DDR PLL 0 and DDR PLL 1 respectively.
21+
22+
config CLK_SOPHGO_SG2042_CLKGEN
23+
tristate "Sophgo SG2042 Clock Generator support"
24+
depends on CLK_SOPHGO_SG2042_PLL
25+
help
26+
This driver supports the Clock Generator on the
27+
Sophgo SG2042 SoC. This clock IP depends on SG2042 PLL clock
28+
because it uses PLL clocks as input.
29+
This driver provides clock function such as DIV/Mux/Gate.
30+
31+
config CLK_SOPHGO_SG2042_RPGATE
32+
tristate "Sophgo SG2042 RP subsystem clock controller support"
33+
depends on CLK_SOPHGO_SG2042_CLKGEN
34+
help
35+
This driver supports the RP((Riscv Processors)) subsystem clock
36+
controller on the Sophgo SG2042 SoC.
37+
This clock IP depends on SG2042 Clock Generator because it uses
38+
clock from Clock Generator IP as input.
39+
This driver provides Gate function for RP.

drivers/clk/sophgo/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ clk-sophgo-cv1800-y += clk-cv1800.o
55
clk-sophgo-cv1800-y += clk-cv18xx-common.o
66
clk-sophgo-cv1800-y += clk-cv18xx-ip.o
77
clk-sophgo-cv1800-y += clk-cv18xx-pll.o
8+
9+
obj-$(CONFIG_CLK_SOPHGO_SG2042_CLKGEN) += clk-sg2042-clkgen.o
10+
obj-$(CONFIG_CLK_SOPHGO_SG2042_PLL) += clk-sg2042-pll.o
11+
obj-$(CONFIG_CLK_SOPHGO_SG2042_RPGATE) += clk-sg2042-rpgate.o

0 commit comments

Comments
 (0)