ramips: convert MT7603 EEPROM to NVMEM format
[openwrt/staging/dangole.git] / target / linux / ramips / dts / mt7621_iodata_wn-ax1167gr.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "iodata,wn-ax1167gr", "mediatek,mt7621-soc";
8 model = "I-O DATA WN-AX1167GR";
9
10 aliases {
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200";
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 led_power: power {
25 label = "green:power";
26 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
27 };
28
29 wps {
30 label = "green:wps";
31 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
32 };
33 };
34
35 keys {
36 compatible = "gpio-keys";
37
38 reset {
39 label = "reset";
40 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
41 linux,code = <KEY_RESTART>;
42 };
43
44 wps {
45 label = "wps";
46 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
47 linux,code = <KEY_WPS_BUTTON>;
48 };
49
50 auto {
51 label = "auto";
52 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
53 linux,code = <BTN_0>;
54 linux,input-type = <EV_SW>;
55 };
56
57 custom {
58 label = "custom";
59 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
60 linux,code = <BTN_0>;
61 linux,input-type = <EV_SW>;
62 };
63 };
64 };
65
66 &spi0 {
67 status = "okay";
68
69 flash@0 {
70 compatible = "jedec,spi-nor";
71 reg = <0>;
72 spi-max-frequency = <10000000>;
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 partition@0 {
80 label = "Bootloader";
81 reg = <0x0 0x30000>;
82 read-only;
83 };
84
85 partition@30000 {
86 label = "Config";
87 reg = <0x30000 0x10000>;
88 read-only;
89 };
90
91 factory: partition@40000 {
92 compatible = "nvmem-cells";
93 label = "factory";
94 reg = <0x40000 0x10000>;
95 #address-cells = <1>;
96 #size-cells = <1>;
97 read-only;
98
99 macaddr_factory_4: macaddr@4 {
100 reg = <0x4 0x6>;
101 };
102 };
103
104 iNIC_rf: partition@50000 {
105 compatible = "nvmem-cells";
106 label = "iNIC_rf";
107 reg = <0x50000 0x10000>;
108 #address-cells = <1>;
109 #size-cells = <1>;
110 read-only;
111
112 eeprom_iNIC_rf_0: eeprom@0 {
113 reg = <0x0 0x400>;
114 };
115
116 macaddr_iNIC_rf_4: macaddr@4 {
117 reg = <0x4 0x6>;
118 };
119 };
120
121 partition@60000 {
122 compatible = "denx,uimage";
123 label = "firmware";
124 reg = <0x60000 0xf30000>;
125 };
126
127 partition@f90000 {
128 label = "Key";
129 reg = <0xf90000 0x10000>;
130 read-only;
131 };
132
133 partition@fa0000 {
134 label = "backup";
135 reg = <0xfa0000 0x10000>;
136 read-only;
137 };
138
139 partition@fb0000 {
140 label = "storage";
141 reg = <0xfb0000 0x50000>;
142 read-only;
143 };
144 };
145 };
146 };
147
148 &gmac0 {
149 nvmem-cells = <&macaddr_iNIC_rf_4>;
150 nvmem-cell-names = "mac-address";
151 };
152
153 &gmac1 {
154 status = "okay";
155 label = "wan";
156 phy-handle = <&ethphy0>;
157
158 nvmem-cells = <&macaddr_factory_4>;
159 nvmem-cell-names = "mac-address";
160 mac-address-increment = <1>;
161 };
162
163 &mdio {
164 ethphy0: ethernet-phy@0 {
165 reg = <0>;
166 };
167 };
168
169 &switch0 {
170 ports {
171 port@1 {
172 status = "okay";
173 label = "lan4";
174 };
175
176 port@2 {
177 status = "okay";
178 label = "lan3";
179 };
180
181 port@3 {
182 status = "okay";
183 label = "lan2";
184 };
185
186 port@4 {
187 status = "okay";
188 label = "lan1";
189 };
190 };
191 };
192
193 &state_default {
194 gpio {
195 groups = "uart2", "uart3", "jtag";
196 function = "gpio";
197 };
198 };
199
200 &pcie {
201 status = "okay";
202 };
203
204 &pcie0 {
205 mt76@0,0 {
206 reg = <0x0000 0 0 0 0>;
207 nvmem-cells = <&eeprom_iNIC_rf_0>;
208 nvmem-cell-names = "eeprom";
209 };
210 };
211
212 &pcie1 {
213 mt76@0,0 {
214 reg = <0x0000 0 0 0 0>;
215 mediatek,mtd-eeprom = <&factory 0x0>;
216 ieee80211-freq-limit = <5000000 6000000>;
217 };
218 };
219
220 &xhci {
221 status = "disabled";
222 };