Skip to content

Commit 601e5d4

Browse files
committed
Merge tag 'riscv-jh7110-clk-reset-for-6.4' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into clk-starfive
Pull Starfive clk driver updates from Conor Dooley: - Initial JH7110 clk/reset support A rake of patches, initially worked on by Emil & later picked up by Hal that add support for the sys/aon clock & reset controllers on StarFive's JH7110 SoC. This SoC is largely similar to the existing JH7100, so a bunch of refactoring is done to share as many bits as possible between the two. What's here (plus the already applied pinctrl bits) should be sufficient to boot a basic initramfs. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> * tag 'riscv-jh7110-clk-reset-for-6.4' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: MAINTAINERS: generalise StarFive clk/reset entries reset: starfive: Add StarFive JH7110 reset driver clk: starfive: Add StarFive JH7110 always-on clock driver clk: starfive: Add StarFive JH7110 system clock driver reset: starfive: jh71x0: Use 32bit I/O on 32bit registers reset: starfive: Rename "jh7100" to "jh71x0" for the common code reset: starfive: Extract the common JH71X0 reset code reset: starfive: Factor out common JH71X0 reset code reset: Create subdirectory for StarFive drivers reset: starfive: Replace SOC_STARFIVE with ARCH_STARFIVE clk: starfive: Rename "jh7100" to "jh71x0" for the common code clk: starfive: Rename clk-starfive-jh7100.h to clk-starfive-jh71x0.h clk: starfive: Factor out common JH7100 and JH7110 code clk: starfive: Replace SOC_STARFIVE with ARCH_STARFIVE dt-bindings: clock: Add StarFive JH7110 always-on clock and reset generator dt-bindings: clock: Add StarFive JH7110 system clock and reset generator
2 parents eeac8ed + 63a30e1 commit 601e5d4

25 files changed

+2297
-864
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/starfive,jh7110-aoncrg.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: StarFive JH7110 Always-On Clock and Reset Generator
8+
9+
maintainers:
10+
- Emil Renner Berthing <kernel@esmil.dk>
11+
12+
properties:
13+
compatible:
14+
const: starfive,jh7110-aoncrg
15+
16+
reg:
17+
maxItems: 1
18+
19+
clocks:
20+
oneOf:
21+
- items:
22+
- description: Main Oscillator (24 MHz)
23+
- description: GMAC0 RMII reference or GMAC0 RGMII RX
24+
- description: STG AXI/AHB
25+
- description: APB Bus
26+
- description: GMAC0 GTX
27+
28+
- items:
29+
- description: Main Oscillator (24 MHz)
30+
- description: GMAC0 RMII reference or GMAC0 RGMII RX
31+
- description: STG AXI/AHB or GMAC0 RGMII RX
32+
- description: APB Bus or STG AXI/AHB
33+
- description: GMAC0 GTX or APB Bus
34+
- description: RTC Oscillator (32.768 kHz) or GMAC0 GTX
35+
36+
- items:
37+
- description: Main Oscillator (24 MHz)
38+
- description: GMAC0 RMII reference
39+
- description: GMAC0 RGMII RX
40+
- description: STG AXI/AHB
41+
- description: APB Bus
42+
- description: GMAC0 GTX
43+
- description: RTC Oscillator (32.768 kHz)
44+
45+
clock-names:
46+
oneOf:
47+
- minItems: 5
48+
items:
49+
- const: osc
50+
- enum:
51+
- gmac0_rmii_refin
52+
- gmac0_rgmii_rxin
53+
- const: stg_axiahb
54+
- const: apb_bus
55+
- const: gmac0_gtxclk
56+
- const: rtc_osc
57+
58+
- minItems: 6
59+
items:
60+
- const: osc
61+
- const: gmac0_rmii_refin
62+
- const: gmac0_rgmii_rxin
63+
- const: stg_axiahb
64+
- const: apb_bus
65+
- const: gmac0_gtxclk
66+
- const: rtc_osc
67+
68+
'#clock-cells':
69+
const: 1
70+
description:
71+
See <dt-bindings/clock/starfive,jh7110-crg.h> for valid indices.
72+
73+
'#reset-cells':
74+
const: 1
75+
description:
76+
See <dt-bindings/reset/starfive,jh7110-crg.h> for valid indices.
77+
78+
required:
79+
- compatible
80+
- reg
81+
- clocks
82+
- clock-names
83+
- '#clock-cells'
84+
- '#reset-cells'
85+
86+
additionalProperties: false
87+
88+
examples:
89+
- |
90+
#include <dt-bindings/clock/starfive,jh7110-crg.h>
91+
92+
clock-controller@17000000 {
93+
compatible = "starfive,jh7110-aoncrg";
94+
reg = <0x17000000 0x10000>;
95+
clocks = <&osc>, <&gmac0_rmii_refin>,
96+
<&gmac0_rgmii_rxin>,
97+
<&syscrg JH7110_SYSCLK_STG_AXIAHB>,
98+
<&syscrg JH7110_SYSCLK_APB_BUS>,
99+
<&syscrg JH7110_SYSCLK_GMAC0_GTXCLK>,
100+
<&rtc_osc>;
101+
clock-names = "osc", "gmac0_rmii_refin",
102+
"gmac0_rgmii_rxin", "stg_axiahb",
103+
"apb_bus", "gmac0_gtxclk",
104+
"rtc_osc";
105+
#clock-cells = <1>;
106+
#reset-cells = <1>;
107+
};
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/starfive,jh7110-syscrg.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: StarFive JH7110 System Clock and Reset Generator
8+
9+
maintainers:
10+
- Emil Renner Berthing <kernel@esmil.dk>
11+
12+
properties:
13+
compatible:
14+
const: starfive,jh7110-syscrg
15+
16+
reg:
17+
maxItems: 1
18+
19+
clocks:
20+
oneOf:
21+
- items:
22+
- description: Main Oscillator (24 MHz)
23+
- description: GMAC1 RMII reference or GMAC1 RGMII RX
24+
- description: External I2S TX bit clock
25+
- description: External I2S TX left/right channel clock
26+
- description: External I2S RX bit clock
27+
- description: External I2S RX left/right channel clock
28+
- description: External TDM clock
29+
- description: External audio master clock
30+
31+
- items:
32+
- description: Main Oscillator (24 MHz)
33+
- description: GMAC1 RMII reference
34+
- description: GMAC1 RGMII RX
35+
- description: External I2S TX bit clock
36+
- description: External I2S TX left/right channel clock
37+
- description: External I2S RX bit clock
38+
- description: External I2S RX left/right channel clock
39+
- description: External TDM clock
40+
- description: External audio master clock
41+
42+
clock-names:
43+
oneOf:
44+
- items:
45+
- const: osc
46+
- enum:
47+
- gmac1_rmii_refin
48+
- gmac1_rgmii_rxin
49+
- const: i2stx_bclk_ext
50+
- const: i2stx_lrck_ext
51+
- const: i2srx_bclk_ext
52+
- const: i2srx_lrck_ext
53+
- const: tdm_ext
54+
- const: mclk_ext
55+
56+
- items:
57+
- const: osc
58+
- const: gmac1_rmii_refin
59+
- const: gmac1_rgmii_rxin
60+
- const: i2stx_bclk_ext
61+
- const: i2stx_lrck_ext
62+
- const: i2srx_bclk_ext
63+
- const: i2srx_lrck_ext
64+
- const: tdm_ext
65+
- const: mclk_ext
66+
67+
'#clock-cells':
68+
const: 1
69+
description:
70+
See <dt-bindings/clock/starfive,jh7110-crg.h> for valid indices.
71+
72+
'#reset-cells':
73+
const: 1
74+
description:
75+
See <dt-bindings/reset/starfive,jh7110-crg.h> for valid indices.
76+
77+
required:
78+
- compatible
79+
- reg
80+
- clocks
81+
- clock-names
82+
- '#clock-cells'
83+
- '#reset-cells'
84+
85+
additionalProperties: false
86+
87+
examples:
88+
- |
89+
clock-controller@13020000 {
90+
compatible = "starfive,jh7110-syscrg";
91+
reg = <0x13020000 0x10000>;
92+
clocks = <&osc>, <&gmac1_rmii_refin>,
93+
<&gmac1_rgmii_rxin>,
94+
<&i2stx_bclk_ext>, <&i2stx_lrck_ext>,
95+
<&i2srx_bclk_ext>, <&i2srx_lrck_ext>,
96+
<&tdm_ext>, <&mclk_ext>;
97+
clock-names = "osc", "gmac1_rmii_refin",
98+
"gmac1_rgmii_rxin",
99+
"i2stx_bclk_ext", "i2stx_lrck_ext",
100+
"i2srx_bclk_ext", "i2srx_lrck_ext",
101+
"tdm_ext", "mclk_ext";
102+
#clock-cells = <1>;
103+
#reset-cells = <1>;
104+
};

MAINTAINERS

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19907,19 +19907,20 @@ M: Emil Renner Berthing <kernel@esmil.dk>
1990719907
S: Maintained
1990819908
F: arch/riscv/boot/dts/starfive/
1990919909

19910-
STARFIVE JH7100 CLOCK DRIVERS
19911-
M: Emil Renner Berthing <kernel@esmil.dk>
19912-
S: Maintained
19913-
F: Documentation/devicetree/bindings/clock/starfive,jh7100-*.yaml
19914-
F: drivers/clk/starfive/clk-starfive-jh7100*
19915-
F: include/dt-bindings/clock/starfive-jh7100*.h
19916-
1991719910
STARFIVE JH7110 MMC/SD/SDIO DRIVER
1991819911
M: William Qiu <william.qiu@starfivetech.com>
1991919912
S: Supported
1992019913
F: Documentation/devicetree/bindings/mmc/starfive*
1992119914
F: drivers/mmc/host/dw_mmc-starfive.c
1992219915

19916+
STARFIVE JH71X0 CLOCK DRIVERS
19917+
M: Emil Renner Berthing <kernel@esmil.dk>
19918+
M: Hal Feng <hal.feng@starfivetech.com>
19919+
S: Maintained
19920+
F: Documentation/devicetree/bindings/clock/starfive,jh71*.yaml
19921+
F: drivers/clk/starfive/clk-starfive-jh71*
19922+
F: include/dt-bindings/clock/starfive?jh71*.h
19923+
1992319924
STARFIVE JH71X0 PINCTRL DRIVERS
1992419925
M: Emil Renner Berthing <kernel@esmil.dk>
1992519926
M: Jianlong Huang <jianlong.huang@starfivetech.com>
@@ -19930,12 +19931,13 @@ F: drivers/pinctrl/starfive/pinctrl-starfive-jh71*
1993019931
F: include/dt-bindings/pinctrl/pinctrl-starfive-jh7100.h
1993119932
F: include/dt-bindings/pinctrl/starfive,jh7110-pinctrl.h
1993219933

19933-
STARFIVE JH7100 RESET CONTROLLER DRIVER
19934+
STARFIVE JH71X0 RESET CONTROLLER DRIVERS
1993419935
M: Emil Renner Berthing <kernel@esmil.dk>
19936+
M: Hal Feng <hal.feng@starfivetech.com>
1993519937
S: Maintained
1993619938
F: Documentation/devicetree/bindings/reset/starfive,jh7100-reset.yaml
19937-
F: drivers/reset/reset-starfive-jh7100.c
19938-
F: include/dt-bindings/reset/starfive-jh7100.h
19939+
F: drivers/reset/starfive/reset-starfive-jh71*
19940+
F: include/dt-bindings/reset/starfive?jh71*.h
1993919941

1994019942
STARFIVE JH71XX PMU CONTROLLER DRIVER
1994119943
M: Walker Chen <walker.chen@starfivetech.com>

drivers/clk/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ obj-$(CONFIG_PLAT_SPEAR) += spear/
117117
obj-y += sprd/
118118
obj-$(CONFIG_ARCH_STI) += st/
119119
obj-$(CONFIG_ARCH_STM32) += stm32/
120-
obj-$(CONFIG_SOC_STARFIVE) += starfive/
120+
obj-y += starfive/
121121
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
122122
obj-y += sunxi-ng/
123123
obj-$(CONFIG_ARCH_TEGRA) += tegra/

drivers/clk/starfive/Kconfig

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
11
# SPDX-License-Identifier: GPL-2.0
22

3+
config CLK_STARFIVE_JH71X0
4+
bool
5+
36
config CLK_STARFIVE_JH7100
47
bool "StarFive JH7100 clock support"
5-
depends on SOC_STARFIVE || COMPILE_TEST
6-
default SOC_STARFIVE
8+
depends on ARCH_STARFIVE || COMPILE_TEST
9+
select CLK_STARFIVE_JH71X0
10+
default ARCH_STARFIVE
711
help
812
Say yes here to support the clock controller on the StarFive JH7100
913
SoC.
1014

1115
config CLK_STARFIVE_JH7100_AUDIO
1216
tristate "StarFive JH7100 audio clock support"
1317
depends on CLK_STARFIVE_JH7100
14-
default m if SOC_STARFIVE
18+
select CLK_STARFIVE_JH71X0
19+
default m if ARCH_STARFIVE
1520
help
1621
Say Y or M here to support the audio clocks on the StarFive JH7100
1722
SoC.
23+
24+
config CLK_STARFIVE_JH7110_SYS
25+
bool "StarFive JH7110 system clock support"
26+
depends on ARCH_STARFIVE || COMPILE_TEST
27+
select AUXILIARY_BUS
28+
select CLK_STARFIVE_JH71X0
29+
select RESET_STARFIVE_JH7110
30+
default ARCH_STARFIVE
31+
help
32+
Say yes here to support the system clock controller on the
33+
StarFive JH7110 SoC.
34+
35+
config CLK_STARFIVE_JH7110_AON
36+
tristate "StarFive JH7110 always-on clock support"
37+
depends on CLK_STARFIVE_JH7110_SYS
38+
select AUXILIARY_BUS
39+
select CLK_STARFIVE_JH71X0
40+
select RESET_STARFIVE_JH7110
41+
default m if ARCH_STARFIVE
42+
help
43+
Say yes here to support the always-on clock controller on the
44+
StarFive JH7110 SoC.

drivers/clk/starfive/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
# StarFive Clock
2+
obj-$(CONFIG_CLK_STARFIVE_JH71X0) += clk-starfive-jh71x0.o
3+
34
obj-$(CONFIG_CLK_STARFIVE_JH7100) += clk-starfive-jh7100.o
45
obj-$(CONFIG_CLK_STARFIVE_JH7100_AUDIO) += clk-starfive-jh7100-audio.o
6+
7+
obj-$(CONFIG_CLK_STARFIVE_JH7110_SYS) += clk-starfive-jh7110-sys.o
8+
obj-$(CONFIG_CLK_STARFIVE_JH7110_AON) += clk-starfive-jh7110-aon.o

0 commit comments

Comments
 (0)