Skip to content

Commit 14b14a5

Browse files
SFxingyuwuConchuOD
authored andcommitted
dt-bindings: clock: Add StarFive JH7110 System-Top-Group clock and reset generator
Add bindings for the System-Top-Group clock and reset generator (STGCRG) on the JH7110 RISC-V SoC by StarFive Ltd. Acked-by: Palmer Dabbelt <palmer@rivosinc.com> Reviewed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
1 parent 2110add commit 14b14a5

File tree

3 files changed

+144
-0
lines changed

3 files changed

+144
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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-stgcrg.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: StarFive JH7110 System-Top-Group Clock and Reset Generator
8+
9+
maintainers:
10+
- Xingyu Wu <xingyu.wu@starfivetech.com>
11+
12+
properties:
13+
compatible:
14+
const: starfive,jh7110-stgcrg
15+
16+
reg:
17+
maxItems: 1
18+
19+
clocks:
20+
items:
21+
- description: Main Oscillator (24 MHz)
22+
- description: HIFI4 core
23+
- description: STG AXI/AHB
24+
- description: USB (125 MHz)
25+
- description: CPU Bus
26+
- description: HIFI4 Axi
27+
- description: NOC STG Bus
28+
- description: APB Bus
29+
30+
clock-names:
31+
items:
32+
- const: osc
33+
- const: hifi4_core
34+
- const: stg_axiahb
35+
- const: usb_125m
36+
- const: cpu_bus
37+
- const: hifi4_axi
38+
- const: nocstg_bus
39+
- const: apb_bus
40+
41+
'#clock-cells':
42+
const: 1
43+
description:
44+
See <dt-bindings/clock/starfive,jh7110-crg.h> for valid indices.
45+
46+
'#reset-cells':
47+
const: 1
48+
description:
49+
See <dt-bindings/reset/starfive,jh7110-crg.h> for valid indices.
50+
51+
required:
52+
- compatible
53+
- reg
54+
- clocks
55+
- clock-names
56+
- '#clock-cells'
57+
- '#reset-cells'
58+
59+
additionalProperties: false
60+
61+
examples:
62+
- |
63+
#include <dt-bindings/clock/starfive,jh7110-crg.h>
64+
65+
stgcrg: clock-controller@10230000 {
66+
compatible = "starfive,jh7110-stgcrg";
67+
reg = <0x10230000 0x10000>;
68+
clocks = <&osc>,
69+
<&syscrg JH7110_SYSCLK_HIFI4_CORE>,
70+
<&syscrg JH7110_SYSCLK_STG_AXIAHB>,
71+
<&syscrg JH7110_SYSCLK_USB_125M>,
72+
<&syscrg JH7110_SYSCLK_CPU_BUS>,
73+
<&syscrg JH7110_SYSCLK_HIFI4_AXI>,
74+
<&syscrg JH7110_SYSCLK_NOCSTG_BUS>,
75+
<&syscrg JH7110_SYSCLK_APB_BUS>;
76+
clock-names = "osc", "hifi4_core",
77+
"stg_axiahb", "usb_125m",
78+
"cpu_bus", "hifi4_axi",
79+
"nocstg_bus", "apb_bus";
80+
#clock-cells = <1>;
81+
#reset-cells = <1>;
82+
};

include/dt-bindings/clock/starfive,jh7110-crg.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* SPDX-License-Identifier: GPL-2.0 OR MIT */
22
/*
33
* Copyright 2022 Emil Renner Berthing <kernel@esmil.dk>
4+
* Copyright 2022 StarFive Technology Co., Ltd.
45
*/
56

67
#ifndef __DT_BINDINGS_CLOCK_STARFIVE_JH7110_CRG_H__
@@ -224,4 +225,37 @@
224225

225226
#define JH7110_AONCLK_END 14
226227

228+
/* STGCRG clocks */
229+
#define JH7110_STGCLK_HIFI4_CLK_CORE 0
230+
#define JH7110_STGCLK_USB0_APB 1
231+
#define JH7110_STGCLK_USB0_UTMI_APB 2
232+
#define JH7110_STGCLK_USB0_AXI 3
233+
#define JH7110_STGCLK_USB0_LPM 4
234+
#define JH7110_STGCLK_USB0_STB 5
235+
#define JH7110_STGCLK_USB0_APP_125 6
236+
#define JH7110_STGCLK_USB0_REFCLK 7
237+
#define JH7110_STGCLK_PCIE0_AXI_MST0 8
238+
#define JH7110_STGCLK_PCIE0_APB 9
239+
#define JH7110_STGCLK_PCIE0_TL 10
240+
#define JH7110_STGCLK_PCIE1_AXI_MST0 11
241+
#define JH7110_STGCLK_PCIE1_APB 12
242+
#define JH7110_STGCLK_PCIE1_TL 13
243+
#define JH7110_STGCLK_PCIE_SLV_MAIN 14
244+
#define JH7110_STGCLK_SEC_AHB 15
245+
#define JH7110_STGCLK_SEC_MISC_AHB 16
246+
#define JH7110_STGCLK_GRP0_MAIN 17
247+
#define JH7110_STGCLK_GRP0_BUS 18
248+
#define JH7110_STGCLK_GRP0_STG 19
249+
#define JH7110_STGCLK_GRP1_MAIN 20
250+
#define JH7110_STGCLK_GRP1_BUS 21
251+
#define JH7110_STGCLK_GRP1_STG 22
252+
#define JH7110_STGCLK_GRP1_HIFI 23
253+
#define JH7110_STGCLK_E2_RTC 24
254+
#define JH7110_STGCLK_E2_CORE 25
255+
#define JH7110_STGCLK_E2_DBG 26
256+
#define JH7110_STGCLK_DMA1P_AXI 27
257+
#define JH7110_STGCLK_DMA1P_AHB 28
258+
259+
#define JH7110_STGCLK_END 29
260+
227261
#endif /* __DT_BINDINGS_CLOCK_STARFIVE_JH7110_CRG_H__ */

include/dt-bindings/reset/starfive,jh7110-crg.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* SPDX-License-Identifier: GPL-2.0 OR MIT */
22
/*
33
* Copyright (C) 2022 Emil Renner Berthing <kernel@esmil.dk>
4+
* Copyright (C) 2022 StarFive Technology Co., Ltd.
45
*/
56

67
#ifndef __DT_BINDINGS_RESET_STARFIVE_JH7110_CRG_H__
@@ -151,4 +152,31 @@
151152

152153
#define JH7110_AONRST_END 8
153154

155+
/* STGCRG resets */
156+
#define JH7110_STGRST_SYSCON 0
157+
#define JH7110_STGRST_HIFI4_CORE 1
158+
#define JH7110_STGRST_HIFI4_AXI 2
159+
#define JH7110_STGRST_SEC_AHB 3
160+
#define JH7110_STGRST_E24_CORE 4
161+
#define JH7110_STGRST_DMA1P_AXI 5
162+
#define JH7110_STGRST_DMA1P_AHB 6
163+
#define JH7110_STGRST_USB0_AXI 7
164+
#define JH7110_STGRST_USB0_APB 8
165+
#define JH7110_STGRST_USB0_UTMI_APB 9
166+
#define JH7110_STGRST_USB0_PWRUP 10
167+
#define JH7110_STGRST_PCIE0_AXI_MST0 11
168+
#define JH7110_STGRST_PCIE0_AXI_SLV0 12
169+
#define JH7110_STGRST_PCIE0_AXI_SLV 13
170+
#define JH7110_STGRST_PCIE0_BRG 14
171+
#define JH7110_STGRST_PCIE0_CORE 15
172+
#define JH7110_STGRST_PCIE0_APB 16
173+
#define JH7110_STGRST_PCIE1_AXI_MST0 17
174+
#define JH7110_STGRST_PCIE1_AXI_SLV0 18
175+
#define JH7110_STGRST_PCIE1_AXI_SLV 19
176+
#define JH7110_STGRST_PCIE1_BRG 20
177+
#define JH7110_STGRST_PCIE1_CORE 21
178+
#define JH7110_STGRST_PCIE1_APB 22
179+
180+
#define JH7110_STGRST_END 23
181+
154182
#endif /* __DT_BINDINGS_RESET_STARFIVE_JH7110_CRG_H__ */

0 commit comments

Comments
 (0)