0027-dt-bindings-pinctrl-Add-StarFive-JH7110-aon-pinctrl.patch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. From 514cae455122c799638226f4358e8e6f5e155248 Mon Sep 17 00:00:00 2001
  2. From: Jianlong Huang <[email protected]>
  3. Date: Thu, 9 Feb 2023 22:37:00 +0800
  4. Subject: [PATCH 027/122] dt-bindings: pinctrl: Add StarFive JH7110 aon pinctrl
  5. Add pinctrl bindings for StarFive JH7110 SoC aon pinctrl controller.
  6. Reviewed-by: Rob Herring <[email protected]>
  7. Signed-off-by: Jianlong Huang <[email protected]>
  8. Co-developed-by: Emil Renner Berthing <[email protected]>
  9. Signed-off-by: Emil Renner Berthing <[email protected]>
  10. Signed-off-by: Hal Feng <[email protected]>
  11. ---
  12. .../pinctrl/starfive,jh7110-aon-pinctrl.yaml | 124 ++++++++++++++++++
  13. .../pinctrl/starfive,jh7110-pinctrl.h | 22 ++++
  14. 2 files changed, 146 insertions(+)
  15. create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh7110-aon-pinctrl.yaml
  16. --- /dev/null
  17. +++ b/Documentation/devicetree/bindings/pinctrl/starfive,jh7110-aon-pinctrl.yaml
  18. @@ -0,0 +1,124 @@
  19. +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
  20. +%YAML 1.2
  21. +---
  22. +$id: http://devicetree.org/schemas/pinctrl/starfive,jh7110-aon-pinctrl.yaml#
  23. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  24. +
  25. +title: StarFive JH7110 AON Pin Controller
  26. +
  27. +description: |
  28. + Bindings for the JH7110 RISC-V SoC from StarFive Technology Ltd.
  29. +
  30. + Out of the SoC's many pins only the ones named PAD_RGPIO0 to PAD_RGPIO3
  31. + can be multiplexed and have configurable bias, drive strength,
  32. + schmitt trigger etc.
  33. + Some peripherals such as PWM have their I/O go through the 4 "GPIOs".
  34. +
  35. +maintainers:
  36. + - Jianlong Huang <[email protected]>
  37. +
  38. +properties:
  39. + compatible:
  40. + const: starfive,jh7110-aon-pinctrl
  41. +
  42. + reg:
  43. + maxItems: 1
  44. +
  45. + resets:
  46. + maxItems: 1
  47. +
  48. + interrupts:
  49. + maxItems: 1
  50. +
  51. + interrupt-controller: true
  52. +
  53. + '#interrupt-cells':
  54. + const: 2
  55. +
  56. + gpio-controller: true
  57. +
  58. + '#gpio-cells':
  59. + const: 2
  60. +
  61. +patternProperties:
  62. + '-[0-9]+$':
  63. + type: object
  64. + additionalProperties: false
  65. + patternProperties:
  66. + '-pins$':
  67. + type: object
  68. + description: |
  69. + A pinctrl node should contain at least one subnode representing the
  70. + pinctrl groups available on the machine. Each subnode will list the
  71. + pins it needs, and how they should be configured, with regard to
  72. + muxer configuration, bias, input enable/disable, input schmitt
  73. + trigger enable/disable, slew-rate and drive strength.
  74. + allOf:
  75. + - $ref: /schemas/pinctrl/pincfg-node.yaml
  76. + - $ref: /schemas/pinctrl/pinmux-node.yaml
  77. + additionalProperties: false
  78. +
  79. + properties:
  80. + pinmux:
  81. + description: |
  82. + The list of GPIOs and their mux settings that properties in the
  83. + node apply to. This should be set using the GPIOMUX macro.
  84. +
  85. + bias-disable: true
  86. +
  87. + bias-pull-up:
  88. + type: boolean
  89. +
  90. + bias-pull-down:
  91. + type: boolean
  92. +
  93. + drive-strength:
  94. + enum: [ 2, 4, 8, 12 ]
  95. +
  96. + input-enable: true
  97. +
  98. + input-disable: true
  99. +
  100. + input-schmitt-enable: true
  101. +
  102. + input-schmitt-disable: true
  103. +
  104. + slew-rate:
  105. + maximum: 1
  106. +
  107. +required:
  108. + - compatible
  109. + - reg
  110. + - interrupts
  111. + - interrupt-controller
  112. + - '#interrupt-cells'
  113. + - gpio-controller
  114. + - '#gpio-cells'
  115. +
  116. +additionalProperties: false
  117. +
  118. +examples:
  119. + - |
  120. + pinctrl@17020000 {
  121. + compatible = "starfive,jh7110-aon-pinctrl";
  122. + reg = <0x17020000 0x10000>;
  123. + resets = <&aoncrg 2>;
  124. + interrupts = <85>;
  125. + interrupt-controller;
  126. + #interrupt-cells = <2>;
  127. + gpio-controller;
  128. + #gpio-cells = <2>;
  129. +
  130. + pwm-0 {
  131. + pwm-pins {
  132. + pinmux = <0xff030802>;
  133. + bias-disable;
  134. + drive-strength = <12>;
  135. + input-disable;
  136. + input-schmitt-disable;
  137. + slew-rate = <0>;
  138. + };
  139. + };
  140. + };
  141. +
  142. +...
  143. --- a/include/dt-bindings/pinctrl/starfive,jh7110-pinctrl.h
  144. +++ b/include/dt-bindings/pinctrl/starfive,jh7110-pinctrl.h
  145. @@ -104,6 +104,28 @@
  146. #define PAD_QSPI_DATA2 93
  147. #define PAD_QSPI_DATA3 94
  148. +/* aon_iomux pins */
  149. +#define PAD_TESTEN 0
  150. +#define PAD_RGPIO0 1
  151. +#define PAD_RGPIO1 2
  152. +#define PAD_RGPIO2 3
  153. +#define PAD_RGPIO3 4
  154. +#define PAD_RSTN 5
  155. +#define PAD_GMAC0_MDC 6
  156. +#define PAD_GMAC0_MDIO 7
  157. +#define PAD_GMAC0_RXD0 8
  158. +#define PAD_GMAC0_RXD1 9
  159. +#define PAD_GMAC0_RXD2 10
  160. +#define PAD_GMAC0_RXD3 11
  161. +#define PAD_GMAC0_RXDV 12
  162. +#define PAD_GMAC0_RXC 13
  163. +#define PAD_GMAC0_TXD0 14
  164. +#define PAD_GMAC0_TXD1 15
  165. +#define PAD_GMAC0_TXD2 16
  166. +#define PAD_GMAC0_TXD3 17
  167. +#define PAD_GMAC0_TXEN 18
  168. +#define PAD_GMAC0_TXC 19
  169. +
  170. #define GPOUT_LOW 0
  171. #define GPOUT_HIGH 1