mt7981b-glinet-gl-mt3000.dts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /dts-v1/;
  2. #include "mt7981.dtsi"
  3. / {
  4. model = "GL.iNet GL-MT3000";
  5. compatible = "glinet,gl-mt3000", "mediatek,mt7981";
  6. aliases {
  7. label-mac-device = &gmac0;
  8. led-boot = &led_lightblue;
  9. led-failsafe = &led_lightblue;
  10. led-running = &led_white;
  11. led-upgrade = &led_lightblue;
  12. serial0 = &uart0;
  13. };
  14. chosen {
  15. stdout-path = "serial0:115200n8";
  16. };
  17. gpio-keys {
  18. compatible = "gpio-keys";
  19. reset {
  20. label = "reset";
  21. linux,code = <KEY_RESTART>;
  22. gpios = <&pio 1 GPIO_ACTIVE_LOW>;
  23. };
  24. mode {
  25. label = "mode";
  26. linux,input-type = <EV_SW>;
  27. linux,code = <BTN_0>;
  28. gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
  29. debounce-interval = <60>;
  30. };
  31. };
  32. leds {
  33. compatible = "gpio-leds";
  34. led_lightblue: led@0 {
  35. label = "blue:run";
  36. gpios = <&pio 31 GPIO_ACTIVE_LOW>;
  37. };
  38. led_white: led@1 {
  39. label = "white:system";
  40. gpios = <&pio 30 GPIO_ACTIVE_LOW>;
  41. };
  42. };
  43. fan_5v: regulator-fan-5v {
  44. compatible = "regulator-fixed";
  45. regulator-name = "fan";
  46. regulator-min-microvolt = <5000000>;
  47. regulator-max-microvolt = <5000000>;
  48. gpio = <&pio 28 GPIO_ACTIVE_HIGH>;
  49. enable-active-high;
  50. regulator-boot-on;
  51. };
  52. usb_vbus: regulator-usb-vbus {
  53. compatible = "regulator-fixed";
  54. regulator-name = "usb_vbus";
  55. regulator-min-microvolt = <5000000>;
  56. regulator-max-microvolt = <5000000>;
  57. gpio = <&pio 12 GPIO_ACTIVE_HIGH>;
  58. enable-active-high;
  59. regulator-boot-on;
  60. };
  61. };
  62. &uart0 {
  63. status = "okay";
  64. };
  65. &watchdog {
  66. status = "okay";
  67. };
  68. &eth {
  69. pinctrl-names = "default";
  70. pinctrl-0 = <&mdio_pins>;
  71. status = "okay";
  72. gmac0: mac@0 {
  73. compatible = "mediatek,eth-mac";
  74. reg = <0>;
  75. phy-mode = "2500base-x";
  76. phy-handle = <&phy0>;
  77. nvmem-cells = <&macaddr>;
  78. nvmem-cell-names = "mac-address";
  79. };
  80. gmac1: mac@1 {
  81. compatible = "mediatek,eth-mac";
  82. reg = <1>;
  83. phy-mode = "gmii";
  84. phy-handle = <&int_gbe_phy>;
  85. nvmem-cells = <&macaddr>;
  86. nvmem-cell-names = "mac-address";
  87. mac-address-increment = <1>;
  88. };
  89. };
  90. &mdio_bus {
  91. reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>;
  92. reset-delay-us = <600>;
  93. reset-post-delay-us = <20000>;
  94. phy0: ethernet-phy@5 {
  95. reg = <5>;
  96. compatible = "ethernet-phy-ieee802.3-c45";
  97. phy-mode = "2500base-x";
  98. };
  99. };
  100. &pwm {
  101. pinctrl-names = "default";
  102. pinctrl-0 = <&pwm_pins>;
  103. status = "okay";
  104. };
  105. &fan {
  106. pwms = <&pwm 0 40000 0>;
  107. fan-supply = <&fan_5v>;
  108. interrupt-parent = <&pio>;
  109. interrupts = <29 IRQ_TYPE_EDGE_RISING>;
  110. status = "okay";
  111. };
  112. &spi0 {
  113. pinctrl-names = "default";
  114. pinctrl-0 = <&spi0_flash_pins>;
  115. status = "okay";
  116. spi_nand: flash@0 {
  117. #address-cells = <1>;
  118. #size-cells = <1>;
  119. compatible = "spi-nand";
  120. reg = <0>;
  121. spi-max-frequency = <52000000>;
  122. spi-cal-enable;
  123. spi-cal-mode = "read-data";
  124. spi-cal-datalen = <7>;
  125. spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>;
  126. spi-cal-addrlen = <5>;
  127. spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
  128. spi-tx-bus-width = <4>;
  129. spi-rx-bus-width = <4>;
  130. mediatek,nmbm;
  131. mediatek,bmt-max-ratio = <1>;
  132. mediatek,bmt-max-reserved-blocks = <64>;
  133. partitions {
  134. compatible = "fixed-partitions";
  135. #address-cells = <1>;
  136. #size-cells = <1>;
  137. partition@0 {
  138. label = "BL2";
  139. reg = <0x00000 0x0100000>;
  140. read-only;
  141. };
  142. partition@100000 {
  143. label = "u-boot-env";
  144. reg = <0x0100000 0x0080000>;
  145. };
  146. factory: partition@180000 {
  147. label = "Factory";
  148. reg = <0x180000 0x0200000>;
  149. read-only;
  150. nvmem-layout {
  151. compatible = "fixed-layout";
  152. #address-cells = <1>;
  153. #size-cells = <1>;
  154. macaddr: macaddr@a {
  155. reg = <0xa 0x6>;
  156. };
  157. };
  158. };
  159. partition@380000 {
  160. label = "FIP";
  161. reg = <0x380000 0x0200000>;
  162. read-only;
  163. };
  164. partition@580000 {
  165. label = "log";
  166. reg = <0x580000 0x0040000>;
  167. };
  168. partition@5c0000 {
  169. label = "ubi";
  170. reg = <0x5c0000 0xf640000>;
  171. compatible = "linux,ubi";
  172. };
  173. };
  174. };
  175. };
  176. &pio {
  177. spi0_flash_pins: spi0-pins {
  178. mux {
  179. function = "spi";
  180. groups = "spi0", "spi0_wp_hold";
  181. };
  182. };
  183. pwm_pins: pwm0-pins {
  184. mux {
  185. function = "pwm";
  186. groups = "pwm0_1";
  187. };
  188. };
  189. };
  190. &usb_phy {
  191. status = "okay";
  192. };
  193. &xhci {
  194. vbus-supply = <&usb_vbus>;
  195. status = "okay";
  196. };
  197. &wifi {
  198. mediatek,mtd-eeprom = <&factory 0x0>;
  199. status = "okay";
  200. };