qca8k.yaml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/net/dsa/qca8k.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Qualcomm Atheros QCA83xx switch family
  7. maintainers:
  8. - John Crispin <john@phrozen.org>
  9. description:
  10. If the QCA8K switch is connect to an SoC's external mdio-bus, each subnode
  11. describing a port needs to have a valid phandle referencing the internal PHY
  12. it is connected to. This is because there is no N:N mapping of port and PHY
  13. ID. To declare the internal mdio-bus configuration, declare an MDIO node in
  14. the switch node and declare the phandle for the port, referencing the internal
  15. PHY it is connected to. In this config, an internal mdio-bus is registered and
  16. the MDIO master is used for communication. Mixed external and internal
  17. mdio-bus configurations are not supported by the hardware.
  18. Each phy has at most 3 LEDs connected and can be declared
  19. using the standard LEDs structure.
  20. properties:
  21. compatible:
  22. oneOf:
  23. - enum:
  24. - qca,qca8327
  25. - qca,qca8328
  26. - qca,qca8334
  27. - qca,qca8337
  28. description: |
  29. qca,qca8328: referenced as AR8328(N)-AK1(A/B) QFN 176 pin package
  30. qca,qca8327: referenced as AR8327(N)-AL1A DR-QFN 148 pin package
  31. qca,qca8334: referenced as QCA8334-AL3C QFN 88 pin package
  32. qca,qca8337: referenced as QCA8337N-AL3(B/C) DR-QFN 148 pin package
  33. reg:
  34. maxItems: 1
  35. reset-gpios:
  36. description:
  37. GPIO to be used to reset the whole device
  38. maxItems: 1
  39. qca,ignore-power-on-sel:
  40. $ref: /schemas/types.yaml#/definitions/flag
  41. description:
  42. Ignore power-on pin strapping to configure LED open-drain or EEPROM
  43. presence. This is needed for devices with incorrect configuration or when
  44. the OEM has decided not to use pin strapping and falls back to SW regs.
  45. qca,led-open-drain:
  46. $ref: /schemas/types.yaml#/definitions/flag
  47. description:
  48. Set LEDs to open-drain mode. This requires the qca,ignore-power-on-sel to
  49. be set, otherwise the driver will fail at probe. This is required if the
  50. OEM does not use pin strapping to set this mode and prefers to set it
  51. using SW regs. The pin strappings related to LED open-drain mode are
  52. B68 on the QCA832x and B49 on the QCA833x.
  53. mdio:
  54. $ref: /schemas/net/mdio.yaml#
  55. unevaluatedProperties: false
  56. description: Qca8k switch have an internal mdio to access switch port.
  57. If this is not present, the legacy mapping is used and the
  58. internal mdio access is used.
  59. With the legacy mapping the reg corresponding to the internal
  60. mdio is the switch reg with an offset of -1.
  61. $ref: dsa.yaml#
  62. patternProperties:
  63. "^(ethernet-)?ports$":
  64. type: object
  65. additionalProperties: true
  66. patternProperties:
  67. "^(ethernet-)?port@[0-6]$":
  68. type: object
  69. description: Ethernet switch ports
  70. $ref: dsa-port.yaml#
  71. properties:
  72. qca,sgmii-rxclk-falling-edge:
  73. $ref: /schemas/types.yaml#/definitions/flag
  74. description:
  75. Set the receive clock phase to falling edge. Mostly commonly used on
  76. the QCA8327 with CPU port 0 set to SGMII.
  77. qca,sgmii-txclk-falling-edge:
  78. $ref: /schemas/types.yaml#/definitions/flag
  79. description:
  80. Set the transmit clock phase to falling edge.
  81. qca,sgmii-enable-pll:
  82. $ref: /schemas/types.yaml#/definitions/flag
  83. description:
  84. For SGMII CPU port, explicitly enable PLL, TX and RX chain along with
  85. Signal Detection. On the QCA8327 this should not be enabled, otherwise
  86. the SGMII port will not initialize. When used on the QCA8337, revision 3
  87. or greater, a warning will be displayed. When the CPU port is set to
  88. SGMII on the QCA8337, it is advised to set this unless a communication
  89. issue is observed.
  90. unevaluatedProperties: false
  91. oneOf:
  92. - required:
  93. - ports
  94. - required:
  95. - ethernet-ports
  96. required:
  97. - compatible
  98. - reg
  99. unevaluatedProperties: false
  100. examples:
  101. - |
  102. #include <dt-bindings/gpio/gpio.h>
  103. #include <dt-bindings/leds/common.h>
  104. mdio {
  105. #address-cells = <1>;
  106. #size-cells = <0>;
  107. external_phy_port1: ethernet-phy@0 {
  108. reg = <0>;
  109. };
  110. external_phy_port2: ethernet-phy@1 {
  111. reg = <1>;
  112. };
  113. external_phy_port3: ethernet-phy@2 {
  114. reg = <2>;
  115. };
  116. external_phy_port4: ethernet-phy@3 {
  117. reg = <3>;
  118. };
  119. external_phy_port5: ethernet-phy@4 {
  120. reg = <4>;
  121. };
  122. switch@10 {
  123. compatible = "qca,qca8337";
  124. reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
  125. reg = <0x10>;
  126. ports {
  127. #address-cells = <1>;
  128. #size-cells = <0>;
  129. port@0 {
  130. reg = <0>;
  131. ethernet = <&gmac1>;
  132. phy-mode = "rgmii";
  133. fixed-link {
  134. speed = <1000>;
  135. full-duplex;
  136. };
  137. };
  138. port@1 {
  139. reg = <1>;
  140. label = "lan1";
  141. phy-handle = <&external_phy_port1>;
  142. };
  143. port@2 {
  144. reg = <2>;
  145. label = "lan2";
  146. phy-handle = <&external_phy_port2>;
  147. };
  148. port@3 {
  149. reg = <3>;
  150. label = "lan3";
  151. phy-handle = <&external_phy_port3>;
  152. };
  153. port@4 {
  154. reg = <4>;
  155. label = "lan4";
  156. phy-handle = <&external_phy_port4>;
  157. };
  158. port@5 {
  159. reg = <5>;
  160. label = "wan";
  161. phy-handle = <&external_phy_port5>;
  162. };
  163. };
  164. };
  165. };
  166. - |
  167. #include <dt-bindings/gpio/gpio.h>
  168. mdio {
  169. #address-cells = <1>;
  170. #size-cells = <0>;
  171. switch@10 {
  172. compatible = "qca,qca8337";
  173. reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
  174. reg = <0x10>;
  175. ports {
  176. #address-cells = <1>;
  177. #size-cells = <0>;
  178. port@0 {
  179. reg = <0>;
  180. ethernet = <&gmac1>;
  181. phy-mode = "rgmii";
  182. fixed-link {
  183. speed = <1000>;
  184. full-duplex;
  185. };
  186. };
  187. port@1 {
  188. reg = <1>;
  189. label = "lan1";
  190. phy-mode = "internal";
  191. phy-handle = <&internal_phy_port1>;
  192. leds {
  193. #address-cells = <1>;
  194. #size-cells = <0>;
  195. led@0 {
  196. reg = <0>;
  197. color = <LED_COLOR_ID_WHITE>;
  198. function = LED_FUNCTION_LAN;
  199. default-state = "keep";
  200. };
  201. led@1 {
  202. reg = <1>;
  203. color = <LED_COLOR_ID_AMBER>;
  204. function = LED_FUNCTION_LAN;
  205. default-state = "keep";
  206. };
  207. };
  208. };
  209. port@2 {
  210. reg = <2>;
  211. label = "lan2";
  212. phy-mode = "internal";
  213. phy-handle = <&internal_phy_port2>;
  214. };
  215. port@3 {
  216. reg = <3>;
  217. label = "lan3";
  218. phy-mode = "internal";
  219. phy-handle = <&internal_phy_port3>;
  220. };
  221. port@4 {
  222. reg = <4>;
  223. label = "lan4";
  224. phy-mode = "internal";
  225. phy-handle = <&internal_phy_port4>;
  226. };
  227. port@5 {
  228. reg = <5>;
  229. label = "wan";
  230. phy-mode = "internal";
  231. phy-handle = <&internal_phy_port5>;
  232. };
  233. port@6 {
  234. reg = <0>;
  235. ethernet = <&gmac1>;
  236. phy-mode = "sgmii";
  237. qca,sgmii-rxclk-falling-edge;
  238. fixed-link {
  239. speed = <1000>;
  240. full-duplex;
  241. };
  242. };
  243. };
  244. mdio {
  245. #address-cells = <1>;
  246. #size-cells = <0>;
  247. internal_phy_port1: ethernet-phy@0 {
  248. reg = <0>;
  249. };
  250. internal_phy_port2: ethernet-phy@1 {
  251. reg = <1>;
  252. };
  253. internal_phy_port3: ethernet-phy@2 {
  254. reg = <2>;
  255. };
  256. internal_phy_port4: ethernet-phy@3 {
  257. reg = <3>;
  258. };
  259. internal_phy_port5: ethernet-phy@4 {
  260. reg = <4>;
  261. };
  262. };
  263. };
  264. };