ramips: add support for ALFA Network Quad-E4G
[oweals/openwrt.git] / target / linux / ramips / dts / mt7628an_xiaomi_mir4a-100m.dts
1 //SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7628an.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10         compatible = "xiaomi,mir4a-100m", "mediatek,mt7628an-soc";
11         model = "Xiaomi Mi Router 4A (100M Edition)";
12
13         chosen {
14                 bootargs = "console=ttyS0,115200";
15         };
16
17         aliases {
18                 led-boot = &power_yellow;
19                 led-failsafe = &power_yellow;
20                 led-running = &power_blue;
21                 led-upgrade = &power_yellow;
22         };
23
24         leds {
25                 compatible = "gpio-leds";
26
27                 power_blue: power_blue {
28                         label = "mir4a-100m:blue:power";
29                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
30                 };
31
32                 power_yellow: power_yellow {
33                         label = "mir4a-100m:yellow:power";
34                         gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
35                 };
36         };
37
38         keys {
39                 compatible = "gpio-keys";
40
41                 reset {
42                         label = "reset";
43                         gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
44                         linux,code = <KEY_RESTART>;
45                 };
46         };
47 };
48
49 &spi0 {
50         status = "okay";
51
52         flash@0 {
53                 compatible = "jedec,spi-nor";
54                 reg = <0>;
55                 spi-max-frequency = <10000000>;
56
57                 partitions {
58                         compatible = "fixed-partitions";
59                         #address-cells = <1>;
60                         #size-cells = <1>;
61
62                         partition@0 {
63                                 label = "bootloader";
64                                 reg = <0x0 0x20000>;
65                                 read-only;
66                         };
67
68                         partition@20000 {
69                                 label = "config";
70                                 reg = <0x20000 0x10000>;
71                                 read-only;
72                         };
73
74                         factory: partition@30000 {
75                                 label = "factory";
76                                 reg = <0x30000 0x10000>;
77                                 read-only;
78                         };
79
80                         partition@40000 {
81                                 label = "crash";
82                                 reg = <0x40000 0x10000>;
83                                 read-only;
84                         };
85
86                         partition@50000 {
87                                 label = "cfg_bak";
88                                 reg = <0x50000 0x10000>;
89                                 read-only;
90                         };
91
92                         partition@60000 {
93                                 label = "overlay";
94                                 reg = <0x60000 0x100000>;
95                                 read-only;
96                         };
97
98                         partition@160000 {
99                                 label = "firmware";
100                                 reg = <0x160000 0xea0000>;
101                                 compatible = "denx,uimage";
102                         };
103                 };
104         };
105 };
106
107 &pcie {
108         status = "okay";
109 };
110
111 &pcie0 {
112         wifi@0,0 {
113                 compatible = "mediatek,mt76";
114                 reg = <0x0000 0 0 0 0>;
115                 mediatek,mtd-eeprom = <&factory 0x8000>;
116                 ieee80211-freq-limit = <5000000 6000000>;
117         };
118 };
119
120 &pinctrl {
121         state_default: pinctrl0 {
122                 gpio {
123                         ralink,group = "gpio", "wdt", "wled_an";
124                         ralink,function = "gpio";
125                 };
126         };
127 };
128
129 &ethernet {
130         mtd-mac-address = <&factory 0x4>;
131         mtd-mac-address-increment = <(-1)>;
132 };
133
134 &esw {
135         mediatek,portmap = <0x2f>;
136         mediatek,portdisable = <0x2a>;
137 };
138
139 &wmac {
140         status = "okay";
141 };