ramips: add wan2 support for MQmaker WiTi
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_mercusys_mr70x-v1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "mercusys,mr70x-v1", "mediatek,mt7621-soc";
10 model = "Mercusys MR70X v1";
11
12 aliases {
13 led-boot = &led_power_green;
14 led-failsafe = &led_power_orange;
15 led-running = &led_power_green;
16 led-upgrade = &led_power_orange;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32 };
33
34 leds {
35 compatible = "gpio-leds";
36
37 led_power_green: power-green {
38 label = "green:power";
39 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
40 };
41
42 led_power_orange: power-orange {
43 label = "orange:power";
44 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
45 };
46 };
47 };
48
49 &spi0 {
50 status = "okay";
51
52 flash@0 {
53 compatible = "jedec,spi-nor";
54 reg = <0>;
55 spi-max-frequency = <25000000>;
56
57 partitions {
58 compatible = "fixed-partitions";
59 #address-cells = <1>;
60 #size-cells = <1>;
61
62 partition@0 {
63 label = "u-boot";
64 reg = <0x000000 0x040000>;
65 read-only;
66 };
67
68 partition@40000 {
69 compatible = "denx,uimage";
70 label = "firmware";
71 reg = <0x040000 0xf60000>;
72 };
73
74 config: partition@fa0000 {
75 label = "config";
76 reg = <0xfa0000 0x010000>;
77 read-only;
78 };
79
80 partition@fb0000 {
81 label = "tplink";
82 reg = <0xfb0000 0x040000>;
83 read-only;
84 };
85
86 radio: partition@ff0000 {
87 label = "radio";
88 reg = <0xff0000 0x010000>;
89 read-only;
90 };
91 };
92 };
93 };
94
95 &pcie {
96 status = "okay";
97 };
98
99 &pcie1 {
100 wifi@0,0 {
101 compatible = "mediatek,mt76";
102 reg = <0x0000 0 0 0 0>;
103 mediatek,mtd-eeprom = <&radio 0x0>;
104 nvmem-cells = <&macaddr_config_8>;
105 nvmem-cell-names = "mac-address";
106 mediatek,disable-radar-background;
107 };
108 };
109
110 &gmac0 {
111 nvmem-cells = <&macaddr_config_8>;
112 nvmem-cell-names = "mac-address";
113 };
114
115 &gmac1 {
116 status = "okay";
117 label = "wan";
118 phy-handle = <&ethphy0>;
119
120 nvmem-cells = <&macaddr_config_8>;
121 nvmem-cell-names = "mac-address";
122 mac-address-increment = <1>;
123 };
124
125 &mdio {
126 ethphy0: ethernet-phy@0 {
127 reg = <0>;
128 };
129 };
130
131 &switch0 {
132 ports {
133 port@1 {
134 status = "okay";
135 label = "lan1";
136 };
137
138 port@2 {
139 status = "okay";
140 label = "lan2";
141 };
142
143 port@3 {
144 status = "okay";
145 label = "lan3";
146 };
147 };
148 };
149
150 &state_default {
151 gpio {
152 groups = "i2c", "uart3";
153 function = "gpio";
154 };
155 };
156
157 &config {
158 compatible = "nvmem-cells";
159 #address-cells = <1>;
160 #size-cells = <1>;
161
162 macaddr_config_8: macaddr@8 {
163 reg = <0x8 0x6>;
164 };
165 };