mediatek,net.yaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/net/mediatek,net.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: MediaTek Frame Engine Ethernet controller
  7. maintainers:
  8. - Lorenzo Bianconi <lorenzo@kernel.org>
  9. - Felix Fietkau <nbd@nbd.name>
  10. description:
  11. The frame engine ethernet controller can be found on MediaTek SoCs. These SoCs
  12. have dual GMAC ports.
  13. properties:
  14. compatible:
  15. enum:
  16. - mediatek,mt2701-eth
  17. - mediatek,mt7623-eth
  18. - mediatek,mt7621-eth
  19. - mediatek,mt7622-eth
  20. - mediatek,mt7629-eth
  21. - mediatek,mt7981-eth
  22. - mediatek,mt7986-eth
  23. - mediatek,mt7988-eth
  24. - ralink,rt5350-eth
  25. reg:
  26. maxItems: 1
  27. clocks:
  28. minItems: 2
  29. maxItems: 24
  30. clock-names:
  31. minItems: 2
  32. maxItems: 24
  33. interrupts:
  34. minItems: 1
  35. maxItems: 8
  36. interrupt-names:
  37. minItems: 1
  38. items:
  39. - const: fe0
  40. - const: fe1
  41. - const: fe2
  42. - const: fe3
  43. - const: pdma0
  44. - const: pdma1
  45. - const: pdma2
  46. - const: pdma3
  47. power-domains:
  48. maxItems: 1
  49. resets:
  50. maxItems: 3
  51. reset-names:
  52. items:
  53. - const: fe
  54. - const: gmac
  55. - const: ppe
  56. sram:
  57. $ref: /schemas/types.yaml#/definitions/phandle
  58. description: phandle to mmio SRAM
  59. mediatek,ethsys:
  60. $ref: /schemas/types.yaml#/definitions/phandle
  61. description:
  62. Phandle to the syscon node that handles the port setup.
  63. cci-control-port: true
  64. mediatek,hifsys:
  65. $ref: /schemas/types.yaml#/definitions/phandle
  66. description:
  67. Phandle to the mediatek hifsys controller used to provide various clocks
  68. and reset to the system.
  69. mediatek,infracfg:
  70. $ref: /schemas/types.yaml#/definitions/phandle
  71. description:
  72. Phandle to the syscon node that handles the path from GMAC to
  73. PHY variants.
  74. mediatek,pcie-mirror:
  75. $ref: /schemas/types.yaml#/definitions/phandle
  76. description:
  77. Phandle to the mediatek pcie-mirror controller.
  78. mediatek,pctl:
  79. $ref: /schemas/types.yaml#/definitions/phandle
  80. description:
  81. Phandle to the syscon node that handles the ports slew rate and
  82. driver current.
  83. mediatek,sgmiisys:
  84. $ref: /schemas/types.yaml#/definitions/phandle-array
  85. minItems: 1
  86. maxItems: 2
  87. items:
  88. maxItems: 1
  89. description:
  90. A list of phandle to the syscon node that handles the SGMII setup which is required for
  91. those SoCs equipped with SGMII.
  92. mediatek,wed:
  93. $ref: /schemas/types.yaml#/definitions/phandle-array
  94. minItems: 1
  95. maxItems: 2
  96. items:
  97. maxItems: 1
  98. description:
  99. List of phandles to wireless ethernet dispatch nodes.
  100. mediatek,wed-pcie:
  101. $ref: /schemas/types.yaml#/definitions/phandle
  102. description:
  103. Phandle to the mediatek wed-pcie controller.
  104. dma-coherent: true
  105. mdio-bus:
  106. $ref: mdio.yaml#
  107. unevaluatedProperties: false
  108. "#address-cells":
  109. const: 1
  110. "#size-cells":
  111. const: 0
  112. allOf:
  113. - $ref: ethernet-controller.yaml#
  114. - if:
  115. properties:
  116. compatible:
  117. contains:
  118. enum:
  119. - mediatek,mt2701-eth
  120. - mediatek,mt7623-eth
  121. then:
  122. properties:
  123. interrupts:
  124. minItems: 3
  125. maxItems: 3
  126. interrupt-names:
  127. minItems: 3
  128. maxItems: 3
  129. clocks:
  130. minItems: 4
  131. maxItems: 4
  132. clock-names:
  133. items:
  134. - const: ethif
  135. - const: esw
  136. - const: gp1
  137. - const: gp2
  138. sram: false
  139. mediatek,infracfg: false
  140. mediatek,wed: false
  141. mediatek,wed-pcie: false
  142. else:
  143. properties:
  144. mediatek,pctl: false
  145. - if:
  146. properties:
  147. compatible:
  148. contains:
  149. enum:
  150. - mediatek,mt7621-eth
  151. then:
  152. properties:
  153. interrupts:
  154. maxItems: 1
  155. interrupt-names:
  156. maxItems: 1
  157. clocks:
  158. minItems: 2
  159. maxItems: 2
  160. clock-names:
  161. items:
  162. - const: ethif
  163. - const: fe
  164. sram: false
  165. mediatek,infracfg: false
  166. mediatek,wed: false
  167. mediatek,wed-pcie: false
  168. - if:
  169. properties:
  170. compatible:
  171. contains:
  172. const: mediatek,mt7622-eth
  173. then:
  174. properties:
  175. interrupts:
  176. minItems: 3
  177. maxItems: 3
  178. interrupt-names:
  179. minItems: 3
  180. maxItems: 3
  181. clocks:
  182. minItems: 11
  183. maxItems: 11
  184. clock-names:
  185. items:
  186. - const: ethif
  187. - const: esw
  188. - const: gp0
  189. - const: gp1
  190. - const: gp2
  191. - const: sgmii_tx250m
  192. - const: sgmii_rx250m
  193. - const: sgmii_cdr_ref
  194. - const: sgmii_cdr_fb
  195. - const: sgmii_ck
  196. - const: eth2pll
  197. sram: false
  198. mediatek,infracfg: false
  199. mediatek,sgmiisys:
  200. minItems: 1
  201. maxItems: 1
  202. mediatek,wed:
  203. minItems: 2
  204. mediatek,wed-pcie: false
  205. else:
  206. properties:
  207. mediatek,pcie-mirror: false
  208. - if:
  209. properties:
  210. compatible:
  211. contains:
  212. const: mediatek,mt7629-eth
  213. then:
  214. properties:
  215. interrupts:
  216. minItems: 3
  217. maxItems: 3
  218. interrupt-names:
  219. minItems: 3
  220. maxItems: 3
  221. clocks:
  222. minItems: 17
  223. maxItems: 17
  224. clock-names:
  225. items:
  226. - const: ethif
  227. - const: sgmiitop
  228. - const: esw
  229. - const: gp0
  230. - const: gp1
  231. - const: gp2
  232. - const: fe
  233. - const: sgmii_tx250m
  234. - const: sgmii_rx250m
  235. - const: sgmii_cdr_ref
  236. - const: sgmii_cdr_fb
  237. - const: sgmii2_tx250m
  238. - const: sgmii2_rx250m
  239. - const: sgmii2_cdr_ref
  240. - const: sgmii2_cdr_fb
  241. - const: sgmii_ck
  242. - const: eth2pll
  243. sram: false
  244. mediatek,sgmiisys:
  245. minItems: 2
  246. maxItems: 2
  247. mediatek,wed: false
  248. mediatek,wed-pcie: false
  249. - if:
  250. properties:
  251. compatible:
  252. contains:
  253. const: mediatek,mt7981-eth
  254. then:
  255. properties:
  256. interrupts:
  257. minItems: 8
  258. interrupt-names:
  259. minItems: 8
  260. clocks:
  261. minItems: 15
  262. maxItems: 15
  263. clock-names:
  264. items:
  265. - const: fe
  266. - const: gp2
  267. - const: gp1
  268. - const: wocpu0
  269. - const: sgmii_ck
  270. - const: sgmii_tx250m
  271. - const: sgmii_rx250m
  272. - const: sgmii_cdr_ref
  273. - const: sgmii_cdr_fb
  274. - const: sgmii2_tx250m
  275. - const: sgmii2_rx250m
  276. - const: sgmii2_cdr_ref
  277. - const: sgmii2_cdr_fb
  278. - const: netsys0
  279. - const: netsys1
  280. mediatek,sgmiisys:
  281. minItems: 2
  282. maxItems: 2
  283. mediatek,wed:
  284. maxItems: 1
  285. - if:
  286. properties:
  287. compatible:
  288. contains:
  289. const: mediatek,mt7986-eth
  290. then:
  291. properties:
  292. interrupts:
  293. minItems: 8
  294. interrupt-names:
  295. minItems: 8
  296. clocks:
  297. minItems: 15
  298. maxItems: 15
  299. clock-names:
  300. items:
  301. - const: fe
  302. - const: gp2
  303. - const: gp1
  304. - const: wocpu1
  305. - const: wocpu0
  306. - const: sgmii_tx250m
  307. - const: sgmii_rx250m
  308. - const: sgmii_cdr_ref
  309. - const: sgmii_cdr_fb
  310. - const: sgmii2_tx250m
  311. - const: sgmii2_rx250m
  312. - const: sgmii2_cdr_ref
  313. - const: sgmii2_cdr_fb
  314. - const: netsys0
  315. - const: netsys1
  316. mediatek,infracfg: false
  317. mediatek,sgmiisys:
  318. minItems: 2
  319. maxItems: 2
  320. mediatek,wed:
  321. minItems: 2
  322. - if:
  323. properties:
  324. compatible:
  325. contains:
  326. const: mediatek,mt7988-eth
  327. then:
  328. properties:
  329. interrupts:
  330. minItems: 8
  331. interrupt-names:
  332. minItems: 8
  333. clocks:
  334. minItems: 24
  335. maxItems: 24
  336. clock-names:
  337. items:
  338. - const: crypto
  339. - const: fe
  340. - const: gp2
  341. - const: gp1
  342. - const: gp3
  343. - const: ethwarp_wocpu2
  344. - const: ethwarp_wocpu1
  345. - const: ethwarp_wocpu0
  346. - const: esw
  347. - const: top_eth_gmii_sel
  348. - const: top_eth_refck_50m_sel
  349. - const: top_eth_sys_200m_sel
  350. - const: top_eth_sys_sel
  351. - const: top_eth_xgmii_sel
  352. - const: top_eth_mii_sel
  353. - const: top_netsys_sel
  354. - const: top_netsys_500m_sel
  355. - const: top_netsys_pao_2x_sel
  356. - const: top_netsys_sync_250m_sel
  357. - const: top_netsys_ppefb_250m_sel
  358. - const: top_netsys_warp_sel
  359. - const: xgp1
  360. - const: xgp2
  361. - const: xgp3
  362. mediatek,wed:
  363. minItems: 2
  364. - if:
  365. properties:
  366. compatible:
  367. contains:
  368. const: ralink,rt5350-eth
  369. then:
  370. properties:
  371. mediatek,wed:
  372. minItems: 2
  373. patternProperties:
  374. "^mac@[0-2]$":
  375. type: object
  376. unevaluatedProperties: false
  377. allOf:
  378. - $ref: ethernet-controller.yaml#
  379. description:
  380. Ethernet MAC node
  381. properties:
  382. compatible:
  383. const: mediatek,eth-mac
  384. reg:
  385. maxItems: 1
  386. required:
  387. - reg
  388. - compatible
  389. required:
  390. - compatible
  391. - reg
  392. - interrupts
  393. - clocks
  394. - clock-names
  395. - mediatek,ethsys
  396. unevaluatedProperties: false
  397. examples:
  398. - |
  399. #include <dt-bindings/interrupt-controller/arm-gic.h>
  400. #include <dt-bindings/interrupt-controller/irq.h>
  401. #include <dt-bindings/clock/mt7622-clk.h>
  402. #include <dt-bindings/power/mt7622-power.h>
  403. soc {
  404. #address-cells = <2>;
  405. #size-cells = <2>;
  406. ethernet: ethernet@1b100000 {
  407. compatible = "mediatek,mt7622-eth";
  408. reg = <0 0x1b100000 0 0x20000>;
  409. interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_LOW>,
  410. <GIC_SPI 224 IRQ_TYPE_LEVEL_LOW>,
  411. <GIC_SPI 225 IRQ_TYPE_LEVEL_LOW>;
  412. clocks = <&topckgen CLK_TOP_ETH_SEL>,
  413. <&ethsys CLK_ETH_ESW_EN>,
  414. <&ethsys CLK_ETH_GP0_EN>,
  415. <&ethsys CLK_ETH_GP1_EN>,
  416. <&ethsys CLK_ETH_GP2_EN>,
  417. <&sgmiisys CLK_SGMII_TX250M_EN>,
  418. <&sgmiisys CLK_SGMII_RX250M_EN>,
  419. <&sgmiisys CLK_SGMII_CDR_REF>,
  420. <&sgmiisys CLK_SGMII_CDR_FB>,
  421. <&topckgen CLK_TOP_SGMIIPLL>,
  422. <&apmixedsys CLK_APMIXED_ETH2PLL>;
  423. clock-names = "ethif", "esw", "gp0", "gp1", "gp2",
  424. "sgmii_tx250m", "sgmii_rx250m",
  425. "sgmii_cdr_ref", "sgmii_cdr_fb", "sgmii_ck",
  426. "eth2pll";
  427. power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
  428. mediatek,ethsys = <&ethsys>;
  429. mediatek,sgmiisys = <&sgmiisys>;
  430. cci-control-port = <&cci_control2>;
  431. mediatek,pcie-mirror = <&pcie_mirror>;
  432. mediatek,hifsys = <&hifsys>;
  433. dma-coherent;
  434. #address-cells = <1>;
  435. #size-cells = <0>;
  436. mdio0: mdio-bus {
  437. #address-cells = <1>;
  438. #size-cells = <0>;
  439. phy0: ethernet-phy@0 {
  440. reg = <0>;
  441. };
  442. phy1: ethernet-phy@1 {
  443. reg = <1>;
  444. };
  445. };
  446. gmac0: mac@0 {
  447. compatible = "mediatek,eth-mac";
  448. phy-mode = "rgmii";
  449. phy-handle = <&phy0>;
  450. reg = <0>;
  451. };
  452. gmac1: mac@1 {
  453. compatible = "mediatek,eth-mac";
  454. phy-mode = "rgmii";
  455. phy-handle = <&phy1>;
  456. reg = <1>;
  457. };
  458. };
  459. };
  460. - |
  461. #include <dt-bindings/interrupt-controller/arm-gic.h>
  462. #include <dt-bindings/interrupt-controller/irq.h>
  463. #include <dt-bindings/clock/mt7622-clk.h>
  464. soc {
  465. #address-cells = <2>;
  466. #size-cells = <2>;
  467. eth: ethernet@15100000 {
  468. #define CLK_ETH_FE_EN 0
  469. #define CLK_ETH_WOCPU1_EN 3
  470. #define CLK_ETH_WOCPU0_EN 4
  471. #define CLK_TOP_NETSYS_SEL 43
  472. #define CLK_TOP_NETSYS_500M_SEL 44
  473. #define CLK_TOP_NETSYS_2X_SEL 46
  474. #define CLK_TOP_SGM_325M_SEL 47
  475. #define CLK_APMIXED_NET2PLL 1
  476. #define CLK_APMIXED_SGMPLL 3
  477. compatible = "mediatek,mt7986-eth";
  478. reg = <0 0x15100000 0 0x80000>;
  479. interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>,
  480. <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>,
  481. <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
  482. <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>,
  483. <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>,
  484. <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>,
  485. <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>,
  486. <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
  487. clocks = <&ethsys CLK_ETH_FE_EN>,
  488. <&ethsys CLK_ETH_GP2_EN>,
  489. <&ethsys CLK_ETH_GP1_EN>,
  490. <&ethsys CLK_ETH_WOCPU1_EN>,
  491. <&ethsys CLK_ETH_WOCPU0_EN>,
  492. <&sgmiisys0 CLK_SGMII_TX250M_EN>,
  493. <&sgmiisys0 CLK_SGMII_RX250M_EN>,
  494. <&sgmiisys0 CLK_SGMII_CDR_REF>,
  495. <&sgmiisys0 CLK_SGMII_CDR_FB>,
  496. <&sgmiisys1 CLK_SGMII_TX250M_EN>,
  497. <&sgmiisys1 CLK_SGMII_RX250M_EN>,
  498. <&sgmiisys1 CLK_SGMII_CDR_REF>,
  499. <&sgmiisys1 CLK_SGMII_CDR_FB>,
  500. <&topckgen CLK_TOP_NETSYS_SEL>,
  501. <&topckgen CLK_TOP_NETSYS_SEL>;
  502. clock-names = "fe", "gp2", "gp1", "wocpu1", "wocpu0",
  503. "sgmii_tx250m", "sgmii_rx250m",
  504. "sgmii_cdr_ref", "sgmii_cdr_fb",
  505. "sgmii2_tx250m", "sgmii2_rx250m",
  506. "sgmii2_cdr_ref", "sgmii2_cdr_fb",
  507. "netsys0", "netsys1";
  508. mediatek,ethsys = <&ethsys>;
  509. mediatek,sgmiisys = <&sgmiisys0>, <&sgmiisys1>;
  510. assigned-clocks = <&topckgen CLK_TOP_NETSYS_2X_SEL>,
  511. <&topckgen CLK_TOP_SGM_325M_SEL>;
  512. assigned-clock-parents = <&apmixedsys CLK_APMIXED_NET2PLL>,
  513. <&apmixedsys CLK_APMIXED_SGMPLL>;
  514. #address-cells = <1>;
  515. #size-cells = <0>;
  516. mdio: mdio-bus {
  517. #address-cells = <1>;
  518. #size-cells = <0>;
  519. phy5: ethernet-phy@0 {
  520. compatible = "ethernet-phy-id67c9.de0a";
  521. phy-mode = "2500base-x";
  522. reset-gpios = <&pio 6 1>;
  523. reset-deassert-us = <20000>;
  524. reg = <5>;
  525. };
  526. phy6: ethernet-phy@1 {
  527. compatible = "ethernet-phy-id67c9.de0a";
  528. phy-mode = "2500base-x";
  529. reg = <6>;
  530. };
  531. };
  532. mac0: mac@0 {
  533. compatible = "mediatek,eth-mac";
  534. phy-mode = "2500base-x";
  535. phy-handle = <&phy5>;
  536. reg = <0>;
  537. };
  538. mac1: mac@1 {
  539. compatible = "mediatek,eth-mac";
  540. phy-mode = "2500base-x";
  541. phy-handle = <&phy6>;
  542. reg = <1>;
  543. };
  544. };
  545. };