rockchip,emac.yaml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # SPDX-License-Identifier: GPL-2.0
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/net/rockchip,emac.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Rockchip RK3036/RK3066/RK3188 Ethernet Media Access Controller (EMAC)
  7. maintainers:
  8. - Heiko Stuebner <heiko@sntech.de>
  9. properties:
  10. compatible:
  11. enum:
  12. - rockchip,rk3036-emac
  13. - rockchip,rk3066-emac
  14. - rockchip,rk3188-emac
  15. reg:
  16. maxItems: 1
  17. interrupts:
  18. maxItems: 1
  19. clocks:
  20. minItems: 2
  21. items:
  22. - description: host clock
  23. - description: reference clock
  24. - description: mac TX/RX clock
  25. clock-names:
  26. minItems: 2
  27. items:
  28. - const: hclk
  29. - const: macref
  30. - const: macclk
  31. rockchip,grf:
  32. $ref: /schemas/types.yaml#/definitions/phandle
  33. description:
  34. Phandle to the syscon GRF used to control speed and mode for the EMAC.
  35. phy-supply:
  36. description:
  37. Phandle to a regulator if the PHY needs one.
  38. mdio:
  39. $ref: mdio.yaml#
  40. unevaluatedProperties: false
  41. required:
  42. - compatible
  43. - reg
  44. - interrupts
  45. - clocks
  46. - clock-names
  47. - rockchip,grf
  48. - phy
  49. - phy-mode
  50. - mdio
  51. allOf:
  52. - $ref: ethernet-controller.yaml#
  53. - if:
  54. properties:
  55. compatible:
  56. contains:
  57. const: rockchip,rk3036-emac
  58. then:
  59. properties:
  60. clocks:
  61. minItems: 3
  62. clock-names:
  63. minItems: 3
  64. else:
  65. properties:
  66. clocks:
  67. maxItems: 2
  68. clock-names:
  69. maxItems: 2
  70. unevaluatedProperties: false
  71. examples:
  72. - |
  73. #include <dt-bindings/clock/rk3188-cru-common.h>
  74. #include <dt-bindings/interrupt-controller/arm-gic.h>
  75. ethernet@10204000 {
  76. compatible = "rockchip,rk3188-emac";
  77. reg = <0xc0fc2000 0x3c>;
  78. interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
  79. clocks = <&cru HCLK_EMAC>, <&cru SCLK_MAC>;
  80. clock-names = "hclk", "macref";
  81. rockchip,grf = <&grf>;
  82. pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&phy_int>;
  83. pinctrl-names = "default";
  84. phy = <&phy0>;
  85. phy-mode = "rmii";
  86. phy-supply = <&vcc_rmii>;
  87. mdio {
  88. #address-cells = <1>;
  89. #size-cells = <0>;
  90. phy0: ethernet-phy@0 {
  91. reg = <1>;
  92. };
  93. };
  94. };