0043-dt-bindings-net-Add-support-StarFive-dwmac.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. From 6bef17fa124f20723724e2a9a1d890fd1a9d5eaa Mon Sep 17 00:00:00 2001
  2. From: Yanhong Wang <[email protected]>
  3. Date: Mon, 31 Oct 2022 18:08:15 +0800
  4. Subject: [PATCH 043/122] dt-bindings: net: Add support StarFive dwmac
  5. Add documentation to describe StarFive dwmac driver(GMAC).
  6. Signed-off-by: Yanhong Wang <[email protected]>
  7. Reviewed-by: Krzysztof Kozlowski <[email protected]>
  8. Signed-off-by: Paolo Abeni <[email protected]>
  9. Signed-off-by: Samin Guo <[email protected]>
  10. ---
  11. .../devicetree/bindings/net/snps,dwmac.yaml | 1 +
  12. .../bindings/net/starfive,jh7110-dwmac.yaml | 144 ++++++++++++++++++
  13. MAINTAINERS | 6 +
  14. 3 files changed, 151 insertions(+)
  15. create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
  16. --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
  17. +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
  18. @@ -91,6 +91,7 @@ properties:
  19. - snps,dwmac-5.20
  20. - snps,dwxgmac
  21. - snps,dwxgmac-2.10
  22. + - starfive,jh7110-dwmac
  23. reg:
  24. minItems: 1
  25. --- /dev/null
  26. +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
  27. @@ -0,0 +1,144 @@
  28. +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  29. +# Copyright (C) 2022 StarFive Technology Co., Ltd.
  30. +%YAML 1.2
  31. +---
  32. +$id: http://devicetree.org/schemas/net/starfive,jh7110-dwmac.yaml#
  33. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  34. +
  35. +title: StarFive JH7110 DWMAC glue layer
  36. +
  37. +maintainers:
  38. + - Emil Renner Berthing <[email protected]>
  39. + - Samin Guo <[email protected]>
  40. +
  41. +select:
  42. + properties:
  43. + compatible:
  44. + contains:
  45. + enum:
  46. + - starfive,jh7110-dwmac
  47. + required:
  48. + - compatible
  49. +
  50. +properties:
  51. + compatible:
  52. + items:
  53. + - enum:
  54. + - starfive,jh7110-dwmac
  55. + - const: snps,dwmac-5.20
  56. +
  57. + reg:
  58. + maxItems: 1
  59. +
  60. + clocks:
  61. + items:
  62. + - description: GMAC main clock
  63. + - description: GMAC AHB clock
  64. + - description: PTP clock
  65. + - description: TX clock
  66. + - description: GTX clock
  67. +
  68. + clock-names:
  69. + items:
  70. + - const: stmmaceth
  71. + - const: pclk
  72. + - const: ptp_ref
  73. + - const: tx
  74. + - const: gtx
  75. +
  76. + interrupts:
  77. + minItems: 3
  78. + maxItems: 3
  79. +
  80. + interrupt-names:
  81. + minItems: 3
  82. + maxItems: 3
  83. +
  84. + resets:
  85. + items:
  86. + - description: MAC Reset signal.
  87. + - description: AHB Reset signal.
  88. +
  89. + reset-names:
  90. + items:
  91. + - const: stmmaceth
  92. + - const: ahb
  93. +
  94. + starfive,tx-use-rgmii-clk:
  95. + description:
  96. + Tx clock is provided by external rgmii clock.
  97. + type: boolean
  98. +
  99. + starfive,syscon:
  100. + $ref: /schemas/types.yaml#/definitions/phandle-array
  101. + items:
  102. + - items:
  103. + - description: phandle to syscon that configures phy mode
  104. + - description: Offset of phy mode selection
  105. + - description: Shift of phy mode selection
  106. + description:
  107. + A phandle to syscon with two arguments that configure phy mode.
  108. + The argument one is the offset of phy mode selection, the
  109. + argument two is the shift of phy mode selection.
  110. +
  111. +required:
  112. + - compatible
  113. + - reg
  114. + - clocks
  115. + - clock-names
  116. + - interrupts
  117. + - interrupt-names
  118. + - resets
  119. + - reset-names
  120. +
  121. +allOf:
  122. + - $ref: snps,dwmac.yaml#
  123. +
  124. +unevaluatedProperties: false
  125. +
  126. +examples:
  127. + - |
  128. + ethernet@16030000 {
  129. + compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
  130. + reg = <0x16030000 0x10000>;
  131. + clocks = <&clk 3>, <&clk 2>, <&clk 109>,
  132. + <&clk 6>, <&clk 111>;
  133. + clock-names = "stmmaceth", "pclk", "ptp_ref",
  134. + "tx", "gtx";
  135. + resets = <&rst 1>, <&rst 2>;
  136. + reset-names = "stmmaceth", "ahb";
  137. + interrupts = <7>, <6>, <5>;
  138. + interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
  139. + phy-mode = "rgmii-id";
  140. + snps,multicast-filter-bins = <64>;
  141. + snps,perfect-filter-entries = <8>;
  142. + rx-fifo-depth = <2048>;
  143. + tx-fifo-depth = <2048>;
  144. + snps,fixed-burst;
  145. + snps,no-pbl-x8;
  146. + snps,tso;
  147. + snps,force_thresh_dma_mode;
  148. + snps,axi-config = <&stmmac_axi_setup>;
  149. + snps,en-tx-lpi-clockgating;
  150. + snps,txpbl = <16>;
  151. + snps,rxpbl = <16>;
  152. + starfive,syscon = <&aon_syscon 0xc 0x12>;
  153. + phy-handle = <&phy0>;
  154. +
  155. + mdio {
  156. + #address-cells = <1>;
  157. + #size-cells = <0>;
  158. + compatible = "snps,dwmac-mdio";
  159. +
  160. + phy0: ethernet-phy@0 {
  161. + reg = <0>;
  162. + };
  163. + };
  164. +
  165. + stmmac_axi_setup: stmmac-axi-config {
  166. + snps,lpi_en;
  167. + snps,wr_osr_lmt = <4>;
  168. + snps,rd_osr_lmt = <4>;
  169. + snps,blen = <256 128 64 32 0 0 0>;
  170. + };
  171. + };
  172. --- a/MAINTAINERS
  173. +++ b/MAINTAINERS
  174. @@ -19650,6 +19650,12 @@ M: Emil Renner Berthing <[email protected]
  175. S: Maintained
  176. F: arch/riscv/boot/dts/starfive/
  177. +STARFIVE DWMAC GLUE LAYER
  178. +M: Emil Renner Berthing <[email protected]>
  179. +M: Samin Guo <[email protected]>
  180. +S: Maintained
  181. +F: Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
  182. +
  183. STARFIVE JH7110 PLL CLOCK DRIVER
  184. M: Xingyu Wu <[email protected]>
  185. S: Supported