ramips: improve Xiaomi mi-mini indications
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_snr_snr-cpe-me1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #include "mt7621.dtsi"
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/leds/common.h>
7
8 / {
9 compatible = "snr,snr-cpe-me1", "mediatek,mt7621-soc";
10 model = "SNR-CPE-ME1";
11
12 aliases {
13 label-mac-device = &gmac1;
14
15 led-boot = &led_usb;
16 led-failsafe = &led_vpn;
17 led-running = &led_green;
18 led-upgrade = &led_sys;
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 led_usb: led-0 { // USB Activity
25 color = <LED_COLOR_ID_GREEN>;
26 function = LED_FUNCTION_USB;
27 gpios = <&gpio 13 GPIO_ACTIVE_LOW>; // [JTAG] JTDO
28 };
29
30 led_vpn: led-1 { // VPN Activity
31 color = <LED_COLOR_ID_GREEN>;
32 function = LED_FUNCTION_INDICATOR;
33 gpios = <&gpio 16 GPIO_ACTIVE_LOW>; // [JTAG] JTCLK
34 };
35
36 led_sys: led-2 { // System config
37 color = <LED_COLOR_ID_GREEN>;
38 function = LED_FUNCTION_STATUS;
39 gpios = <&gpio 3 GPIO_ACTIVE_LOW>; // [I2C] I2C_SD
40 panic-indicator;
41 };
42
43 led_green: led-3 { // ? LED
44 color = <LED_COLOR_ID_GREEN>;
45 function = LED_FUNCTION_HEARTBEAT;
46 gpios = <&gpio 15 GPIO_ACTIVE_LOW>; // [JTAG] JTMS
47 };
48 };
49
50 keys {
51 compatible = "gpio-keys";
52
53 reset {
54 label = "Reset Button";
55 gpios = <&gpio 14 GPIO_ACTIVE_LOW>; // [JTAG] JTDI
56 linux,code = <KEY_RESTART>;
57 };
58 };
59
60 reg_usb_vbus: regulator {
61 compatible = "regulator-fixed";
62 regulator-name = "usb_vbus";
63 regulator-min-microvolt = <5000000>;
64 regulator-max-microvolt = <5000000>;
65 gpio = <&gpio 17 GPIO_ACTIVE_HIGH>;
66 enable-active-high;
67 };
68
69 reg_3p3v: regulator-3p3v {
70 compatible = "regulator-fixed";
71 regulator-name = "fixed-3.3V";
72 regulator-min-microvolt = <3300000>;
73 regulator-max-microvolt = <3300000>;
74 regulator-boot-on;
75 regulator-always-on;
76 };
77 };
78
79 &gmac0 {
80 nvmem-cells = <&macaddr_factory_e000>;
81 nvmem-cell-names = "mac-address";
82 };
83
84 &gmac1 {
85 status = "okay";
86 label = "wan";
87 phy-handle = <&ethphy4>;
88
89 nvmem-cells = <&macaddr_factory_e006>;
90 nvmem-cell-names = "mac-address";
91 };
92
93 &mdio {
94 ethphy4: ethernet-phy@4 {
95 reg = <4>;
96 };
97 };
98
99 &pcie {
100 status = "okay";
101 };
102
103 &pcie0 { // MT7603EN
104 wifi@0,0 {
105 compatible = "mediatek,mt76";
106 reg = <0x0000 0 0 0 0>;
107 mediatek,mtd-eeprom = <&factory 0x0000>;
108 ieee80211-freq-limit = <2400000 2500000>;
109 };
110 };
111
112 &pcie1 { // MT7610EN
113 wifi@0,0 {
114 compatible = "mediatek,mt76";
115 reg = <0x0000 0 0 0 0>;
116 mediatek,mtd-eeprom = <&factory 0x8000>;
117 ieee80211-freq-limit = <5000000 6000000>;
118 };
119 };
120
121 &spi0 {
122 status = "okay";
123
124 flash@0 { // GD25Q128CSIG
125 compatible = "jedec,spi-nor";
126 reg = <0>;
127 spi-max-frequency = <44000000>; // 44 MHz
128
129 partitions {
130 compatible = "fixed-partitions";
131 #address-cells = <1>;
132 #size-cells = <1>;
133
134 partition@0 {
135 label = "Bootloader";
136 reg = <0x0 0x30000>;
137 read-only;
138 };
139
140 partition@30000 {
141 label = "Config";
142 reg = <0x30000 0x10000>;
143 read-only;
144 };
145
146 factory: partition@40000 {
147 label = "Factory";
148 reg = <0x40000 0x10000>;
149 read-only;
150
151 compatible = "nvmem-cells";
152 #address-cells = <1>;
153 #size-cells = <1>;
154
155 macaddr_factory_e000: macaddr@e000 {
156 reg = <0xe000 0x6>;
157 };
158
159 macaddr_factory_e006: macaddr@e006 {
160 reg = <0xe006 0x6>;
161 };
162 };
163
164 partition@50000 {
165 compatible = "openwrt,uimage", "denx,uimage";
166 label = "firmware";
167 reg = <0x50000 0xfb0000>;
168 };
169
170 partition@30001 {
171 label = "uboot-env";
172 reg = <0x30000 0x1000>;
173 };
174 };
175 };
176 };
177
178 &state_default {
179 gpio {
180 groups = "i2c", "jtag";
181 function = "gpio";
182 };
183 };
184
185 &switch0 {
186 ports {
187 port@0 {
188 status = "okay";
189 label = "lan4";
190 };
191
192 port@1 {
193 status = "okay";
194 label = "lan3";
195 };
196
197 port@2 {
198 status = "okay";
199 label = "lan2";
200 };
201
202 port@3 {
203 status = "okay";
204 label = "lan1";
205 };
206 };
207 };
208
209 &xhci {
210 vbus-supply = <&reg_usb_vbus>;
211 vusb33-supply = <&reg_3p3v>;
212 };