ramips: fix switch setup for Xiaomi MiWiFi Nano
[oweals/openwrt.git] / target / linux / ramips / dts / mt7621_gehua_ghl-r-001.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7621.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10         compatible = "gehua,ghl-r-001", "mediatek,mt7621-soc";
11         model = "GeHua GHL-R-001";
12
13         chosen {
14                 bootargs = "console=ttyS0,57600";
15         };
16
17         leds {
18                 compatible = "gpio-leds";
19
20                 internet {
21                         label = "ghl-r-001:blue:internet";
22                         gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
23                 };
24
25                 usb {
26                         label = "ghl-r-001:blue:usb";
27                         gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
28                         trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
29                         linux,default-trigger = "usbport";
30                 };
31         };
32
33         keys {
34                 compatible = "gpio-keys";
35
36                 reset {
37                         label = "reset";
38                         gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
39                         linux,code = <KEY_RESTART>;
40                 };
41         };
42 };
43
44 &uartlite3 {
45         status = "okay";
46 };
47
48 &spi0 {
49         status = "okay";
50
51         flash@0 {
52                 compatible = "mx25l25635f", "jedec,spi-nor";
53                 reg = <0>;
54                 spi-max-frequency = <25000000>;
55                 m25p,fast-read;
56
57                 partitions {
58                         compatible = "fixed-partitions";
59                         #address-cells = <1>;
60                         #size-cells = <1>;
61
62                         partition@0 {
63                                 label = "u-boot";
64                                 reg = <0x0 0x30000>;
65                                 read-only;
66                         };
67
68                         partition@30000 {
69                                 label = "u-boot-env";
70                                 reg = <0x30000 0x10000>;
71                                 read-only;
72                         };
73
74                         factory: partition@40000 {
75                                 label = "factory";
76                                 reg = <0x40000 0x10000>;
77                                 read-only;
78                         };
79
80                         partition@50000 {
81                                 compatible = "denx,uimage";
82                                 label = "firmware";
83                                 reg = <0x50000 0x1fb0000>;
84                         };
85                 };
86         };
87 };
88
89 &pcie {
90         status = "okay";
91 };
92
93 &pcie0 {
94         wifi@0,0 {
95                 reg = <0x0000 0 0 0 0>;
96                 mediatek,mtd-eeprom = <&factory 0x0000>;
97         };
98 };
99
100 &pcie1 {
101         wifi@0,0 {
102                 reg = <0x0000 0 0 0 0>;
103                 mediatek,mtd-eeprom = <&factory 0x8000>;
104                 ieee80211-freq-limit = <5000000 6000000>;
105
106                 led {
107                         led-sources = <2>;
108                         led-active-low;
109                 };
110         };
111 };
112
113 &ethernet {
114         mtd-mac-address = <&factory 0xe000>;
115 };
116
117 &state_default {
118         gpio {
119                 ralink,group = "jtag", "wdt";
120                 ralink,function = "gpio";
121         };
122 };