a0ee79ae23ce473087a5099f92d2aec30dcc5f3c
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_xiaomi_mi-router-4a-3g-v2.dtsi
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 aliases {
10 led-boot = &led_status_yellow;
11 led-failsafe = &led_status_yellow;
12 led-running = &led_status_blue;
13 led-upgrade = &led_status_yellow;
14 label-mac-device = &gmac1;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200n8";
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 led_status_blue: status_blue {
25 label = "blue:status";
26 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
27 };
28
29 led_status_yellow: status_yellow {
30 label = "yellow:status";
31 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
32 };
33 };
34
35 keys {
36 compatible = "gpio-keys";
37
38 reset {
39 label = "reset";
40 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
41 linux,code = <KEY_RESTART>;
42 };
43 };
44 };
45
46 &spi0 {
47 status = "okay";
48
49 flash@0 {
50 compatible = "jedec,spi-nor";
51 reg = <0>;
52 spi-max-frequency = <50000000>;
53 m25p,fast-read;
54
55 partitions {
56 compatible = "fixed-partitions";
57 #address-cells = <1>;
58 #size-cells = <1>;
59
60 partition@0 {
61 label = "u-boot";
62 reg = <0x0 0x30000>;
63 read-only;
64 };
65
66 partition@30000 {
67 label = "u-boot-env";
68 reg = <0x30000 0x10000>;
69 read-only;
70 };
71
72 partition@40000 {
73 label = "Bdata";
74 reg = <0x40000 0x10000>;
75 read-only;
76 };
77
78 factory: partition@50000 {
79 label = "factory";
80 reg = <0x50000 0x10000>;
81 read-only;
82 };
83
84 partition@60000 {
85 label = "crash";
86 reg = <0x60000 0x10000>;
87 read-only;
88 };
89
90 partition@70000 {
91 label = "cfg_bak";
92 reg = <0x70000 0x10000>;
93 read-only;
94 };
95
96 partition@80000 {
97 label = "overlay";
98 reg = <0x80000 0x100000>;
99 read-only;
100 };
101
102 firmware: partition@180000 {
103 compatible = "denx,uimage";
104 label = "firmware";
105 reg = <0x180000 0xe80000>;
106 };
107 };
108 };
109 };
110
111 &pcie {
112 status = "okay";
113 };
114
115 &pcie0 {
116 wifi@0,0 {
117 compatible = "pci14c3,7662";
118 reg = <0x0000 0 0 0 0>;
119 mediatek,mtd-eeprom = <&factory 0x8000>;
120 ieee80211-freq-limit = <5000000 6000000>;
121 };
122 };
123
124 &pcie1 {
125 wifi@0,0 {
126 compatible = "pci14c3,7603";
127 reg = <0x0000 0 0 0 0>;
128 mediatek,mtd-eeprom = <&factory 0x0000>;
129 ieee80211-freq-limit = <2400000 2500000>;
130 };
131 };
132
133 &gmac0 {
134 nvmem-cells = <&macaddr_factory_e000>;
135 nvmem-cell-names = "mac-address";
136 };
137
138 &gmac1 {
139 status = "okay";
140 label = "wan";
141 phy-handle = <&ethphy4>;
142
143 nvmem-cells = <&macaddr_factory_e006>;
144 nvmem-cell-names = "mac-address";
145 };
146
147 &mdio {
148 ethphy4: ethernet-phy@4 {
149 reg = <4>;
150 };
151 };
152
153 &switch0 {
154 ports {
155 port@2 {
156 status = "okay";
157 label = "lan2";
158 };
159
160 port@3 {
161 status = "okay";
162 label = "lan1";
163 };
164 };
165 };
166
167 &state_default {
168 gpio {
169 groups = "jtag", "uart2", "uart3", "wdt";
170 function = "gpio";
171 };
172 };
173
174 &factory {
175 compatible = "nvmem-cells";
176 #address-cells = <1>;
177 #size-cells = <1>;
178
179 macaddr_factory_e000: macaddr@e000 {
180 reg = <0xe000 0x6>;
181 };
182
183 macaddr_factory_e006: macaddr@e006 {
184 reg = <0xe006 0x6>;
185 };
186 };