mt7981a-glinet-gl-x3000-xe3000-common.dtsi 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  2. /dts-v1/;
  3. #include "mt7981.dtsi"
  4. / {
  5. chosen {
  6. bootargs = "console=ttyS0,115200n8 root=PARTLABEL=rootfs rootwait";
  7. };
  8. aliases {
  9. label-mac-device = &gmac0;
  10. led-boot = &led_power;
  11. led-failsafe = &led_power;
  12. led-running = &led_power;
  13. led-upgrade = &led_power;
  14. };
  15. reg_5v: regulator-5v {
  16. compatible = "regulator-fixed";
  17. regulator-name = "fixed-5V";
  18. regulator-min-microvolt = <5000000>;
  19. regulator-max-microvolt = <5000000>;
  20. regulator-boot-on;
  21. regulator-always-on;
  22. };
  23. fan_5v: regulator-fan-5v {
  24. compatible = "regulator-fixed";
  25. regulator-name = "fan";
  26. regulator-min-microvolt = <5000000>;
  27. regulator-max-microvolt = <5000000>;
  28. gpio = <&pio 28 GPIO_ACTIVE_HIGH>;
  29. enable-active-high;
  30. };
  31. gpio-keys {
  32. compatible = "gpio-keys";
  33. reset {
  34. label = "reset";
  35. linux,code = <KEY_RESTART>;
  36. gpios = <&pio 1 GPIO_ACTIVE_LOW>;
  37. };
  38. };
  39. gpio-export {
  40. compatible = "gpio-export";
  41. hub_power {
  42. gpio-export,name = "hub_power";
  43. gpio-export,output = <1>;
  44. gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
  45. };
  46. 5G_power {
  47. gpio-export,name = "5G_power";
  48. gpio-export,output = <1>;
  49. gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
  50. };
  51. 5G_control {
  52. gpio-export,name = "5G_control";
  53. gpio-export,output = <1>;
  54. gpios = <&pio 9 GPIO_ACTIVE_HIGH>;
  55. };
  56. 5G_reset {
  57. gpio-export,name = "5G_reset";
  58. gpio-export,output = <0>;
  59. gpios = <&pio 10 GPIO_ACTIVE_HIGH>;
  60. };
  61. };
  62. leds {
  63. compatible = "gpio-leds";
  64. wifi2g {
  65. label = "green:wifi2g";
  66. gpios = <&pio 30 GPIO_ACTIVE_LOW>;
  67. };
  68. wifi5g {
  69. label = "green:wifi5g";
  70. gpios = <&pio 38 GPIO_ACTIVE_LOW>;
  71. };
  72. 5g_led1 {
  73. label = "green:5g:led1";
  74. gpios = <&pio 6 GPIO_ACTIVE_LOW>;
  75. };
  76. 5g_led2 {
  77. label = "green:5g:led2";
  78. gpios = <&pio 7 GPIO_ACTIVE_LOW>;
  79. };
  80. 5g_led3 {
  81. label = "green:5g:led3";
  82. gpios = <&pio 8 GPIO_ACTIVE_LOW>;
  83. };
  84. 5g_led4 {
  85. label = "green:5g:led4";
  86. gpios = <&pio 4 GPIO_ACTIVE_HIGH>;
  87. };
  88. led_power: power {
  89. label = "green:power";
  90. gpios = <&pio 39 GPIO_ACTIVE_LOW>;
  91. };
  92. wan {
  93. label = "green:wan";
  94. gpios = <&pio 31 GPIO_ACTIVE_LOW>;
  95. };
  96. };
  97. };
  98. &uart0 {
  99. status = "okay";
  100. };
  101. &watchdog {
  102. status = "okay";
  103. };
  104. &mmc0 {
  105. pinctrl-names = "default", "state_uhs";
  106. pinctrl-0 = <&mmc0_pins_default>;
  107. pinctrl-1 = <&mmc0_pins_uhs>;
  108. bus-width = <8>;
  109. max-frequency = <52000000>;
  110. cap-mmc-highspeed;
  111. vmmc-supply = <&reg_3p3v>;
  112. non-removable;
  113. status = "okay";
  114. card@0 {
  115. compatible = "mmc-card";
  116. reg = <0>;
  117. block {
  118. compatible = "block-device";
  119. partitions {
  120. block-partition-env {
  121. partname = "u-boot-env";
  122. nvmem-layout {
  123. compatible = "u-boot,env-layout";
  124. };
  125. };
  126. block-partition-factory {
  127. partname = "factory";
  128. nvmem-layout {
  129. compatible = "fixed-layout";
  130. #address-cells = <1>;
  131. #size-cells = <1>;
  132. eeprom_factory_0: eeprom@0 {
  133. reg = <0x0 0x1000>;
  134. };
  135. macaddr_factory_a: macaddr@a {
  136. compatible = "mac-base";
  137. reg = <0xa 0x6>;
  138. #nvmem-cell-cells = <1>;
  139. };
  140. };
  141. };
  142. };
  143. };
  144. };
  145. };
  146. &mdio_bus {
  147. reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>;
  148. reset-delay-us = <600>;
  149. reset-post-delay-us = <20000>;
  150. phy5: ethernet-phy@5 {
  151. reg = <5>;
  152. compatible = "ethernet-phy-ieee802.3-c45";
  153. };
  154. };
  155. &eth {
  156. status = "okay";
  157. gmac0: mac@0 {
  158. compatible = "mediatek,eth-mac";
  159. reg = <0>;
  160. phy-mode = "2500base-x";
  161. phy-handle = <&phy5>;
  162. nvmem-cells = <&macaddr_factory_a 0>;
  163. nvmem-cell-names = "mac-address";
  164. };
  165. gmac1: mac@1 {
  166. compatible = "mediatek,eth-mac";
  167. reg = <1>;
  168. phy-mode = "gmii";
  169. phy-handle = <&int_gbe_phy>;
  170. nvmem-cells = <&macaddr_factory_a 1>;
  171. nvmem-cell-names = "mac-address";
  172. };
  173. };
  174. &pio {
  175. mmc0_pins_default: mmc0-pins-default {
  176. mux {
  177. function = "flash";
  178. groups = "emmc_8";
  179. };
  180. };
  181. mmc0_pins_uhs: mmc0-pins-uhs {
  182. mux {
  183. function = "flash";
  184. groups = "emmc_8";
  185. };
  186. };
  187. pcie_pins: pcie-pins {
  188. mux {
  189. function = "pcie";
  190. groups = "pcie_pereset", "pcie_clk", "pcie_wake";
  191. };
  192. };
  193. pwm0_pin: pwm0-pin-g0 {
  194. mux {
  195. function = "pwm";
  196. groups = "pwm0_1";
  197. };
  198. };
  199. };
  200. &xhci {
  201. phys = <&u2port0 PHY_TYPE_USB2>;
  202. vbus-supply = <&reg_5v>;
  203. mediatek,u3p-dis-msk = <0x01>;
  204. status = "okay";
  205. };
  206. &usb_phy {
  207. status = "okay";
  208. };
  209. &pcie {
  210. pinctrl-names = "default";
  211. pinctrl-0 = <&pcie_pins>;
  212. status = "okay";
  213. };
  214. &pwm {
  215. pinctrl-names = "default";
  216. pinctrl-0 = <&pwm0_pin>;
  217. };
  218. &wifi {
  219. nvmem-cells = <&eeprom_factory_0>;
  220. nvmem-cell-names = "eeprom";
  221. status = "okay";
  222. };
  223. &fan {
  224. pwms = <&pwm 0 40000 0>;
  225. fan-supply = <&fan_5v>;
  226. interrupt-parent = <&pio>;
  227. interrupts = <29 IRQ_TYPE_EDGE_RISING>;
  228. status = "okay";
  229. };