4b42fcb7de72e5104460fb58a659ec33b70b78c4
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_iodata_wn-xx-xr.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_power;
11 led-failsafe = &led_power;
12 led-running = &led_power;
13 led-upgrade = &led_power;
14 label-mac-device = &gmac1;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 wps {
21 label = "green:wps";
22 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
23 };
24
25 led_power: power {
26 label = "green:power";
27 gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
28 };
29 };
30
31 keys {
32 compatible = "gpio-keys";
33
34 reset {
35 label = "reset";
36 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_RESTART>;
38 };
39
40 repeater {
41 label = "repeater";
42 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
43 linux,code = <BTN_0>;
44 linux,input-type = <EV_SW>;
45 };
46
47 wps {
48 label = "wps";
49 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
50 linux,code = <KEY_WPS_BUTTON>;
51 };
52 };
53 };
54
55 &nand {
56 status = "okay";
57
58 mediatek,bbt;
59 mediatek,bmt-remap-range =
60 <0x0000000 0x0800000>,
61 <0x3600000 0x4980000>;
62
63 partitions: partitions {
64 compatible = "fixed-partitions";
65 #address-cells = <1>;
66 #size-cells = <1>;
67
68 partition@0 {
69 label = "u-boot";
70 reg = <0x0 0x0100000>;
71 read-only;
72 };
73
74 partition@100000 {
75 label = "u-boot-env";
76 reg = <0x0100000 0x0100000>;
77 read-only;
78 };
79
80 factory: partition@200000 {
81 label = "factory";
82 reg = <0x0200000 0x0100000>;
83 };
84
85 partition@300000 {
86 label = "SecondBoot";
87 reg = <0x0300000 0x0100000>;
88 read-only;
89 };
90
91 partition@400000 {
92 label = "kernel";
93 reg = <0x0400000 0x0400000>;
94 };
95
96 partition@800000 {
97 label = "ubi";
98 reg = <0x0800000 0x2e00000>;
99 };
100
101 partition@3600000 {
102 label = "Config";
103 reg = <0x3600000 0x0100000>;
104 read-only;
105 };
106
107 partition@3700000 {
108 label = "firmware_2";
109 reg = <0x3700000 0x3200000>;
110 };
111
112 partition@6900000 {
113 label = "Config_2";
114 reg = <0x6900000 0x0100000>;
115 read-only;
116 };
117
118 partition@6a00000 {
119 label = "persist";
120 reg = <0x6a00000 0x0100000>;
121 };
122 };
123 };
124
125 &gmac0 {
126 nvmem-cells = <&macaddr_factory_e000>;
127 nvmem-cell-names = "mac-address";
128 };
129
130 &gmac1 {
131 status = "okay";
132 label = "wan";
133 phy-handle = <&ethphy0>;
134
135 nvmem-cells = <&macaddr_factory_e006>;
136 nvmem-cell-names = "mac-address";
137 };
138
139 &mdio {
140 ethphy0: ethernet-phy@0 {
141 reg = <0>;
142 };
143 };
144
145 &switch0 {
146 ports {
147 port@1 {
148 status = "okay";
149 label = "lan4";
150 };
151
152 port@2 {
153 status = "okay";
154 label = "lan3";
155 };
156
157 port@3 {
158 status = "okay";
159 label = "lan2";
160 };
161
162 port@4 {
163 status = "okay";
164 label = "lan1";
165 };
166 };
167 };
168
169 &pcie {
170 status = "okay";
171 };
172
173 &state_default {
174 gpio {
175 groups = "uart2", "uart3", "wdt";
176 function = "gpio";
177 };
178 };
179
180 &xhci {
181 status = "disabled";
182 };
183
184 &factory {
185 compatible = "nvmem-cells";
186 #address-cells = <1>;
187 #size-cells = <1>;
188
189 macaddr_factory_e000: macaddr@e000 {
190 reg = <0xe000 0x6>;
191 };
192
193 macaddr_factory_e006: macaddr@e006 {
194 reg = <0xe006 0x6>;
195 };
196 };