dc9033c3940509843ec51241cb11cf732040a147
[openwrt/staging/blocktrron.git] / target / linux / ramips / dts / mt7621_iptime_a8004t.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,a8004t", "mediatek,mt7621-soc";
10 model = "ipTIME A8004T";
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 = "orange:cpu";
24 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
25 };
26
27 wlan2g {
28 label = "orange:wlan2g";
29 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
30 linux,default-trigger = "phy0radio";
31 };
32
33 wlan5g {
34 label = "orange:wlan5g";
35 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
36 linux,default-trigger = "phy1radio";
37 };
38 };
39
40 keys {
41 compatible = "gpio-keys";
42
43 reset {
44 label = "reset";
45 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
46 linux,code = <KEY_RESTART>;
47 };
48
49 wps {
50 label = "wps";
51 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
52 linux,code = <KEY_WPS_BUTTON>;
53 };
54 };
55 };
56
57 &spi0 {
58 status = "okay";
59
60 flash@0 {
61 compatible = "jedec,spi-nor";
62 reg = <0>;
63 spi-max-frequency = <50000000>;
64
65 partitions {
66 compatible = "fixed-partitions";
67 #address-cells = <1>;
68 #size-cells = <1>;
69
70 uboot: partition@0 {
71 compatible = "nvmem-cells";
72 label = "u-boot";
73 reg = <0x0 0x20000>;
74 #address-cells = <1>;
75 #size-cells = <1>;
76 read-only;
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 partition@20000 {
88 label = "config";
89 reg = <0x20000 0x10000>;
90 read-only;
91 };
92
93 factory: partition@30000 {
94 compatible = "nvmem-cells";
95 label = "factory";
96 reg = <0x30000 0x10000>;
97 #address-cells = <1>;
98 #size-cells = <1>;
99 read-only;
100
101 eeprom_factory_0: eeprom@0 {
102 reg = <0x0 0x4da8>;
103 };
104
105 eeprom_factory_8000: eeprom@8000 {
106 reg = <0x8000 0x4da8>;
107 };
108 };
109
110 partition@40000 {
111 compatible = "denx,uimage";
112 label = "firmware";
113 reg = <0x40000 0xfc0000>;
114 };
115 };
116 };
117 };
118
119 &gmac0 {
120 nvmem-cells = <&macaddr_uboot_1fc20>;
121 nvmem-cell-names = "mac-address";
122 };
123
124 &gmac1 {
125 status = "okay";
126 label = "wan";
127 phy-handle = <&ethphy0>;
128
129 nvmem-cells = <&macaddr_uboot_1fc40>;
130 nvmem-cell-names = "mac-address";
131 };
132
133 &mdio {
134 ethphy0: ethernet-phy@0 {
135 reg = <0>;
136 };
137 };
138
139 &switch0 {
140 ports {
141 port@1 {
142 status = "okay";
143 label = "lan4";
144 };
145
146 port@2 {
147 status = "okay";
148 label = "lan3";
149 };
150
151 port@3 {
152 status = "okay";
153 label = "lan2";
154 };
155
156 port@4 {
157 status = "okay";
158 label = "lan1";
159 };
160 };
161 };
162
163 &pcie {
164 status = "okay";
165 };
166
167 &pcie0 {
168 wifi@0,0 {
169 compatible = "mediatek,mt76";
170 reg = <0x0000 0 0 0 0>;
171 nvmem-cells = <&eeprom_factory_0>;
172 nvmem-cell-names = "eeprom";
173 ieee80211-freq-limit = <2400000 2500000>;
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_8000>;
182 nvmem-cell-names = "eeprom";
183 ieee80211-freq-limit = <5000000 6000000>;
184 };
185 };
186
187 &state_default {
188 gpio {
189 groups = "wdt", "jtag", "i2c";
190 function = "gpio";
191 };
192 };