mt7981b-openembed-som7981.dts 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  2. /dts-v1/;
  3. #include <dt-bindings/gpio/gpio.h>
  4. #include <dt-bindings/input/input.h>
  5. #include <dt-bindings/leds/common.h>
  6. #include "mt7981.dtsi"
  7. / {
  8. model = "OpenEmbed SOM7981";
  9. compatible = "openembed,som7981", "mediatek,mt7981";
  10. aliases {
  11. led-boot = &wlan2g_led;
  12. led-failsafe = &wlan2g_led;
  13. led-upgrade = &wlan2g_led;
  14. serial0 = &uart0;
  15. };
  16. chosen {
  17. stdout-path = "serial0:115200n8";
  18. };
  19. memory@40000000 {
  20. reg = <0 0x40000000 0 0x40000000>;
  21. };
  22. gpio-keys {
  23. compatible = "gpio-keys";
  24. button-reset {
  25. label = "reset";
  26. linux,code = <KEY_RESTART>;
  27. gpios = <&pio 1 GPIO_ACTIVE_LOW>;
  28. };
  29. button-wps {
  30. label = "wps";
  31. linux,code = <KEY_WPS_BUTTON>;
  32. gpios = <&pio 0 GPIO_ACTIVE_LOW>;
  33. };
  34. };
  35. gpio-leds {
  36. compatible = "gpio-leds";
  37. led-0 {
  38. function = LED_FUNCTION_LAN;
  39. color = <LED_COLOR_ID_AMBER>;
  40. gpios = <&pio 8 GPIO_ACTIVE_LOW>;
  41. };
  42. led-1 {
  43. function = LED_FUNCTION_LAN;
  44. color = <LED_COLOR_ID_GREEN>;
  45. gpios = <&pio 13 GPIO_ACTIVE_LOW>;
  46. };
  47. wlan2g_led: led-2 {
  48. function = LED_FUNCTION_WLAN_2GHZ;
  49. color = <LED_COLOR_ID_RED>;
  50. gpios = <&pio 34 GPIO_ACTIVE_LOW>;
  51. linux,default-trigger = "phy0tpt";
  52. };
  53. led-3 {
  54. function = LED_FUNCTION_WLAN_5GHZ;
  55. color = <LED_COLOR_ID_RED>;
  56. gpios = <&pio 35 GPIO_ACTIVE_LOW>;
  57. linux,default-trigger = "phy1tpt";
  58. };
  59. };
  60. };
  61. &eth {
  62. pinctrl-names = "default";
  63. pinctrl-0 = <&mdio_pins>;
  64. status = "okay";
  65. gmac0: mac@0 {
  66. compatible = "mediatek,eth-mac";
  67. reg = <0>;
  68. phy-mode = "2500base-x";
  69. phy-handle = <&phy0>;
  70. nvmem-cells = <&macaddr_factory_a 0>;
  71. nvmem-cell-names = "mac-address";
  72. };
  73. gmac1: mac@1 {
  74. compatible = "mediatek,eth-mac";
  75. reg = <1>;
  76. phy-mode = "gmii";
  77. phy-handle = <&int_gbe_phy>;
  78. nvmem-cells = <&macaddr_factory_a 1>;
  79. nvmem-cell-names = "mac-address";
  80. };
  81. };
  82. &mdio_bus {
  83. phy0: ethernet-phy@5 {
  84. reg = <5>;
  85. compatible = "ethernet-phy-ieee802.3-c45";
  86. phy-mode = "2500base-x";
  87. reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>;
  88. reset-assert-us = <10000>;
  89. reset-deassert-us = <50000>;
  90. realtek,aldps-enable;
  91. };
  92. };
  93. &spi0 {
  94. pinctrl-names = "default";
  95. pinctrl-0 = <&spi0_flash_pins>;
  96. status = "okay";
  97. spi_nand: flash@0 {
  98. compatible = "spi-nand";
  99. #address-cells = <1>;
  100. #size-cells = <1>;
  101. reg = <0>;
  102. spi-max-frequency = <52000000>;
  103. spi-tx-bus-width = <4>;
  104. spi-rx-bus-width = <4>;
  105. partitions {
  106. compatible = "fixed-partitions";
  107. #address-cells = <1>;
  108. #size-cells = <1>;
  109. partition@0 {
  110. label = "bl2";
  111. reg = <0x000000 0x100000>;
  112. read-only;
  113. };
  114. partition@100000 {
  115. label = "u-boot-env";
  116. reg = <0x100000 0x80000>;
  117. };
  118. partition@180000 {
  119. compatible = "nvmem-cells";
  120. label = "factory";
  121. reg = <0x180000 0x100000>;
  122. read-only;
  123. nvmem-layout {
  124. compatible = "fixed-layout";
  125. #address-cells = <1>;
  126. #size-cells = <1>;
  127. eeprom_factory_0: eeprom@0 {
  128. reg = <0x0 0x1000>;
  129. };
  130. macaddr_factory_a: macaddr@a {
  131. compatible = "mac-base";
  132. reg = <0xa 0x6>;
  133. #nvmem-cell-cells = <1>;
  134. };
  135. };
  136. };
  137. partition@280000 {
  138. label = "config";
  139. reg = <0x280000 0x100000>;
  140. read-only;
  141. };
  142. partition@380000 {
  143. label = "fip";
  144. reg = <0x380000 0x200000>;
  145. read-only;
  146. };
  147. partition@580000 {
  148. label = "ubi";
  149. reg = <0x580000 0xf880000>;
  150. };
  151. };
  152. };
  153. };
  154. &pio {
  155. spi0_flash_pins: spi0-pins {
  156. mux {
  157. function = "spi";
  158. groups = "spi0", "spi0_wp_hold";
  159. };
  160. conf-pu {
  161. pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
  162. drive-strength = <8>;
  163. mediatek,pull-up-adv = <0>;
  164. };
  165. conf-pd {
  166. pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
  167. drive-strength = <8>;
  168. mediatek,pull-down-adv = <0>;
  169. };
  170. };
  171. };
  172. &uart0 {
  173. status = "okay";
  174. };
  175. &usb_phy {
  176. status = "okay";
  177. };
  178. &watchdog {
  179. status = "okay";
  180. };
  181. &wifi {
  182. nvmem-cells = <&eeprom_factory_0>;
  183. nvmem-cell-names = "eeprom";
  184. status = "okay";
  185. };
  186. &xhci {
  187. status = "okay";
  188. };