ar9341_tplink_tl-wr842n-v2.dts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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 "ar9341.dtsi"
  6. / {
  7. model = "TP-Link TL-WR842N/ND v2";
  8. compatible = "tplink,tl-wr842n-v2", "qca,ar9341";
  9. aliases {
  10. serial0 = &uart;
  11. led-boot = &system;
  12. led-failsafe = &system;
  13. led-running = &system;
  14. led-upgrade = &system;
  15. };
  16. keys {
  17. compatible = "gpio-keys-polled";
  18. poll-interval = <20>;
  19. reset {
  20. label = "Reset";
  21. linux,code = <KEY_RESTART>;
  22. gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
  23. debounce-interval = <60>;
  24. };
  25. rfkill {
  26. label = "WiFi";
  27. linux,code = <KEY_RFKILL>;
  28. gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
  29. debounce-interval = <60>;
  30. };
  31. };
  32. leds {
  33. compatible = "gpio-leds";
  34. system: power {
  35. label = "tp-link:green:power";
  36. gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
  37. default-state = "on";
  38. };
  39. wlan {
  40. label = "tp-link:green:wlan";
  41. gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
  42. linux,default-trigger = "phy0tpt";
  43. };
  44. qss {
  45. label = "tp-link:green:qss";
  46. gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
  47. };
  48. wan {
  49. label = "tp-link:green:wan";
  50. gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
  51. };
  52. lan1 {
  53. label = "tp-link:green:lan1";
  54. gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
  55. };
  56. lan2 {
  57. label = "tp-link:green:lan2";
  58. gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
  59. };
  60. lan3 {
  61. label = "tp-link:green:lan3";
  62. gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
  63. };
  64. lan4 {
  65. label = "tp-link:green:lan4";
  66. gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
  67. };
  68. usb {
  69. label = "tp-link:green:usb";
  70. gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
  71. trigger-sources = <&hub_port>;
  72. linux,default-trigger = "usbport";
  73. };
  74. };
  75. gpio-export {
  76. compatible = "gpio-export";
  77. gpio_usb_power {
  78. gpio-export,name = "tp-link:power:usb";
  79. gpio-export,output = <1>;
  80. gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
  81. };
  82. };
  83. };
  84. &ref {
  85. clock-frequency = <25000000>;
  86. };
  87. &uart {
  88. status = "okay";
  89. };
  90. &gpio {
  91. pinctrl-names = "default";
  92. pinctrl-0 = <&jtag_disable_pins &pmx_usb_power>;
  93. };
  94. &pinmux {
  95. pmx_usb_power: usb_power {
  96. pinctrl-single,bits = <0x4 0x0 0xff>;
  97. };
  98. };
  99. &spi {
  100. num-cs = <1>;
  101. status = "okay";
  102. flash@0 {
  103. compatible = "jedec,spi-nor";
  104. reg = <0>;
  105. spi-max-frequency = <25000000>;
  106. partitions {
  107. compatible = "fixed-partitions";
  108. #address-cells = <1>;
  109. #size-cells = <1>;
  110. uboot: partition@0 {
  111. label = "u-boot";
  112. reg = <0x000000 0x020000>;
  113. read-only;
  114. };
  115. partition@20000 {
  116. compatible = "tplink,firmware";
  117. label = "firmware";
  118. reg = <0x020000 0x7d0000>;
  119. };
  120. art: partition@7f0000 {
  121. label = "art";
  122. reg = <0x7f0000 0x010000>;
  123. read-only;
  124. };
  125. };
  126. };
  127. };
  128. &usb {
  129. #address-cells = <1>;
  130. #size-cells = <0>;
  131. status = "okay";
  132. hub_port: port@1 {
  133. reg = <1>;
  134. #trigger-source-cells = <0>;
  135. };
  136. };
  137. &usb_phy {
  138. status = "okay";
  139. };
  140. &eth0 {
  141. status = "okay";
  142. phy-handle = <&swphy0>;
  143. mtd-mac-address = <&uboot 0x1fc00>;
  144. mtd-mac-address-increment = <(-1)>;
  145. };
  146. &eth1 {
  147. status = "okay";
  148. phy-handle = <&swphy4>;
  149. mtd-mac-address = <&uboot 0x1fc00>;
  150. phy-mode = "gmii";
  151. pll-data = <0x06000000 0x00000101 0x00001616>;
  152. gmac-config {
  153. device = <&gmac>;
  154. switch-phy-swap = <1>;
  155. };
  156. };
  157. &wmac {
  158. status = "okay";
  159. mtd-cal-data = <&art 0x1000>;
  160. mtd-mac-address = <&uboot 0x1fc00>;
  161. };