e4c737b8ffd03c45b08a494e9bd01db4585734a9
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9561_xiaomi_mi-router-4q.dts
1 // SPDX-License-Identifier: GPL-2.0+ OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "qca956x.dtsi"
8
9 / {
10         compatible = "xiaomi,mi-router-4q", "qca,qca9560";
11         model = "Xiaomi Mi Router 4Q";
12
13         aliases {
14                 led-boot = &led_yellow;
15                 led-failsafe = &led_red;
16                 led-running = &led_blue;
17                 led-upgrade = &led_red;
18         };
19
20         chosen {
21                 bootargs = "console=ttyS0,115200n8";
22         };
23
24         keys {
25                 compatible = "gpio-keys";
26
27                 reset {
28                         label = "Reset button";
29                         linux,code = <KEY_RESTART>;
30                         gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
31                 };
32
33                 wps {
34                         label = "WPS/MI button";
35                         linux,code = <KEY_WPS_BUTTON>;
36                         gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
37                 };
38         };
39
40         leds {
41                 compatible = "gpio-leds";
42
43                 led_red: led_red {
44                         label = "mi-router-4q:red:led";
45                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
46                 };
47
48                 led_yellow: led_yellow {
49                         label = "mi-router-4q:yellow:led";
50                         gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
51                 };
52
53                 led_blue: led_blue {
54                         label = "mi-router-4q:blue:led";
55                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
56                 };
57         };
58 };
59
60 &uart {
61         status = "okay";
62 };
63
64 &gpio {
65         status = "okay";
66 };
67
68 &spi {
69         status = "okay";
70         num-cs = <1>;
71
72         flash@0 {
73                 compatible = "jedec,spi-nor";
74                 reg = <0>;
75                 spi-max-frequency = <25000000>;
76
77                 partitions {
78                         compatible = "fixed-partitions";
79                         #address-cells = <1>;
80                         #size-cells = <1>;
81
82                         partition@0 {
83                                 label = "u-boot";
84                                 reg = <0x000000 0x30000>;
85                                 read-only;
86                         };
87
88                         partition@30000 {
89                                 label = "nvram";
90                                 reg = <0x030000 0x10000>;
91                                 read-only;
92                         };
93
94                         partition@40000 {
95                                 label = "boarddata";
96                                 reg = <0x40000 0x10000>;
97                                 read-only;
98                         };
99
100                         partition@50000 {
101                                 label = "crash";
102                                 reg = <0x50000 0x10000>;
103                                 read-only;
104                         };
105
106                         art: partition@60000 {
107                                 label = "art";
108                                 reg = <0x60000 0x10000>;
109                                 read-only;
110                         };
111
112                         partition@70000 {
113                                 label = "cfg_bak";
114                                 reg = <0x70000 0x20000>;
115                                 read-only;
116                         };
117
118                         partition@90000 {
119                                 label = "overlay";
120                                 reg = <0x90000 0x170000>;
121                                 read-only;
122                         };
123
124                         partition@200000 {
125                                 compatible = "denx,uimage";
126                                 label = "firmware";
127                                 reg = <0x200000 0xe00000>;
128                         };
129                 };
130         };
131 };
132
133 &eth0 {
134         status = "okay";
135
136         phy-handle = <&swphy4>;
137         mtd-mac-address = <&art 0x0>;
138 };
139
140 &eth1 {
141         status = "okay";
142
143         mtd-mac-address = <&art 0x6>;
144 };
145
146 &wmac {
147         status = "okay";
148
149         mtd-cal-data = <&art 0x1000>;
150         mtd-mac-address = <&art 0x0>;
151         mtd-mac-address-increment = <1>;
152 };