mt7622-xiaomi-redmi-router-ax6s.dts 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  2. /dts-v1/;
  3. #include <dt-bindings/input/input.h>
  4. #include <dt-bindings/leds/common.h>
  5. #include <dt-bindings/gpio/gpio.h>
  6. #include "mt7622.dtsi"
  7. #include "mt6380.dtsi"
  8. / {
  9. model = "Xiaomi Redmi Router AX6S";
  10. compatible = "xiaomi,redmi-router-ax6s", "mediatek,mt7622";
  11. aliases {
  12. serial0 = &uart0;
  13. led-boot = &led_power_amber;
  14. led-failsafe = &led_power_amber;
  15. led-running = &led_power_blue;
  16. led-upgrade = &led_power_blue;
  17. };
  18. chosen {
  19. stdout-path = "serial0:115200n8";
  20. rootdisk = <&ubi_rootfs>;
  21. bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512 ubi.block=0,fit root=/dev/fit0";
  22. };
  23. memory {
  24. reg = <0 0x40000000 0 0x8000000>;
  25. };
  26. leds {
  27. compatible = "gpio-leds";
  28. led_power_blue: power_blue {
  29. function = LED_FUNCTION_POWER;
  30. color = <LED_COLOR_ID_BLUE>;
  31. gpios = <&pio 18 GPIO_ACTIVE_LOW>;
  32. };
  33. led_power_amber: power_amber {
  34. function = LED_FUNCTION_POWER;
  35. color = <LED_COLOR_ID_AMBER>;
  36. gpios = <&pio 17 GPIO_ACTIVE_LOW>;
  37. };
  38. led_net_blue: net_blue {
  39. label = "blue:net";
  40. gpios = <&pio 01 GPIO_ACTIVE_LOW>;
  41. };
  42. led_net_amber: net_amber {
  43. label = "amber:net";
  44. gpios = <&pio 16 GPIO_ACTIVE_LOW>;
  45. };
  46. };
  47. keys {
  48. compatible = "gpio-keys";
  49. reset {
  50. label = "reset";
  51. gpios = <&pio 0 GPIO_ACTIVE_LOW>;
  52. linux,code = <KEY_RESTART>;
  53. };
  54. mesh {
  55. label = "mesh";
  56. gpios = <&pio 102 GPIO_ACTIVE_LOW>;
  57. linux,code = <BTN_9>;
  58. linux,input-type = <EV_SW>;
  59. };
  60. };
  61. };
  62. &cpu0 {
  63. proc-supply = <&mt6380_vcpu_reg>;
  64. sram-supply = <&mt6380_vm_reg>;
  65. };
  66. &cpu1 {
  67. proc-supply = <&mt6380_vcpu_reg>;
  68. sram-supply = <&mt6380_vm_reg>;
  69. };
  70. &pio {
  71. eth_pins: eth-pins {
  72. mux {
  73. function = "eth";
  74. groups = "mdc_mdio", "rgmii_via_gmac2";
  75. };
  76. };
  77. pcie0_pins: pcie0-pins {
  78. mux {
  79. function = "pcie";
  80. groups = "pcie0_pad_perst",
  81. "pcie0_1_waken",
  82. "pcie0_1_clkreq";
  83. };
  84. };
  85. pmic_bus_pins: pmic-bus-pins {
  86. mux {
  87. function = "pmic";
  88. groups = "pmic_bus";
  89. };
  90. };
  91. pwm7_pins: pwm1-2-pins {
  92. mux {
  93. function = "pwm";
  94. groups = "pwm_ch7_2";
  95. };
  96. };
  97. /* Serial NAND is shared pin with SPI-NOR */
  98. serial_nand_pins: serial-nand-pins {
  99. mux {
  100. function = "flash";
  101. groups = "snfi";
  102. };
  103. };
  104. uart0_pins: uart0-pins {
  105. mux {
  106. function = "uart";
  107. groups = "uart0_0_tx_rx" ;
  108. };
  109. };
  110. watchdog_pins: watchdog-pins {
  111. mux {
  112. function = "watchdog";
  113. groups = "watchdog";
  114. };
  115. };
  116. };
  117. &eth {
  118. pinctrl-names = "default";
  119. pinctrl-0 = <&eth_pins>;
  120. status = "okay";
  121. gmac0: mac@0 {
  122. compatible = "mediatek,eth-mac";
  123. reg = <0>;
  124. phy-connection-type = "2500base-x";
  125. nvmem-cells = <&macaddr_factory_4 (-1)>;
  126. nvmem-cell-names = "mac-address";
  127. fixed-link {
  128. speed = <2500>;
  129. full-duplex;
  130. pause;
  131. };
  132. };
  133. mdio-bus {
  134. #address-cells = <1>;
  135. #size-cells = <0>;
  136. switch@0 {
  137. compatible = "mediatek,mt7531";
  138. reg = <0>;
  139. interrupt-controller;
  140. #interrupt-cells = <1>;
  141. interrupt-parent = <&pio>;
  142. interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
  143. reset-gpios = <&pio 54 GPIO_ACTIVE_HIGH>;
  144. ports {
  145. #address-cells = <1>;
  146. #size-cells = <0>;
  147. wan: port@1 {
  148. reg = <1>;
  149. label = "wan";
  150. };
  151. port@2 {
  152. reg = <2>;
  153. label = "lan1";
  154. };
  155. port@3 {
  156. reg = <3>;
  157. label = "lan2";
  158. };
  159. port@4 {
  160. reg = <4>;
  161. label = "lan3";
  162. };
  163. port@6 {
  164. reg = <6>;
  165. ethernet = <&gmac0>;
  166. phy-mode = "2500base-x";
  167. fixed-link {
  168. speed = <2500>;
  169. full-duplex;
  170. pause;
  171. };
  172. };
  173. };
  174. };
  175. };
  176. };
  177. &bch {
  178. status = "okay";
  179. };
  180. &snfi {
  181. pinctrl-names = "default";
  182. pinctrl-0 = <&serial_nand_pins>;
  183. status = "okay";
  184. flash@0 {
  185. compatible = "spi-nand";
  186. reg = <0>;
  187. spi-tx-bus-width = <4>;
  188. spi-rx-bus-width = <4>;
  189. nand-ecc-engine = <&snfi>;
  190. mediatek,bmt-v2;
  191. mediatek,bmt-table-size = <0x1000>;
  192. mediatek,bmt-remap-range = <0x0 0x340000>;
  193. partitions {
  194. compatible = "fixed-partitions";
  195. #address-cells = <1>;
  196. #size-cells = <1>;
  197. partition@0 {
  198. label = "Preloader";
  199. reg = <0x0 0x80000>;
  200. read-only;
  201. };
  202. partition@80000 {
  203. label = "ATF";
  204. reg = <0x80000 0x40000>;
  205. read-only;
  206. };
  207. partition@c0000 {
  208. label = "u-boot";
  209. reg = <0xc0000 0x80000>;
  210. read-only;
  211. };
  212. partition@140000 {
  213. label = "u-boot-env";
  214. reg = <0x140000 0x40000>;
  215. };
  216. partition@180000 {
  217. label = "bdata";
  218. reg = <0x180000 0x40000>;
  219. };
  220. factory: partition@1c0000 {
  221. label = "factory";
  222. reg = <0x1c0000 0x80000>;
  223. read-only;
  224. nvmem-layout {
  225. compatible = "fixed-layout";
  226. #address-cells = <1>;
  227. #size-cells = <1>;
  228. macaddr_factory_4: macaddr@4 {
  229. compatible = "mac-base";
  230. reg = <0x4 0x6>;
  231. #nvmem-cell-cells = <1>;
  232. };
  233. };
  234. };
  235. partition@240000 {
  236. label = "crash";
  237. reg = <0x240000 0x40000>;
  238. read-only;
  239. };
  240. partition@280000 {
  241. label = "crash_log";
  242. reg = <0x280000 0x40000>;
  243. read-only;
  244. };
  245. partition@2c0000 {
  246. label = "ubi-loader";
  247. reg = <0x2c0000 0x80000>;
  248. };
  249. /* ubi partition is the result of squashing
  250. * consecutive stock partitions:
  251. * - firmware (partially)
  252. * - firmware1
  253. * - overlay
  254. * - obr
  255. */
  256. partition@340000 {
  257. label = "ubi";
  258. reg = <0x340000 0x7280000>;
  259. compatible = "linux,ubi";
  260. volumes {
  261. ubi_rootfs: ubi-volume-fit {
  262. volname = "fit";
  263. };
  264. };
  265. };
  266. };
  267. };
  268. };
  269. &pcie0 {
  270. pinctrl-names = "default";
  271. pinctrl-0 = <&pcie0_pins>;
  272. status = "okay";
  273. };
  274. &slot0 {
  275. status = "okay";
  276. wifi@0,0 {
  277. compatible = "mediatek,mt76";
  278. reg = <0x0000 0 0 0 0>;
  279. mediatek,mtd-eeprom = <&factory 0x5000>;
  280. ieee80211-freq-limit = <5000000 6000000>;
  281. mediatek,disable-radar-background;
  282. };
  283. };
  284. &pwm {
  285. pinctrl-names = "default";
  286. pinctrl-0 = <&pwm7_pins>;
  287. status = "okay";
  288. };
  289. &pwrap {
  290. pinctrl-names = "default";
  291. pinctrl-0 = <&pmic_bus_pins>;
  292. status = "okay";
  293. };
  294. &rtc {
  295. status = "disabled";
  296. };
  297. &uart0 {
  298. pinctrl-names = "default";
  299. pinctrl-0 = <&uart0_pins>;
  300. status = "okay";
  301. };
  302. &watchdog {
  303. pinctrl-names = "default";
  304. pinctrl-0 = <&watchdog_pins>;
  305. status = "okay";
  306. };
  307. &wmac {
  308. status = "okay";
  309. mediatek,mtd-eeprom = <&factory 0x0>;
  310. };