ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621_iodata_wnpr2600g.dts
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 compatible = "iodata,wnpr2600g", "mediatek,mt7621-soc";
10 model = "I-O DATA WNPR2600G";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_power: power {
23 label = "green:power";
24 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
25 default-state = "on";
26 };
27
28 notification {
29 label = "green:notification";
30 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
31 };
32
33 wlan2g {
34 label = "green:wlan2g";
35 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
36 linux,default-trigger = "phy0radio";
37 };
38
39 wlan5g {
40 label = "green:wlan5g";
41 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
42 linux,default-trigger = "phy1radio";
43 };
44 };
45
46 keys {
47 compatible = "gpio-keys";
48
49 auto {
50 label = "auto";
51 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
52 linux,code = <BTN_0>;
53 linux,input-type = <EV_SW>;
54 };
55
56 reset {
57 label = "reset";
58 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
59 linux,code = <KEY_RESTART>;
60 };
61
62 wps {
63 label = "wps";
64 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
65 linux,code = <KEY_WPS_BUTTON>;
66 };
67 };
68 };
69
70 &spi0 {
71 status = "okay";
72
73 flash@0 {
74 compatible = "jedec,spi-nor";
75 reg = <0>;
76 spi-max-frequency = <40000000>;
77
78 partitions {
79 compatible = "fixed-partitions";
80 #address-cells = <1>;
81 #size-cells = <1>;
82
83 partition@0 {
84 label = "u-boot";
85 reg = <0x000000 0x030000>;
86 read-only;
87 };
88
89 partition@30000 {
90 label = "u-boot-env";
91 reg = <0x030000 0x010000>;
92 read-only;
93 };
94
95 factory: partition@40000 {
96 label = "factory";
97 reg = <0x040000 0x010000>;
98 read-only;
99 };
100
101 partition@50000 {
102 compatible = "denx,uimage";
103 label = "firmware";
104 reg = <0x050000 0xda0000>;
105 };
106
107 partition@df0000 {
108 label = "manufacture";
109 reg = <0xdf0000 0x190000>;
110 read-only;
111 };
112
113 partition@f80000 {
114 label = "storage";
115 reg = <0xf80000 0x080000>;
116 read-only;
117 };
118 };
119 };
120 };
121
122 &gmac0 {
123 nvmem-cells = <&macaddr_factory_4>;
124 nvmem-cell-names = "mac-address";
125 };
126
127 &switch0 {
128 ports {
129 port@0 {
130 status = "okay";
131 label = "wan";
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 &state_default {
157 gpio {
158 groups = "uart2", "uart3", "jtag", "wdt";
159 function = "gpio";
160 };
161 };
162
163 &pcie {
164 status = "okay";
165 };
166
167 &pcie0 {
168 wifi@0,0 {
169 compatible = "mediatek,mt76";
170 reg = <0x0000 0 0 0 0>;
171 mediatek,mtd-eeprom = <&factory 0x0>;
172 ieee80211-freq-limit = <2400000 2500000>;
173 };
174 };
175
176 &pcie1 {
177 wifi@0,0 {
178 compatible = "mediatek,mt76";
179 reg = <0x0000 0 0 0 0>;
180 mediatek,mtd-eeprom = <&factory 0x8000>;
181 ieee80211-freq-limit = <5000000 6000000>;
182 };
183 };
184
185 &xhci {
186 status = "disabled";
187 };
188
189 &factory {
190 compatible = "nvmem-cells";
191 #address-cells = <1>;
192 #size-cells = <1>;
193
194 macaddr_factory_4: macaddr@4 {
195 reg = <0x4 0x6>;
196 };
197 };