0002-dt-bindings-clock-Add-StarFive-JH7110-always-on-cloc.patch 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. From cd833f484009f37be57a2aa09257af6e8c1b25b6 Mon Sep 17 00:00:00 2001
  2. From: Emil Renner Berthing <[email protected]>
  3. Date: Sat, 1 Apr 2023 19:19:14 +0800
  4. Subject: [PATCH 002/122] dt-bindings: clock: Add StarFive JH7110 always-on
  5. clock and reset generator
  6. Add bindings for the always-on clock and reset generator (AONCRG) on the
  7. JH7110 RISC-V SoC by StarFive Ltd.
  8. Reviewed-by: Conor Dooley <[email protected]>
  9. Reviewed-by: Rob Herring <[email protected]>
  10. Reviewed-by: Emil Renner Berthing <[email protected]>
  11. Signed-off-by: Emil Renner Berthing <[email protected]>
  12. Signed-off-by: Hal Feng <[email protected]>
  13. Signed-off-by: Conor Dooley <[email protected]>
  14. ---
  15. .../clock/starfive,jh7110-aoncrg.yaml | 107 ++++++++++++++++++
  16. .../dt-bindings/clock/starfive,jh7110-crg.h | 18 +++
  17. .../dt-bindings/reset/starfive,jh7110-crg.h | 12 ++
  18. 3 files changed, 137 insertions(+)
  19. create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh7110-aoncrg.yaml
  20. --- /dev/null
  21. +++ b/Documentation/devicetree/bindings/clock/starfive,jh7110-aoncrg.yaml
  22. @@ -0,0 +1,107 @@
  23. +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
  24. +%YAML 1.2
  25. +---
  26. +$id: http://devicetree.org/schemas/clock/starfive,jh7110-aoncrg.yaml#
  27. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  28. +
  29. +title: StarFive JH7110 Always-On Clock and Reset Generator
  30. +
  31. +maintainers:
  32. + - Emil Renner Berthing <[email protected]>
  33. +
  34. +properties:
  35. + compatible:
  36. + const: starfive,jh7110-aoncrg
  37. +
  38. + reg:
  39. + maxItems: 1
  40. +
  41. + clocks:
  42. + oneOf:
  43. + - items:
  44. + - description: Main Oscillator (24 MHz)
  45. + - description: GMAC0 RMII reference or GMAC0 RGMII RX
  46. + - description: STG AXI/AHB
  47. + - description: APB Bus
  48. + - description: GMAC0 GTX
  49. +
  50. + - items:
  51. + - description: Main Oscillator (24 MHz)
  52. + - description: GMAC0 RMII reference or GMAC0 RGMII RX
  53. + - description: STG AXI/AHB or GMAC0 RGMII RX
  54. + - description: APB Bus or STG AXI/AHB
  55. + - description: GMAC0 GTX or APB Bus
  56. + - description: RTC Oscillator (32.768 kHz) or GMAC0 GTX
  57. +
  58. + - items:
  59. + - description: Main Oscillator (24 MHz)
  60. + - description: GMAC0 RMII reference
  61. + - description: GMAC0 RGMII RX
  62. + - description: STG AXI/AHB
  63. + - description: APB Bus
  64. + - description: GMAC0 GTX
  65. + - description: RTC Oscillator (32.768 kHz)
  66. +
  67. + clock-names:
  68. + oneOf:
  69. + - minItems: 5
  70. + items:
  71. + - const: osc
  72. + - enum:
  73. + - gmac0_rmii_refin
  74. + - gmac0_rgmii_rxin
  75. + - const: stg_axiahb
  76. + - const: apb_bus
  77. + - const: gmac0_gtxclk
  78. + - const: rtc_osc
  79. +
  80. + - minItems: 6
  81. + items:
  82. + - const: osc
  83. + - const: gmac0_rmii_refin
  84. + - const: gmac0_rgmii_rxin
  85. + - const: stg_axiahb
  86. + - const: apb_bus
  87. + - const: gmac0_gtxclk
  88. + - const: rtc_osc
  89. +
  90. + '#clock-cells':
  91. + const: 1
  92. + description:
  93. + See <dt-bindings/clock/starfive,jh7110-crg.h> for valid indices.
  94. +
  95. + '#reset-cells':
  96. + const: 1
  97. + description:
  98. + See <dt-bindings/reset/starfive,jh7110-crg.h> for valid indices.
  99. +
  100. +required:
  101. + - compatible
  102. + - reg
  103. + - clocks
  104. + - clock-names
  105. + - '#clock-cells'
  106. + - '#reset-cells'
  107. +
  108. +additionalProperties: false
  109. +
  110. +examples:
  111. + - |
  112. + #include <dt-bindings/clock/starfive,jh7110-crg.h>
  113. +
  114. + clock-controller@17000000 {
  115. + compatible = "starfive,jh7110-aoncrg";
  116. + reg = <0x17000000 0x10000>;
  117. + clocks = <&osc>, <&gmac0_rmii_refin>,
  118. + <&gmac0_rgmii_rxin>,
  119. + <&syscrg JH7110_SYSCLK_STG_AXIAHB>,
  120. + <&syscrg JH7110_SYSCLK_APB_BUS>,
  121. + <&syscrg JH7110_SYSCLK_GMAC0_GTXCLK>,
  122. + <&rtc_osc>;
  123. + clock-names = "osc", "gmac0_rmii_refin",
  124. + "gmac0_rgmii_rxin", "stg_axiahb",
  125. + "apb_bus", "gmac0_gtxclk",
  126. + "rtc_osc";
  127. + #clock-cells = <1>;
  128. + #reset-cells = <1>;
  129. + };
  130. --- a/include/dt-bindings/clock/starfive,jh7110-crg.h
  131. +++ b/include/dt-bindings/clock/starfive,jh7110-crg.h
  132. @@ -200,4 +200,22 @@
  133. #define JH7110_SYSCLK_END 190
  134. +/* AONCRG clocks */
  135. +#define JH7110_AONCLK_OSC_DIV4 0
  136. +#define JH7110_AONCLK_APB_FUNC 1
  137. +#define JH7110_AONCLK_GMAC0_AHB 2
  138. +#define JH7110_AONCLK_GMAC0_AXI 3
  139. +#define JH7110_AONCLK_GMAC0_RMII_RTX 4
  140. +#define JH7110_AONCLK_GMAC0_TX 5
  141. +#define JH7110_AONCLK_GMAC0_TX_INV 6
  142. +#define JH7110_AONCLK_GMAC0_RX 7
  143. +#define JH7110_AONCLK_GMAC0_RX_INV 8
  144. +#define JH7110_AONCLK_OTPC_APB 9
  145. +#define JH7110_AONCLK_RTC_APB 10
  146. +#define JH7110_AONCLK_RTC_INTERNAL 11
  147. +#define JH7110_AONCLK_RTC_32K 12
  148. +#define JH7110_AONCLK_RTC_CAL 13
  149. +
  150. +#define JH7110_AONCLK_END 14
  151. +
  152. #endif /* __DT_BINDINGS_CLOCK_STARFIVE_JH7110_CRG_H__ */
  153. --- a/include/dt-bindings/reset/starfive,jh7110-crg.h
  154. +++ b/include/dt-bindings/reset/starfive,jh7110-crg.h
  155. @@ -139,4 +139,16 @@
  156. #define JH7110_SYSRST_END 126
  157. +/* AONCRG resets */
  158. +#define JH7110_AONRST_GMAC0_AXI 0
  159. +#define JH7110_AONRST_GMAC0_AHB 1
  160. +#define JH7110_AONRST_IOMUX 2
  161. +#define JH7110_AONRST_PMU_APB 3
  162. +#define JH7110_AONRST_PMU_WKUP 4
  163. +#define JH7110_AONRST_RTC_APB 5
  164. +#define JH7110_AONRST_RTC_CAL 6
  165. +#define JH7110_AONRST_RTC_32K 7
  166. +
  167. +#define JH7110_AONRST_END 8
  168. +
  169. #endif /* __DT_BINDINGS_RESET_STARFIVE_JH7110_CRG_H__ */