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