9004e5f0fde8459642042d0c2cb4901c175536cd
[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 nvmem-layout {
80 compatible = "fixed-layout";
81 #address-cells = <1>;
82 #size-cells = <1>;
83
84 macaddr_config_8: macaddr@8 {
85 compatible = "mac-base";
86 reg = <0x8 0x6>;
87 #nvmem-cell-cells = <1>;
88 };
89 };
90 };
91
92 partition@fb0000 {
93 label = "tplink";
94 reg = <0xfb0000 0x040000>;
95 read-only;
96 };
97
98 radio: partition@ff0000 {
99 label = "radio";
100 reg = <0xff0000 0x010000>;
101 read-only;
102
103 nvmem-layout {
104 compatible = "fixed-layout";
105 #address-cells = <1>;
106 #size-cells = <1>;
107
108 eeprom_radio_0: eeprom@0 {
109 reg = <0x0 0xe00>;
110 };
111 };
112 };
113 };
114 };
115 };
116
117 &pcie {
118 status = "okay";
119 };
120
121 &pcie1 {
122 wifi@0,0 {
123 compatible = "mediatek,mt76";
124 reg = <0x0000 0 0 0 0>;
125 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8 0>;
126 nvmem-cell-names = "eeprom", "mac-address";
127 mediatek,disable-radar-background;
128 };
129 };
130
131 &gmac0 {
132 nvmem-cells = <&macaddr_config_8 0>;
133 nvmem-cell-names = "mac-address";
134 };
135
136 &gmac1 {
137 status = "okay";
138 label = "wan";
139 phy-handle = <&ethphy0>;
140
141 nvmem-cells = <&macaddr_config_8 1>;
142 nvmem-cell-names = "mac-address";
143 };
144
145 &mdio {
146 ethphy0: ethernet-phy@0 {
147 reg = <0>;
148 };
149 };
150
151 &switch0 {
152 ports {
153 port@1 {
154 status = "okay";
155 label = "lan1";
156 };
157
158 port@2 {
159 status = "okay";
160 label = "lan2";
161 };
162
163 port@3 {
164 status = "okay";
165 label = "lan3";
166 };
167 };
168 };
169
170 &state_default {
171 gpio {
172 groups = "i2c", "uart3";
173 function = "gpio";
174 };
175 };