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