ramips: improve netis WF-2881 support
[oweals/openwrt.git] / target / linux / ramips / dts / mt7621_telco-electronics_x1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 /dts-v1/;
4
5 #include "mt7621.dtsi"
6
7 #include <dt-bindings/gpio/gpio.h>
8 #include <dt-bindings/input/input.h>
9
10 / {
11         compatible = "telco-electronics,x1", "mediatek,mt7621-soc";
12         model = "Telco Electronics X1";
13
14         aliases {
15                 led-boot = &system_led;
16                 led-failsafe = &system_led;
17                 led-running = &system_led;
18                 led-upgrade = &system_led;
19         };
20
21         chosen {
22                 bootargs = "console=ttyS0,115200";
23         };
24
25         keys {
26                 compatible = "gpio-keys";
27
28                 reset {
29                         label = "reset";
30                         gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
31                         linux,code = <KEY_RESTART>;
32                 };
33         };
34
35         leds {
36                 compatible = "gpio-leds";
37
38                 system_led: system {
39                         label = "x1:green:system";
40                         gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
41                 };
42
43                 modem_offline {
44                         label = "x1:red:modem-offline";
45                         gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
46                 };
47
48                 modem_4g {
49                         label = "x1:blue:modem-4g";
50                         gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
51                 };
52
53                 modem_3g {
54                         label = "x1:green:modem-3g";
55                         gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
56                 };
57
58                 modem_rssi_lowest {
59                         label = "x1:green:modem-rssi-lowest";
60                         gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
61                 };
62
63                 modem_rssi_low {
64                         label = "x1:green:modem-rssi-low";
65                         gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
66                 };
67
68                 modem_rssi_medium {
69                         label = "x1:green:modem-rssi-medium";
70                         gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
71                 };
72
73                 modem_rssi_high {
74                         label = "x1:green:modem-rssi-high";
75                         gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
76                 };
77
78                 modem_rssi_highest {
79                         label = "x1:green:modem-rssi-highest";
80                         gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
81                 };
82         };
83 };
84
85 &spi0 {
86         status = "okay";
87
88         flash@0 {
89                 compatible = "jedec,spi-nor";
90                 reg = <0>;
91                 spi-max-frequency = <14000000>;
92
93                 partitions {
94                         compatible = "fixed-partitions";
95                         #address-cells = <1>;
96                         #size-cells = <1>;
97
98                         partition@0 {
99                                 label = "bootloader";
100                                 reg = <0x0 0x30000>;
101                                 read-only;
102                         };
103
104                         partition@30000 {
105                                 label = "config";
106                                 reg = <0x30000 0x10000>;
107                                 read-only;
108                         };
109
110                         factory: partition@40000 {
111                                 label = "factory";
112                                 reg = <0x40000 0x10000>;
113                                 read-only;
114                         };
115
116                         firmware: partition@50000 {
117                                 compatible = "denx,uimage";
118                                 label = "firmware";
119                                 reg = <0x50000 0xfb0000>;
120                         };
121                 };
122         };
123 };
124
125 &gpio0 {
126         status = "okay";
127 };
128
129 &ethernet {
130         mtd-mac-address = <&factory 0xe006>;
131         mediatek,portmap = "llllw";
132 };
133
134 &pinctrl {
135         state_default: pinctrl0 {
136                 gpio {
137                         ralink,group = "jtag", "uart2", "wdt", "rgmii2";
138                         ralink,function = "gpio";
139                 };
140         };
141 };
142
143 &pcie {
144         status = "okay";
145
146         pcie0 {
147                 wifi@0,0 {
148                         compatible = "pci14c3,7603";
149                         reg = <0x0000 0 0 0 0>;
150                         mediatek,mtd-eeprom = <&factory 0x0000>;
151                         ieee80211-freq-limit = <2400000 2500000>;
152                 };
153         };
154
155         pcie1 {
156                 wifi@0,0 {
157                         compatible = "pci14c3,7662";
158                         reg = <0x0000 0 0 0 0>;
159                         mediatek,mtd-eeprom = <&factory 0x8000>;
160                         ieee80211-freq-limit = <5000000 6000000>;
161                         led {
162                                 led-sources = <2>;
163                         };
164                 };
165         };
166 };