7b7228b8c36d6a0aa707a0af4c4aa70ec6c98588
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_dlink_dir-xx60-a1.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 #include <dt-bindings/leds/common.h>
8
9 / {
10 aliases {
11 label-mac-device = &gmac0;
12 led-boot = &led_power_orange;
13 led-failsafe = &led_power_white;
14 led-running = &led_power_white;
15 led-upgrade = &led_net_orange;
16 };
17
18 keys {
19 compatible = "gpio-keys";
20
21 reset {
22 label = "reset";
23 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
24 linux,code = <KEY_RESTART>;
25 };
26
27 wps {
28 label = "wps";
29 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_WPS_BUTTON>;
31 };
32 };
33
34 leds: leds {
35 compatible = "gpio-leds";
36
37 led_power_orange: power_orange {
38 function = LED_FUNCTION_POWER;
39 color = <LED_COLOR_ID_ORANGE>;
40 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
41 };
42
43 led_power_white: power_white {
44 function = LED_FUNCTION_POWER;
45 color = <LED_COLOR_ID_WHITE>;
46 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
47 };
48
49 led_net_orange: net_orange {
50 label = "orange:net";
51 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
52 };
53
54 net_white {
55 label = "white:net";
56 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
57 };
58 };
59 };
60
61 &nand {
62 status = "okay";
63
64 partitions {
65 compatible = "fixed-partitions";
66 #address-cells = <1>;
67 #size-cells = <1>;
68
69 partition@0 {
70 label = "Bootloader";
71 reg = <0x0 0x80000>;
72 read-only;
73 };
74
75 partition@80000 {
76 label = "config";
77 reg = <0x80000 0x80000>;
78 read-only;
79 };
80
81 partition@100000 {
82 label = "factory";
83 reg = <0x100000 0x40000>;
84 read-only;
85
86 nvmem-layout {
87 compatible = "fixed-layout";
88 #address-cells = <1>;
89 #size-cells = <1>;
90
91 eeprom_factory_0: eeprom@0 {
92 reg = <0x0 0x4da8>;
93 };
94
95 eeprom_factory_8000: eeprom@8000 {
96 reg = <0x8000 0x4da8>;
97 };
98
99 macaddr_factory_e000: macaddr@e000 {
100 compatible = "mac-base";
101 reg = <0xe000 0x6>;
102 #nvmem-cell-cells = <1>;
103 };
104 };
105 };
106
107 partition@140000 {
108 label = "config2";
109 reg = <0x140000 0x40000>;
110 read-only;
111 };
112
113 partition@180000 {
114 label = "firmware";
115 compatible = "openwrt,uimage", "denx,uimage";
116 openwrt,padding = <96>;
117 reg = <0x180000 0x2800000>;
118 };
119
120 partition@2980000 {
121 label = "private";
122 reg = <0x2980000 0x2000000>;
123 read-only;
124 };
125
126 partition@4980000 {
127 label = "firmware2";
128 reg = <0x4980000 0x2800000>;
129 };
130
131 partition@7180000 {
132 label = "mydlink";
133 reg = <0x7180000 0x600000>;
134 read-only;
135 };
136
137 partition@7780000 {
138 label = "reserved";
139 reg = <0x7780000 0x880000>;
140 read-only;
141 };
142 };
143 };
144
145 &pcie {
146 status = "okay";
147 };
148
149 &pcie0 {
150 wifi0: wifi@0,0 {
151 compatible = "mediatek,mt76";
152 reg = <0x0000 0 0 0 0>;
153 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 1>;
154 nvmem-cell-names = "eeprom", "mac-address";
155 ieee80211-freq-limit = <2400000 2500000>;
156
157 led {
158 led-active-low;
159 };
160 };
161 };
162
163 &pcie1 {
164 wifi1: wifi@0,0 {
165 compatible = "mediatek,mt76";
166 reg = <0x0000 0 0 0 0>;
167 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 2>;
168 nvmem-cell-names = "eeprom", "mac-address";
169 ieee80211-freq-limit = <5000000 6000000>;
170
171 led {
172 led-active-low;
173 };
174 };
175 };
176
177 &gmac0 {
178 nvmem-cells = <&macaddr_factory_e000 0>;
179 nvmem-cell-names = "mac-address";
180 };
181
182 &gmac1 {
183 status = "okay";
184 label = "wan";
185 phy-handle = <&ethphy4>;
186
187 nvmem-cells = <&macaddr_factory_e000 3>;
188 nvmem-cell-names = "mac-address";
189 };
190
191 &mdio {
192 ethphy4: ethernet-phy@4 {
193 reg = <4>;
194 };
195 };
196
197 &switch0 {
198 ports {
199 port@0 {
200 status = "okay";
201 label = "lan4";
202 };
203
204 port@1 {
205 status = "okay";
206 label = "lan3";
207 };
208
209 port@2 {
210 status = "okay";
211 label = "lan2";
212 };
213
214 port@3 {
215 status = "okay";
216 label = "lan1";
217 };
218 };
219 };
220
221 &state_default {
222 gpio {
223 groups = "i2c", "uart3", "jtag", "wdt";
224 function = "gpio";
225 };
226 };