0026-dt-bindings-pinctrl-Add-StarFive-JH7110-sys-pinctrl.patch 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. From 28518a9637fee6b84464beff9d4308edc3efba72 Mon Sep 17 00:00:00 2001
  2. From: Jianlong Huang <[email protected]>
  3. Date: Thu, 9 Feb 2023 22:36:59 +0800
  4. Subject: [PATCH 026/122] dt-bindings: pinctrl: Add StarFive JH7110 sys pinctrl
  5. Add pinctrl bindings for StarFive JH7110 SoC sys 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-sys-pinctrl.yaml | 142 ++++++++++++++++++
  13. MAINTAINERS | 6 +-
  14. .../pinctrl/starfive,jh7110-pinctrl.h | 115 ++++++++++++++
  15. 3 files changed, 261 insertions(+), 2 deletions(-)
  16. create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh7110-sys-pinctrl.yaml
  17. create mode 100644 include/dt-bindings/pinctrl/starfive,jh7110-pinctrl.h
  18. --- /dev/null
  19. +++ b/Documentation/devicetree/bindings/pinctrl/starfive,jh7110-sys-pinctrl.yaml
  20. @@ -0,0 +1,142 @@
  21. +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
  22. +%YAML 1.2
  23. +---
  24. +$id: http://devicetree.org/schemas/pinctrl/starfive,jh7110-sys-pinctrl.yaml#
  25. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  26. +
  27. +title: StarFive JH7110 SYS Pin Controller
  28. +
  29. +description: |
  30. + Bindings for the JH7110 RISC-V SoC from StarFive Technology Ltd.
  31. +
  32. + Out of the SoC's many pins only the ones named PAD_GPIO0 to PAD_GPIO63
  33. + can be multiplexed and have configurable bias, drive strength,
  34. + schmitt trigger etc.
  35. + Some peripherals have their I/O go through the 64 "GPIOs". This also
  36. + includes a number of other UARTs, I2Cs, SPIs, PWMs etc.
  37. + All these peripherals are connected to all 64 GPIOs such that
  38. + any GPIO can be set up to be controlled by any of the peripherals.
  39. +
  40. +maintainers:
  41. + - Jianlong Huang <[email protected]>
  42. +
  43. +properties:
  44. + compatible:
  45. + const: starfive,jh7110-sys-pinctrl
  46. +
  47. + reg:
  48. + maxItems: 1
  49. +
  50. + clocks:
  51. + maxItems: 1
  52. +
  53. + resets:
  54. + maxItems: 1
  55. +
  56. + interrupts:
  57. + maxItems: 1
  58. +
  59. + interrupt-controller: true
  60. +
  61. + '#interrupt-cells':
  62. + const: 2
  63. +
  64. + gpio-controller: true
  65. +
  66. + '#gpio-cells':
  67. + const: 2
  68. +
  69. +patternProperties:
  70. + '-[0-9]+$':
  71. + type: object
  72. + additionalProperties: false
  73. + patternProperties:
  74. + '-pins$':
  75. + type: object
  76. + description: |
  77. + A pinctrl node should contain at least one subnode representing the
  78. + pinctrl groups available on the machine. Each subnode will list the
  79. + pins it needs, and how they should be configured, with regard to
  80. + muxer configuration, bias, input enable/disable, input schmitt
  81. + trigger enable/disable, slew-rate and drive strength.
  82. + allOf:
  83. + - $ref: /schemas/pinctrl/pincfg-node.yaml
  84. + - $ref: /schemas/pinctrl/pinmux-node.yaml
  85. + additionalProperties: false
  86. +
  87. + properties:
  88. + pinmux:
  89. + description: |
  90. + The list of GPIOs and their mux settings that properties in the
  91. + node apply to. This should be set using the GPIOMUX or PINMUX
  92. + macros.
  93. +
  94. + bias-disable: true
  95. +
  96. + bias-pull-up:
  97. + type: boolean
  98. +
  99. + bias-pull-down:
  100. + type: boolean
  101. +
  102. + drive-strength:
  103. + enum: [ 2, 4, 8, 12 ]
  104. +
  105. + input-enable: true
  106. +
  107. + input-disable: true
  108. +
  109. + input-schmitt-enable: true
  110. +
  111. + input-schmitt-disable: true
  112. +
  113. + slew-rate:
  114. + maximum: 1
  115. +
  116. +required:
  117. + - compatible
  118. + - reg
  119. + - clocks
  120. + - interrupts
  121. + - interrupt-controller
  122. + - '#interrupt-cells'
  123. + - gpio-controller
  124. + - '#gpio-cells'
  125. +
  126. +additionalProperties: false
  127. +
  128. +examples:
  129. + - |
  130. + pinctrl@13040000 {
  131. + compatible = "starfive,jh7110-sys-pinctrl";
  132. + reg = <0x13040000 0x10000>;
  133. + clocks = <&syscrg 112>;
  134. + resets = <&syscrg 2>;
  135. + interrupts = <86>;
  136. + interrupt-controller;
  137. + #interrupt-cells = <2>;
  138. + gpio-controller;
  139. + #gpio-cells = <2>;
  140. +
  141. + uart0-0 {
  142. + tx-pins {
  143. + pinmux = <0xff140005>;
  144. + bias-disable;
  145. + drive-strength = <12>;
  146. + input-disable;
  147. + input-schmitt-disable;
  148. + slew-rate = <0>;
  149. + };
  150. +
  151. + rx-pins {
  152. + pinmux = <0x0E000406>;
  153. + bias-pull-up;
  154. + drive-strength = <2>;
  155. + input-enable;
  156. + input-schmitt-enable;
  157. + slew-rate = <0>;
  158. + };
  159. + };
  160. + };
  161. +
  162. +...
  163. --- a/MAINTAINERS
  164. +++ b/MAINTAINERS
  165. @@ -19658,13 +19658,15 @@ F: Documentation/devicetree/bindings/clo
  166. F: drivers/clk/starfive/clk-starfive-jh71*
  167. F: include/dt-bindings/clock/starfive?jh71*.h
  168. -STARFIVE JH7100 PINCTRL DRIVER
  169. +STARFIVE JH71X0 PINCTRL DRIVERS
  170. M: Emil Renner Berthing <[email protected]>
  171. +M: Jianlong Huang <[email protected]>
  172. L: [email protected]
  173. S: Maintained
  174. -F: Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml
  175. +F: Documentation/devicetree/bindings/pinctrl/starfive,jh71*.yaml
  176. F: drivers/pinctrl/starfive/
  177. F: include/dt-bindings/pinctrl/pinctrl-starfive-jh7100.h
  178. +F: include/dt-bindings/pinctrl/starfive,jh7110-pinctrl.h
  179. STARFIVE JH71X0 RESET CONTROLLER DRIVERS
  180. M: Emil Renner Berthing <[email protected]>
  181. --- /dev/null
  182. +++ b/include/dt-bindings/pinctrl/starfive,jh7110-pinctrl.h
  183. @@ -0,0 +1,115 @@
  184. +/* SPDX-License-Identifier: GPL-2.0 OR MIT */
  185. +/*
  186. + * Copyright (C) 2022 Emil Renner Berthing <[email protected]>
  187. + * Copyright (C) 2022 StarFive Technology Co., Ltd.
  188. + */
  189. +
  190. +#ifndef __DT_BINDINGS_PINCTRL_STARFIVE_JH7110_H__
  191. +#define __DT_BINDINGS_PINCTRL_STARFIVE_JH7110_H__
  192. +
  193. +/* sys_iomux pins */
  194. +#define PAD_GPIO0 0
  195. +#define PAD_GPIO1 1
  196. +#define PAD_GPIO2 2
  197. +#define PAD_GPIO3 3
  198. +#define PAD_GPIO4 4
  199. +#define PAD_GPIO5 5
  200. +#define PAD_GPIO6 6
  201. +#define PAD_GPIO7 7
  202. +#define PAD_GPIO8 8
  203. +#define PAD_GPIO9 9
  204. +#define PAD_GPIO10 10
  205. +#define PAD_GPIO11 11
  206. +#define PAD_GPIO12 12
  207. +#define PAD_GPIO13 13
  208. +#define PAD_GPIO14 14
  209. +#define PAD_GPIO15 15
  210. +#define PAD_GPIO16 16
  211. +#define PAD_GPIO17 17
  212. +#define PAD_GPIO18 18
  213. +#define PAD_GPIO19 19
  214. +#define PAD_GPIO20 20
  215. +#define PAD_GPIO21 21
  216. +#define PAD_GPIO22 22
  217. +#define PAD_GPIO23 23
  218. +#define PAD_GPIO24 24
  219. +#define PAD_GPIO25 25
  220. +#define PAD_GPIO26 26
  221. +#define PAD_GPIO27 27
  222. +#define PAD_GPIO28 28
  223. +#define PAD_GPIO29 29
  224. +#define PAD_GPIO30 30
  225. +#define PAD_GPIO31 31
  226. +#define PAD_GPIO32 32
  227. +#define PAD_GPIO33 33
  228. +#define PAD_GPIO34 34
  229. +#define PAD_GPIO35 35
  230. +#define PAD_GPIO36 36
  231. +#define PAD_GPIO37 37
  232. +#define PAD_GPIO38 38
  233. +#define PAD_GPIO39 39
  234. +#define PAD_GPIO40 40
  235. +#define PAD_GPIO41 41
  236. +#define PAD_GPIO42 42
  237. +#define PAD_GPIO43 43
  238. +#define PAD_GPIO44 44
  239. +#define PAD_GPIO45 45
  240. +#define PAD_GPIO46 46
  241. +#define PAD_GPIO47 47
  242. +#define PAD_GPIO48 48
  243. +#define PAD_GPIO49 49
  244. +#define PAD_GPIO50 50
  245. +#define PAD_GPIO51 51
  246. +#define PAD_GPIO52 52
  247. +#define PAD_GPIO53 53
  248. +#define PAD_GPIO54 54
  249. +#define PAD_GPIO55 55
  250. +#define PAD_GPIO56 56
  251. +#define PAD_GPIO57 57
  252. +#define PAD_GPIO58 58
  253. +#define PAD_GPIO59 59
  254. +#define PAD_GPIO60 60
  255. +#define PAD_GPIO61 61
  256. +#define PAD_GPIO62 62
  257. +#define PAD_GPIO63 63
  258. +#define PAD_SD0_CLK 64
  259. +#define PAD_SD0_CMD 65
  260. +#define PAD_SD0_DATA0 66
  261. +#define PAD_SD0_DATA1 67
  262. +#define PAD_SD0_DATA2 68
  263. +#define PAD_SD0_DATA3 69
  264. +#define PAD_SD0_DATA4 70
  265. +#define PAD_SD0_DATA5 71
  266. +#define PAD_SD0_DATA6 72
  267. +#define PAD_SD0_DATA7 73
  268. +#define PAD_SD0_STRB 74
  269. +#define PAD_GMAC1_MDC 75
  270. +#define PAD_GMAC1_MDIO 76
  271. +#define PAD_GMAC1_RXD0 77
  272. +#define PAD_GMAC1_RXD1 78
  273. +#define PAD_GMAC1_RXD2 79
  274. +#define PAD_GMAC1_RXD3 80
  275. +#define PAD_GMAC1_RXDV 81
  276. +#define PAD_GMAC1_RXC 82
  277. +#define PAD_GMAC1_TXD0 83
  278. +#define PAD_GMAC1_TXD1 84
  279. +#define PAD_GMAC1_TXD2 85
  280. +#define PAD_GMAC1_TXD3 86
  281. +#define PAD_GMAC1_TXEN 87
  282. +#define PAD_GMAC1_TXC 88
  283. +#define PAD_QSPI_SCLK 89
  284. +#define PAD_QSPI_CS0 90
  285. +#define PAD_QSPI_DATA0 91
  286. +#define PAD_QSPI_DATA1 92
  287. +#define PAD_QSPI_DATA2 93
  288. +#define PAD_QSPI_DATA3 94
  289. +
  290. +#define GPOUT_LOW 0
  291. +#define GPOUT_HIGH 1
  292. +
  293. +#define GPOEN_ENABLE 0
  294. +#define GPOEN_DISABLE 1
  295. +
  296. +#define GPI_NONE 255
  297. +
  298. +#endif