ramips: convert mtd-mac-address to nvmem implementation
[openwrt/openwrt.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 = &wan;
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 partitions: partitions {
59 compatible = "fixed-partitions";
60 #address-cells = <1>;
61 #size-cells = <1>;
62
63 partition@0 {
64 label = "u-boot";
65 reg = <0x0 0x0100000>;
66 read-only;
67 };
68
69 partition@100000 {
70 label = "u-boot-env";
71 reg = <0x0100000 0x0100000>;
72 read-only;
73 };
74
75 factory: partition@200000 {
76 label = "factory";
77 reg = <0x0200000 0x0100000>;
78 };
79
80 partition@300000 {
81 label = "SecondBoot";
82 reg = <0x0300000 0x0100000>;
83 read-only;
84 };
85
86 partition@400000 {
87 label = "kernel";
88 reg = <0x0400000 0x0400000>;
89 };
90
91 partition@800000 {
92 label = "ubi";
93 reg = <0x0800000 0x2e00000>;
94 };
95
96 partition@3600000 {
97 label = "Config";
98 reg = <0x3600000 0x0100000>;
99 read-only;
100 };
101
102 partition@3700000 {
103 label = "firmware_2";
104 reg = <0x3700000 0x3200000>;
105 };
106
107 partition@6900000 {
108 label = "Config_2";
109 reg = <0x6900000 0x0100000>;
110 read-only;
111 };
112
113 partition@6a00000 {
114 label = "persist";
115 reg = <0x6a00000 0x0100000>;
116 };
117 };
118 };
119
120 &gmac0 {
121 nvmem-cells = <&macaddr_factory_e000>;
122 nvmem-cell-names = "mac-address";
123 };
124
125 &switch0 {
126 ports {
127 wan: port@0 {
128 status = "okay";
129 label = "wan";
130 nvmem-cells = <&macaddr_factory_e006>;
131 nvmem-cell-names = "mac-address";
132 };
133
134 port@1 {
135 status = "okay";
136 label = "lan4";
137 };
138
139 port@2 {
140 status = "okay";
141 label = "lan3";
142 };
143
144 port@3 {
145 status = "okay";
146 label = "lan2";
147 };
148
149 port@4 {
150 status = "okay";
151 label = "lan1";
152 };
153 };
154 };
155
156 &pcie {
157 status = "okay";
158 };
159
160 &state_default {
161 gpio {
162 groups = "uart2", "uart3", "wdt";
163 function = "gpio";
164 };
165 };
166
167 &xhci {
168 status = "disabled";
169 };
170
171 &factory {
172 compatible = "nvmem-cells";
173 #address-cells = <1>;
174 #size-cells = <1>;
175
176 macaddr_factory_e000: macaddr@e000 {
177 reg = <0xe000 0x6>;
178 };
179
180 macaddr_factory_e006: macaddr@e006 {
181 reg = <0xe006 0x6>;
182 };
183 };