ramips: add support for XiaoYu XY-C5
[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-polled";
40                 poll-interval = <20>;
41
42                 reset {
43                         label = "reset";
44                         gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
45                         linux,code = <KEY_RESTART>;
46                 };
47         };
48 };
49
50 &spi0 {
51         status = "okay";
52
53         flash@0 {
54                 compatible = "jedec,spi-nor";
55                 reg = <0>;
56                 spi-max-frequency = <10000000>;
57
58                 partitions {
59                         compatible = "fixed-partitions";
60                         #address-cells = <1>;
61                         #size-cells = <1>;
62
63                         partition@0 {
64                                 label = "bootloader";
65                                 reg = <0x0 0x20000>;
66                                 read-only;
67                         };
68
69                         partition@20000 {
70                                 label = "config";
71                                 reg = <0x20000 0x10000>;
72                                 read-only;
73                         };
74
75                         factory: partition@30000 {
76                                 label = "factory";
77                                 reg = <0x30000 0x10000>;
78                                 read-only;
79                         };
80
81                         partition@40000 {
82                                 label = "crash";
83                                 reg = <0x40000 0x10000>;
84                                 read-only;
85                         };
86
87                         partition@50000 {
88                                 label = "cfg_bak";
89                                 reg = <0x50000 0x10000>;
90                                 read-only;
91                         };
92
93                         partition@60000 {
94                                 label = "overlay";
95                                 reg = <0x60000 0x100000>;
96                                 read-only;
97                         };
98
99                         partition@160000 {
100                                 label = "firmware";
101                                 reg = <0x160000 0xea0000>;
102                                 compatible = "denx,uimage";
103                         };
104                 };
105         };
106 };
107
108 &pcie {
109         status = "okay";
110 };
111
112 &pcie0 {
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 &pinctrl {
122         state_default: pinctrl0 {
123                 gpio {
124                         ralink,group = "gpio", "wdt", "wled_an";
125                         ralink,function = "gpio";
126                 };
127         };
128 };
129
130 &ethernet {
131         mtd-mac-address = <&factory 0x4>;
132         mtd-mac-address-increment = <(-1)>;
133 };
134
135 &esw {
136         mediatek,portmap = <0x2f>;
137         mediatek,portdisable = <0x2a>;
138 };
139
140 &wmac {
141         status = "okay";
142 };