ramips: convert MT7610 and MT7612 EEPROM to NVMEM format for MT7621
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_iptime_a3004ns-dual.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 = "iptime,a3004ns-dual", "mediatek,mt7621-soc";
10 model = "ipTIME A3004NS-dual";
11
12 aliases {
13 led-boot = &led_cpu;
14 led-failsafe = &led_cpu;
15 led-running = &led_cpu;
16 led-upgrade = &led_cpu;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_cpu: cpu {
23 label = "blue:cpu";
24 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
25 };
26
27 usb {
28 label = "blue:usb";
29 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
30 trigger-sources = <&xhci_ehci_port1>;
31 linux,default-trigger = "usbport";
32 };
33 };
34
35 keys {
36 compatible = "gpio-keys";
37
38 reset {
39 label = "reset";
40 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
41 linux,code = <KEY_RESTART>;
42 };
43
44 wps {
45 label = "wps";
46 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
47 linux,code = <KEY_WPS_BUTTON>;
48 };
49 };
50 };
51
52 &spi0 {
53 status = "okay";
54
55 flash@0 {
56 compatible = "jedec,spi-nor";
57 reg = <0>;
58 spi-max-frequency = <50000000>;
59
60 partitions {
61 compatible = "fixed-partitions";
62 #address-cells = <1>;
63 #size-cells = <1>;
64
65 uboot: partition@0 {
66 compatible = "nvmem-cells";
67 label = "u-boot";
68 reg = <0x0 0x20000>;
69 #address-cells = <1>;
70 #size-cells = <1>;
71 read-only;
72
73 macaddr_uboot_1fc20: macaddr@1fc20 {
74 reg = <0x1fc20 0x6>;
75 };
76
77 macaddr_uboot_1fc40: macaddr@1fc40 {
78 reg = <0x1fc40 0x6>;
79 };
80 };
81
82 partition@20000 {
83 label = "config";
84 reg = <0x20000 0x10000>;
85 read-only;
86 };
87
88 factory: partition@30000 {
89 compatible = "nvmem-cells";
90 label = "factory";
91 reg = <0x30000 0x10000>;
92 #address-cells = <1>;
93 #size-cells = <1>;
94 read-only;
95
96 eeprom_factory_0: eeprom@0 {
97 reg = <0x0 0x200>;
98 };
99
100 eeprom_factory_8000: eeprom@8000 {
101 reg = <0x8000 0x200>;
102 };
103 };
104
105 partition@40000 {
106 label = "firmware";
107 reg = <0x40000 0xfc0000>;
108 compatible = "denx,uimage";
109 };
110 };
111 };
112 };
113
114 &gmac0 {
115 nvmem-cells = <&macaddr_uboot_1fc20>;
116 nvmem-cell-names = "mac-address";
117 };
118
119 &gmac1 {
120 status = "okay";
121 label = "wan";
122 phy-handle = <&ethphy0>;
123
124 nvmem-cells = <&macaddr_uboot_1fc40>;
125 nvmem-cell-names = "mac-address";
126 };
127
128 &mdio {
129 ethphy0: ethernet-phy@0 {
130 reg = <0>;
131 };
132 };
133
134 &switch0 {
135 ports {
136 port@1 {
137 status = "okay";
138 label = "lan1";
139 };
140
141 port@2 {
142 status = "okay";
143 label = "lan2";
144 };
145
146 port@3 {
147 status = "okay";
148 label = "lan3";
149 };
150
151 port@4 {
152 status = "okay";
153 label = "lan4";
154 };
155 };
156 };
157
158 &pcie {
159 status = "okay";
160 };
161
162 &pcie0 {
163 wifi@0,0 {
164 compatible = "mediatek,mt76";
165 reg = <0x0000 0 0 0 0>;
166 nvmem-cells = <&eeprom_factory_8000>;
167 nvmem-cell-names = "eeprom";
168 ieee80211-freq-limit = <5000000 6000000>;
169
170 led {
171 led-sources = <2>;
172 led-active-low;
173 };
174 };
175 };
176
177 &pcie1 {
178 wifi@0,0 {
179 compatible = "mediatek,mt76";
180 reg = <0x0000 0 0 0 0>;
181 nvmem-cells = <&eeprom_factory_0>;
182 nvmem-cell-names = "eeprom";
183 ieee80211-freq-limit = <2400000 2500000>;
184
185 led {
186 led-sources = <2>;
187 led-active-low;
188 };
189 };
190 };
191
192 &state_default {
193 gpio {
194 groups = "wdt", "i2c", "uart3";
195 function = "gpio";
196 };
197 };