ramips: mt7621: convert I-O DATA devices EEPROM to NVMEM format
[openwrt/staging/jow.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 nvmem-layout {
85 compatible = "fixed-layout";
86 #address-cells = <1>;
87 #size-cells = <1>;
88
89 eeprom_factory_0: eeprom@0 {
90 reg = <0x0 0x400>;
91 };
92
93 eeprom_factory_8000: eeprom@8000 {
94 reg = <0x8000 0x4da8>;
95 };
96
97 macaddr_factory_e000: macaddr@e000 {
98 reg = <0xe000 0x6>;
99 };
100
101 macaddr_factory_e006: macaddr@e006 {
102 reg = <0xe006 0x6>;
103 };
104 };
105 };
106
107 partition@300000 {
108 label = "SecondBoot";
109 reg = <0x0300000 0x0100000>;
110 read-only;
111 };
112
113 partition@400000 {
114 label = "kernel";
115 reg = <0x0400000 0x0400000>;
116 };
117
118 partition@800000 {
119 label = "ubi";
120 reg = <0x0800000 0x2e00000>;
121 };
122
123 partition@3600000 {
124 label = "Config";
125 reg = <0x3600000 0x0100000>;
126 read-only;
127 };
128
129 partition@3700000 {
130 label = "firmware_2";
131 reg = <0x3700000 0x3200000>;
132 };
133
134 partition@6900000 {
135 label = "Config_2";
136 reg = <0x6900000 0x0100000>;
137 read-only;
138 };
139
140 partition@6a00000 {
141 label = "persist";
142 reg = <0x6a00000 0x0100000>;
143 };
144 };
145 };
146
147 &gmac0 {
148 nvmem-cells = <&macaddr_factory_e000>;
149 nvmem-cell-names = "mac-address";
150 };
151
152 &gmac1 {
153 status = "okay";
154 label = "wan";
155 phy-handle = <&ethphy0>;
156
157 nvmem-cells = <&macaddr_factory_e006>;
158 nvmem-cell-names = "mac-address";
159 };
160
161 &mdio {
162 ethphy0: ethernet-phy@0 {
163 reg = <0>;
164 };
165 };
166
167 &switch0 {
168 ports {
169 port@1 {
170 status = "okay";
171 label = "lan4";
172 };
173
174 port@2 {
175 status = "okay";
176 label = "lan3";
177 };
178
179 port@3 {
180 status = "okay";
181 label = "lan2";
182 };
183
184 port@4 {
185 status = "okay";
186 label = "lan1";
187 };
188 };
189 };
190
191 &pcie {
192 status = "okay";
193 };
194
195 &state_default {
196 gpio {
197 groups = "uart2", "uart3", "wdt";
198 function = "gpio";
199 };
200 };
201
202 &xhci {
203 status = "disabled";
204 };