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