6c983dd54a0b0a39eb79c2a9922bc7d614ec38da
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621_telco-electronics_x1.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 = "telco-electronics,x1", "mediatek,mt7621-soc";
10 model = "Telco Electronics X1";
11
12 aliases {
13 led-boot = &system_led;
14 led-failsafe = &system_led;
15 led-running = &system_led;
16 led-upgrade = &system_led;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 };
22
23 keys {
24 compatible = "gpio-keys";
25
26 reset {
27 label = "reset";
28 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
29 linux,code = <KEY_RESTART>;
30 };
31 };
32
33 leds {
34 compatible = "gpio-leds";
35
36 system_led: system {
37 label = "green:system";
38 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
39 };
40
41 modem_offline {
42 label = "red:modem-offline";
43 gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
44 };
45
46 modem_4g {
47 label = "blue:modem-4g";
48 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
49 };
50
51 modem_3g {
52 label = "green:modem-3g";
53 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
54 };
55
56 modem_rssi_lowest {
57 label = "green:modem-rssi-lowest";
58 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
59 };
60
61 modem_rssi_low {
62 label = "green:modem-rssi-low";
63 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
64 };
65
66 modem_rssi_medium {
67 label = "green:modem-rssi-medium";
68 gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
69 };
70
71 modem_rssi_high {
72 label = "green:modem-rssi-high";
73 gpios = <&gpio 30 GPIO_ACTIVE_LOW>;
74 };
75
76 modem_rssi_highest {
77 label = "green:modem-rssi-highest";
78 gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
79 };
80 };
81 };
82
83 &spi0 {
84 status = "okay";
85
86 flash@0 {
87 compatible = "jedec,spi-nor";
88 reg = <0>;
89 spi-max-frequency = <14000000>;
90
91 partitions {
92 compatible = "fixed-partitions";
93 #address-cells = <1>;
94 #size-cells = <1>;
95
96 partition@0 {
97 label = "bootloader";
98 reg = <0x0 0x30000>;
99 read-only;
100 };
101
102 partition@30000 {
103 label = "config";
104 reg = <0x30000 0x10000>;
105 read-only;
106 };
107
108 factory: partition@40000 {
109 label = "factory";
110 reg = <0x40000 0x10000>;
111 read-only;
112
113 nvmem-layout {
114 compatible = "fixed-layout";
115 #address-cells = <1>;
116 #size-cells = <1>;
117
118 eeprom_factory_0: eeprom@0 {
119 reg = <0x0 0x400>;
120 };
121
122 eeprom_factory_8000: eeprom@8000 {
123 reg = <0x8000 0x200>;
124 };
125
126 macaddr_factory_e006: macaddr@e006 {
127 reg = <0xe006 0x6>;
128 };
129 };
130 };
131
132 firmware: partition@50000 {
133 compatible = "denx,uimage";
134 label = "firmware";
135 reg = <0x50000 0xfb0000>;
136 };
137 };
138 };
139 };
140
141 &ethernet {
142 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
143 };
144
145 &gmac0 {
146 nvmem-cells = <&macaddr_factory_e006>;
147 nvmem-cell-names = "mac-address";
148 };
149
150 &switch0 {
151 ports {
152 port@0 {
153 status = "okay";
154 label = "lan1";
155 };
156
157 port@1 {
158 status = "okay";
159 label = "lan2";
160 };
161
162 port@2 {
163 status = "okay";
164 label = "lan3";
165 };
166
167 port@3 {
168 status = "okay";
169 label = "lan4";
170 };
171
172 port@4 {
173 status = "okay";
174 label = "wan";
175 nvmem-cells = <&macaddr_factory_e006>;
176 nvmem-cell-names = "mac-address";
177 mac-address-increment = <1>;
178 };
179 };
180 };
181
182 &state_default {
183 gpio {
184 groups = "wdt", "rgmii2";
185 function = "gpio";
186 };
187 };
188
189 &pcie {
190 status = "okay";
191 };
192
193 &pcie0 {
194 wifi@0,0 {
195 compatible = "pci14c3,7603";
196 reg = <0x0000 0 0 0 0>;
197 nvmem-cells = <&eeprom_factory_0>;
198 nvmem-cell-names = "eeprom";
199 ieee80211-freq-limit = <2400000 2500000>;
200 };
201 };
202
203 &pcie1 {
204 wifi@0,0 {
205 compatible = "pci14c3,7662";
206 reg = <0x0000 0 0 0 0>;
207 nvmem-cells = <&eeprom_factory_8000>;
208 nvmem-cell-names = "eeprom";
209 ieee80211-freq-limit = <5000000 6000000>;
210
211 led {
212 led-sources = <2>;
213 };
214 };
215 };