mt7621_xiaomi_mi-router-cr660x.dtsi 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  2. #include "mt7621.dtsi"
  3. #include <dt-bindings/gpio/gpio.h>
  4. #include <dt-bindings/input/input.h>
  5. / {
  6. aliases {
  7. led-boot = &led_sys_yellow;
  8. led-failsafe = &led_sys_yellow;
  9. led-running = &led_sys_blue;
  10. led-upgrade = &led_sys_yellow;
  11. label-mac-device = &gmac0;
  12. };
  13. chosen {
  14. bootargs = "console=ttyS0,115200n8";
  15. };
  16. leds {
  17. compatible = "gpio-leds";
  18. led_sys_yellow: sys_yellow {
  19. label = "yellow:sys";
  20. gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
  21. };
  22. led_sys_blue: sys_blue {
  23. label = "blue:sys";
  24. gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
  25. };
  26. net_yellow {
  27. label = "yellow:net";
  28. gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
  29. };
  30. net_blue {
  31. label = "blue:net";
  32. gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
  33. };
  34. };
  35. keys {
  36. compatible = "gpio-keys";
  37. reset {
  38. label = "reset";
  39. gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
  40. linux,code = <KEY_RESTART>;
  41. };
  42. wps {
  43. label = "wps";
  44. gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
  45. linux,code = <KEY_WPS_BUTTON>;
  46. };
  47. };
  48. };
  49. &nand {
  50. status = "okay";
  51. partitions {
  52. compatible = "fixed-partitions";
  53. #address-cells = <1>;
  54. #size-cells = <1>;
  55. partition@0 {
  56. label = "Bootloader";
  57. reg = <0x0 0x80000>;
  58. read-only;
  59. };
  60. partition@80000 {
  61. label = "Nvram";
  62. reg = <0x80000 0x40000>;
  63. read-only;
  64. };
  65. partition@c0000 {
  66. label = "Bdata";
  67. reg = <0xc0000 0x40000>;
  68. read-only;
  69. };
  70. factory: partition@100000 {
  71. label = "Factory";
  72. reg = <0x100000 0x80000>;
  73. read-only;
  74. };
  75. partition@180000 {
  76. label = "crash";
  77. reg = <0x180000 0x40000>;
  78. read-only;
  79. };
  80. partition@1c0000 {
  81. label = "crash_log";
  82. reg = <0x1c0000 0x40000>;
  83. read-only;
  84. };
  85. /* "kernel" and "ubi" partition is the result of
  86. * squashing next consecutive stock partitions:
  87. * 1. firmware 0x0200000 - 0x2000000 (Stock firmware 0)
  88. * 2. firmware1 0x2000000 - 0x3e00000 (Stock firmware 1)
  89. * 3. overlay 0x3e00000 - 0x7000000 (Stock fw Ubi overlay)
  90. * 4. obr 0x7000000 - 0x8000000 (Unallocated?)
  91. */
  92. partition@200000 {
  93. label = "kernel";
  94. reg = <0x200000 0x400000>;
  95. };
  96. partition@600000 {
  97. label = "ubi";
  98. reg = <0x600000 0x7980000>;
  99. };
  100. /*
  101. * Leave 512 KiB for the bad block table
  102. */
  103. };
  104. };
  105. &pcie {
  106. status = "okay";
  107. };
  108. &pcie1 {
  109. wifi@0,0 {
  110. compatible = "mediatek,mt76";
  111. reg = <0x0000 0 0 0 0>;
  112. mediatek,mtd-eeprom = <&factory 0x0>;
  113. };
  114. };
  115. &gmac0 {
  116. nvmem-cells = <&macaddr_factory_3fff4>;
  117. nvmem-cell-names = "mac-address";
  118. };
  119. &switch0 {
  120. ports {
  121. port@0 {
  122. status = "okay";
  123. label = "lan1";
  124. };
  125. port@1 {
  126. status = "okay";
  127. label = "lan2";
  128. };
  129. port@2 {
  130. status = "okay";
  131. label = "lan3";
  132. };
  133. port@4 {
  134. status = "okay";
  135. label = "wan";
  136. nvmem-cells = <&macaddr_factory_3fffa>;
  137. nvmem-cell-names = "mac-address";
  138. };
  139. };
  140. };
  141. &state_default {
  142. gpio {
  143. groups = "jtag", "uart3", "wdt";
  144. function = "gpio";
  145. };
  146. };
  147. &factory {
  148. compatible = "nvmem-cells";
  149. #address-cells = <1>;
  150. #size-cells = <1>;
  151. macaddr_factory_3fff4: macaddr@3fff4 {
  152. reg = <0x3fff4 0x6>;
  153. };
  154. macaddr_factory_3fffa: macaddr@3fffa {
  155. reg = <0x3fffa 0x6>;
  156. };
  157. };