ramips: mt7621: convert to nvmem-layout
[openwrt/staging/hauke.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 label = "u-boot";
67 reg = <0x0 0x20000>;
68 read-only;
69
70 nvmem-layout {
71 compatible = "fixed-layout";
72 #address-cells = <1>;
73 #size-cells = <1>;
74
75 macaddr_uboot_1fc20: macaddr@1fc20 {
76 reg = <0x1fc20 0x6>;
77 };
78
79 macaddr_uboot_1fc40: macaddr@1fc40 {
80 reg = <0x1fc40 0x6>;
81 };
82 };
83 };
84
85 partition@20000 {
86 label = "config";
87 reg = <0x20000 0x10000>;
88 read-only;
89 };
90
91 factory: partition@30000 {
92 label = "factory";
93 reg = <0x30000 0x10000>;
94 read-only;
95
96 nvmem-layout {
97 compatible = "fixed-layout";
98 #address-cells = <1>;
99 #size-cells = <1>;
100
101 eeprom_factory_0: eeprom@0 {
102 reg = <0x0 0x200>;
103 };
104
105 eeprom_factory_8000: eeprom@8000 {
106 reg = <0x8000 0x200>;
107 };
108 };
109 };
110
111 partition@40000 {
112 label = "firmware";
113 reg = <0x40000 0xfc0000>;
114 compatible = "denx,uimage";
115 };
116 };
117 };
118 };
119
120 &gmac0 {
121 nvmem-cells = <&macaddr_uboot_1fc20>;
122 nvmem-cell-names = "mac-address";
123 };
124
125 &gmac1 {
126 status = "okay";
127 label = "wan";
128 phy-handle = <&ethphy0>;
129
130 nvmem-cells = <&macaddr_uboot_1fc40>;
131 nvmem-cell-names = "mac-address";
132 };
133
134 &mdio {
135 ethphy0: ethernet-phy@0 {
136 reg = <0>;
137 };
138 };
139
140 &switch0 {
141 ports {
142 port@1 {
143 status = "okay";
144 label = "lan1";
145 };
146
147 port@2 {
148 status = "okay";
149 label = "lan2";
150 };
151
152 port@3 {
153 status = "okay";
154 label = "lan3";
155 };
156
157 port@4 {
158 status = "okay";
159 label = "lan4";
160 };
161 };
162 };
163
164 &pcie {
165 status = "okay";
166 };
167
168 &pcie0 {
169 wifi@0,0 {
170 compatible = "mediatek,mt76";
171 reg = <0x0000 0 0 0 0>;
172 nvmem-cells = <&eeprom_factory_8000>;
173 nvmem-cell-names = "eeprom";
174 ieee80211-freq-limit = <5000000 6000000>;
175
176 led {
177 led-sources = <2>;
178 led-active-low;
179 };
180 };
181 };
182
183 &pcie1 {
184 wifi@0,0 {
185 compatible = "mediatek,mt76";
186 reg = <0x0000 0 0 0 0>;
187 nvmem-cells = <&eeprom_factory_0>;
188 nvmem-cell-names = "eeprom";
189 ieee80211-freq-limit = <2400000 2500000>;
190
191 led {
192 led-sources = <2>;
193 led-active-low;
194 };
195 };
196 };
197
198 &state_default {
199 gpio {
200 groups = "wdt", "i2c", "uart3";
201 function = "gpio";
202 };
203 };