0051-dt-bindings-clock-Add-StarFive-JH7110-System-Top-Gro.patch 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. From 84575863e4cf1a5dd877a11d31115c19004ac36a Mon Sep 17 00:00:00 2001
  2. From: Xingyu Wu <[email protected]>
  3. Date: Thu, 18 May 2023 18:12:24 +0800
  4. Subject: [PATCH 051/122] dt-bindings: clock: Add StarFive JH7110
  5. System-Top-Group clock and reset generator
  6. Add bindings for the System-Top-Group clock and reset generator (STGCRG)
  7. on the JH7110 RISC-V SoC by StarFive Ltd.
  8. Reviewed-by: Krzysztof Kozlowski <[email protected]>
  9. Signed-off-by: Xingyu Wu <[email protected]>
  10. ---
  11. .../clock/starfive,jh7110-stgcrg.yaml | 82 +++++++++++++++++++
  12. .../dt-bindings/clock/starfive,jh7110-crg.h | 34 ++++++++
  13. .../dt-bindings/reset/starfive,jh7110-crg.h | 28 +++++++
  14. 3 files changed, 144 insertions(+)
  15. create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh7110-stgcrg.yaml
  16. --- /dev/null
  17. +++ b/Documentation/devicetree/bindings/clock/starfive,jh7110-stgcrg.yaml
  18. @@ -0,0 +1,82 @@
  19. +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
  20. +%YAML 1.2
  21. +---
  22. +$id: http://devicetree.org/schemas/clock/starfive,jh7110-stgcrg.yaml#
  23. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  24. +
  25. +title: StarFive JH7110 System-Top-Group Clock and Reset Generator
  26. +
  27. +maintainers:
  28. + - Xingyu Wu <[email protected]>
  29. +
  30. +properties:
  31. + compatible:
  32. + const: starfive,jh7110-stgcrg
  33. +
  34. + reg:
  35. + maxItems: 1
  36. +
  37. + clocks:
  38. + items:
  39. + - description: Main Oscillator (24 MHz)
  40. + - description: HIFI4 core
  41. + - description: STG AXI/AHB
  42. + - description: USB (125 MHz)
  43. + - description: CPU Bus
  44. + - description: HIFI4 Axi
  45. + - description: NOC STG Bus
  46. + - description: APB Bus
  47. +
  48. + clock-names:
  49. + items:
  50. + - const: osc
  51. + - const: hifi4_core
  52. + - const: stg_axiahb
  53. + - const: usb_125m
  54. + - const: cpu_bus
  55. + - const: hifi4_axi
  56. + - const: nocstg_bus
  57. + - const: apb_bus
  58. +
  59. + '#clock-cells':
  60. + const: 1
  61. + description:
  62. + See <dt-bindings/clock/starfive,jh7110-crg.h> for valid indices.
  63. +
  64. + '#reset-cells':
  65. + const: 1
  66. + description:
  67. + See <dt-bindings/reset/starfive,jh7110-crg.h> for valid indices.
  68. +
  69. +required:
  70. + - compatible
  71. + - reg
  72. + - clocks
  73. + - clock-names
  74. + - '#clock-cells'
  75. + - '#reset-cells'
  76. +
  77. +additionalProperties: false
  78. +
  79. +examples:
  80. + - |
  81. + #include <dt-bindings/clock/starfive,jh7110-crg.h>
  82. +
  83. + stgcrg: clock-controller@10230000 {
  84. + compatible = "starfive,jh7110-stgcrg";
  85. + reg = <0x10230000 0x10000>;
  86. + clocks = <&osc>,
  87. + <&syscrg JH7110_SYSCLK_HIFI4_CORE>,
  88. + <&syscrg JH7110_SYSCLK_STG_AXIAHB>,
  89. + <&syscrg JH7110_SYSCLK_USB_125M>,
  90. + <&syscrg JH7110_SYSCLK_CPU_BUS>,
  91. + <&syscrg JH7110_SYSCLK_HIFI4_AXI>,
  92. + <&syscrg JH7110_SYSCLK_NOCSTG_BUS>,
  93. + <&syscrg JH7110_SYSCLK_APB_BUS>;
  94. + clock-names = "osc", "hifi4_core",
  95. + "stg_axiahb", "usb_125m",
  96. + "cpu_bus", "hifi4_axi",
  97. + "nocstg_bus", "apb_bus";
  98. + #clock-cells = <1>;
  99. + #reset-cells = <1>;
  100. + };
  101. --- a/include/dt-bindings/clock/starfive,jh7110-crg.h
  102. +++ b/include/dt-bindings/clock/starfive,jh7110-crg.h
  103. @@ -1,6 +1,7 @@
  104. /* SPDX-License-Identifier: GPL-2.0 OR MIT */
  105. /*
  106. * Copyright 2022 Emil Renner Berthing <[email protected]>
  107. + * Copyright 2022 StarFive Technology Co., Ltd.
  108. */
  109. #ifndef __DT_BINDINGS_CLOCK_STARFIVE_JH7110_CRG_H__
  110. @@ -224,4 +225,37 @@
  111. #define JH7110_AONCLK_END 14
  112. +/* STGCRG clocks */
  113. +#define JH7110_STGCLK_HIFI4_CLK_CORE 0
  114. +#define JH7110_STGCLK_USB0_APB 1
  115. +#define JH7110_STGCLK_USB0_UTMI_APB 2
  116. +#define JH7110_STGCLK_USB0_AXI 3
  117. +#define JH7110_STGCLK_USB0_LPM 4
  118. +#define JH7110_STGCLK_USB0_STB 5
  119. +#define JH7110_STGCLK_USB0_APP_125 6
  120. +#define JH7110_STGCLK_USB0_REFCLK 7
  121. +#define JH7110_STGCLK_PCIE0_AXI_MST0 8
  122. +#define JH7110_STGCLK_PCIE0_APB 9
  123. +#define JH7110_STGCLK_PCIE0_TL 10
  124. +#define JH7110_STGCLK_PCIE1_AXI_MST0 11
  125. +#define JH7110_STGCLK_PCIE1_APB 12
  126. +#define JH7110_STGCLK_PCIE1_TL 13
  127. +#define JH7110_STGCLK_PCIE_SLV_MAIN 14
  128. +#define JH7110_STGCLK_SEC_AHB 15
  129. +#define JH7110_STGCLK_SEC_MISC_AHB 16
  130. +#define JH7110_STGCLK_GRP0_MAIN 17
  131. +#define JH7110_STGCLK_GRP0_BUS 18
  132. +#define JH7110_STGCLK_GRP0_STG 19
  133. +#define JH7110_STGCLK_GRP1_MAIN 20
  134. +#define JH7110_STGCLK_GRP1_BUS 21
  135. +#define JH7110_STGCLK_GRP1_STG 22
  136. +#define JH7110_STGCLK_GRP1_HIFI 23
  137. +#define JH7110_STGCLK_E2_RTC 24
  138. +#define JH7110_STGCLK_E2_CORE 25
  139. +#define JH7110_STGCLK_E2_DBG 26
  140. +#define JH7110_STGCLK_DMA1P_AXI 27
  141. +#define JH7110_STGCLK_DMA1P_AHB 28
  142. +
  143. +#define JH7110_STGCLK_END 29
  144. +
  145. #endif /* __DT_BINDINGS_CLOCK_STARFIVE_JH7110_CRG_H__ */
  146. --- a/include/dt-bindings/reset/starfive,jh7110-crg.h
  147. +++ b/include/dt-bindings/reset/starfive,jh7110-crg.h
  148. @@ -1,6 +1,7 @@
  149. /* SPDX-License-Identifier: GPL-2.0 OR MIT */
  150. /*
  151. * Copyright (C) 2022 Emil Renner Berthing <[email protected]>
  152. + * Copyright (C) 2022 StarFive Technology Co., Ltd.
  153. */
  154. #ifndef __DT_BINDINGS_RESET_STARFIVE_JH7110_CRG_H__
  155. @@ -151,4 +152,31 @@
  156. #define JH7110_AONRST_END 8
  157. +/* STGCRG resets */
  158. +#define JH7110_STGRST_SYSCON 0
  159. +#define JH7110_STGRST_HIFI4_CORE 1
  160. +#define JH7110_STGRST_HIFI4_AXI 2
  161. +#define JH7110_STGRST_SEC_AHB 3
  162. +#define JH7110_STGRST_E24_CORE 4
  163. +#define JH7110_STGRST_DMA1P_AXI 5
  164. +#define JH7110_STGRST_DMA1P_AHB 6
  165. +#define JH7110_STGRST_USB0_AXI 7
  166. +#define JH7110_STGRST_USB0_APB 8
  167. +#define JH7110_STGRST_USB0_UTMI_APB 9
  168. +#define JH7110_STGRST_USB0_PWRUP 10
  169. +#define JH7110_STGRST_PCIE0_AXI_MST0 11
  170. +#define JH7110_STGRST_PCIE0_AXI_SLV0 12
  171. +#define JH7110_STGRST_PCIE0_AXI_SLV 13
  172. +#define JH7110_STGRST_PCIE0_BRG 14
  173. +#define JH7110_STGRST_PCIE0_CORE 15
  174. +#define JH7110_STGRST_PCIE0_APB 16
  175. +#define JH7110_STGRST_PCIE1_AXI_MST0 17
  176. +#define JH7110_STGRST_PCIE1_AXI_SLV0 18
  177. +#define JH7110_STGRST_PCIE1_AXI_SLV 19
  178. +#define JH7110_STGRST_PCIE1_BRG 20
  179. +#define JH7110_STGRST_PCIE1_CORE 21
  180. +#define JH7110_STGRST_PCIE1_APB 22
  181. +
  182. +#define JH7110_STGRST_END 23
  183. +
  184. #endif /* __DT_BINDINGS_RESET_STARFIVE_JH7110_CRG_H__ */