dwmac-sun8i.txt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. * Allwinner sun8i GMAC ethernet controller
  2. This device is a platform glue layer for stmmac.
  3. Please see stmmac.txt for the other unchanged properties.
  4. Required properties:
  5. - compatible: must be one of the following string:
  6. "allwinner,sun8i-a83t-emac"
  7. "allwinner,sun8i-h3-emac"
  8. "allwinner,sun8i-r40-gmac"
  9. "allwinner,sun8i-v3s-emac"
  10. "allwinner,sun50i-a64-emac"
  11. - reg: address and length of the register for the device.
  12. - interrupts: interrupt for the device
  13. - interrupt-names: must be "macirq"
  14. - clocks: A phandle to the reference clock for this device
  15. - clock-names: must be "stmmaceth"
  16. - resets: A phandle to the reset control for this device
  17. - reset-names: must be "stmmaceth"
  18. - phy-mode: See ethernet.txt
  19. - phy-handle: See ethernet.txt
  20. - syscon: A phandle to the device containing the EMAC or GMAC clock register
  21. Optional properties:
  22. - allwinner,tx-delay-ps: TX clock delay chain value in ps.
  23. Range is 0-700. Default is 0.
  24. Unavailable for allwinner,sun8i-r40-gmac
  25. - allwinner,rx-delay-ps: RX clock delay chain value in ps.
  26. Range is 0-3100. Default is 0.
  27. Range is 0-700 for allwinner,sun8i-r40-gmac
  28. Both delay properties need to be a multiple of 100. They control the
  29. clock delay for external RGMII PHY. They do not apply to the internal
  30. PHY or external non-RGMII PHYs.
  31. Optional properties for the following compatibles:
  32. - "allwinner,sun8i-h3-emac",
  33. - "allwinner,sun8i-v3s-emac":
  34. - allwinner,leds-active-low: EPHY LEDs are active low
  35. Required child node of emac:
  36. - mdio bus node: should be named mdio with compatible "snps,dwmac-mdio"
  37. Required properties of the mdio node:
  38. - #address-cells: shall be 1
  39. - #size-cells: shall be 0
  40. The device node referenced by "phy" or "phy-handle" must be a child node
  41. of the mdio node. See phy.txt for the generic PHY bindings.
  42. The following compatibles require that the emac node have a mdio-mux child
  43. node called "mdio-mux":
  44. - "allwinner,sun8i-h3-emac"
  45. - "allwinner,sun8i-v3s-emac":
  46. Required properties for the mdio-mux node:
  47. - compatible = "allwinner,sun8i-h3-mdio-mux"
  48. - mdio-parent-bus: a phandle to EMAC mdio
  49. - one child mdio for the integrated mdio with the compatible
  50. "allwinner,sun8i-h3-mdio-internal"
  51. - one child mdio for the external mdio if present (V3s have none)
  52. Required properties for the mdio-mux children node:
  53. - reg: 1 for internal MDIO bus, 2 for external MDIO bus
  54. The following compatibles require a PHY node representing the integrated
  55. PHY, under the integrated MDIO bus node if an mdio-mux node is used:
  56. - "allwinner,sun8i-h3-emac",
  57. - "allwinner,sun8i-v3s-emac":
  58. Additional information regarding generic multiplexer properties can be found
  59. at Documentation/devicetree/bindings/net/mdio-mux.txt
  60. Required properties of the integrated phy node:
  61. - clocks: a phandle to the reference clock for the EPHY
  62. - resets: a phandle to the reset control for the EPHY
  63. - Must be a child of the integrated mdio
  64. Example with integrated PHY:
  65. emac: ethernet@1c0b000 {
  66. compatible = "allwinner,sun8i-h3-emac";
  67. syscon = <&syscon>;
  68. reg = <0x01c0b000 0x104>;
  69. interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
  70. interrupt-names = "macirq";
  71. resets = <&ccu RST_BUS_EMAC>;
  72. reset-names = "stmmaceth";
  73. clocks = <&ccu CLK_BUS_EMAC>;
  74. clock-names = "stmmaceth";
  75. phy-handle = <&int_mii_phy>;
  76. phy-mode = "mii";
  77. allwinner,leds-active-low;
  78. mdio: mdio {
  79. #address-cells = <1>;
  80. #size-cells = <0>;
  81. compatible = "snps,dwmac-mdio";
  82. };
  83. mdio-mux {
  84. compatible = "mdio-mux", "allwinner,sun8i-h3-mdio-mux";
  85. #address-cells = <1>;
  86. #size-cells = <0>;
  87. mdio-parent-bus = <&mdio>;
  88. int_mdio: mdio@1 {
  89. compatible = "allwinner,sun8i-h3-mdio-internal";
  90. reg = <1>;
  91. #address-cells = <1>;
  92. #size-cells = <0>;
  93. int_mii_phy: ethernet-phy@1 {
  94. reg = <1>;
  95. clocks = <&ccu CLK_BUS_EPHY>;
  96. resets = <&ccu RST_BUS_EPHY>;
  97. phy-is-integrated;
  98. };
  99. };
  100. ext_mdio: mdio@2 {
  101. reg = <2>;
  102. #address-cells = <1>;
  103. #size-cells = <0>;
  104. };
  105. };
  106. };
  107. Example with external PHY:
  108. emac: ethernet@1c0b000 {
  109. compatible = "allwinner,sun8i-h3-emac";
  110. syscon = <&syscon>;
  111. reg = <0x01c0b000 0x104>;
  112. interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
  113. interrupt-names = "macirq";
  114. resets = <&ccu RST_BUS_EMAC>;
  115. reset-names = "stmmaceth";
  116. clocks = <&ccu CLK_BUS_EMAC>;
  117. clock-names = "stmmaceth";
  118. phy-handle = <&ext_rgmii_phy>;
  119. phy-mode = "rgmii";
  120. allwinner,leds-active-low;
  121. mdio: mdio {
  122. #address-cells = <1>;
  123. #size-cells = <0>;
  124. compatible = "snps,dwmac-mdio";
  125. };
  126. mdio-mux {
  127. compatible = "allwinner,sun8i-h3-mdio-mux";
  128. #address-cells = <1>;
  129. #size-cells = <0>;
  130. mdio-parent-bus = <&mdio>;
  131. int_mdio: mdio@1 {
  132. compatible = "allwinner,sun8i-h3-mdio-internal";
  133. reg = <1>;
  134. #address-cells = <1>;
  135. #size-cells = <0>;
  136. int_mii_phy: ethernet-phy@1 {
  137. reg = <1>;
  138. clocks = <&ccu CLK_BUS_EPHY>;
  139. resets = <&ccu RST_BUS_EPHY>;
  140. };
  141. };
  142. ext_mdio: mdio@2 {
  143. reg = <2>;
  144. #address-cells = <1>;
  145. #size-cells = <0>;
  146. ext_rgmii_phy: ethernet-phy@1 {
  147. reg = <1>;
  148. };
  149. }:
  150. };
  151. };
  152. Example with SoC without integrated PHY
  153. emac: ethernet@1c0b000 {
  154. compatible = "allwinner,sun8i-a83t-emac";
  155. syscon = <&syscon>;
  156. reg = <0x01c0b000 0x104>;
  157. interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
  158. interrupt-names = "macirq";
  159. resets = <&ccu RST_BUS_EMAC>;
  160. reset-names = "stmmaceth";
  161. clocks = <&ccu CLK_BUS_EMAC>;
  162. clock-names = "stmmaceth";
  163. phy-handle = <&ext_rgmii_phy>;
  164. phy-mode = "rgmii";
  165. mdio: mdio {
  166. compatible = "snps,dwmac-mdio";
  167. #address-cells = <1>;
  168. #size-cells = <0>;
  169. ext_rgmii_phy: ethernet-phy@1 {
  170. reg = <1>;
  171. };
  172. };
  173. };