ramips: add support for TP-Link RE200 v1
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_head-weblink_hdrm200.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7620a.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10         compatible = "head-weblink,hdrm200", "ralink,mt7620a-soc";
11         model = "Head Weblink HDRM200";
12
13         aliases {
14                 led-boot = &led_system;
15                 led-failsafe = &led_system;
16                 led-running = &led_system;
17                 led-upgrade = &led_system;
18         };
19
20         chosen {
21                 bootargs = "console=ttyS1,57600";
22         };
23
24         leds {
25                 compatible = "gpio-leds";
26
27                 rssi {
28                         label = "hdrm200:red:rssi";
29                         gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
30                 };
31
32                 led_system: system {
33                         label = "hdrm200:green:system";
34                         gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
35                 };
36
37                 air {
38                         label = "hdrm200:green:wifi";
39                         gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
40                 };
41         };
42
43         keys {
44                 compatible = "gpio-keys";
45
46                 wps {
47                         label = "wps";
48                         gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
49                         linux,code = <KEY_WPS_BUTTON>;
50                 };
51
52                 reset {
53                         label = "reset";
54                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
55                         linux,code = <KEY_RESTART>;
56                 };
57         };
58 };
59
60 &spi0 {
61         status = "okay";
62
63         flash@0 {
64                 compatible = "jedec,spi-nor";
65                 reg = <0>;
66                 spi-max-frequency = <10000000>;
67
68                 partitions {
69                         compatible = "fixed-partitions";
70                         #address-cells = <1>;
71                         #size-cells = <1>;
72
73                         partition@0 {
74                                 label = "u-boot";
75                                 reg = <0x0 0x30000>;
76                                 read-only;
77                         };
78
79                         partition@30000 {
80                                 label = "u-boot-env";
81                                 reg = <0x30000 0x10000>;
82                                 read-only;
83                         };
84
85                         factory: partition@40000 {
86                                 label = "factory";
87                                 reg = <0x40000 0x10000>;
88                                 read-only;
89                         };
90
91                         firmware: partition@50000 {
92                                 compatible = "denx,uimage";
93                                 label = "firmware";
94                                 reg = <0x50000 0xfb0000>;
95                         };
96                 };
97         };
98 };
99
100 &gpio0 {
101         status = "okay";
102 };
103
104 &gpio1 {
105         status = "okay";
106 };
107
108 &gpio3 {
109         status = "okay";
110 };
111
112 &sdhci {
113         status = "okay";
114 };
115
116 &ehci {
117         status = "okay";
118 };
119
120 &ohci {
121         status = "okay";
122 };
123
124 &ethernet {
125         status = "okay";
126
127         mtd-mac-address = <&factory 0x4>;
128         pinctrl-names = "default";
129         pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
130
131         port@4 {
132                 status = "okay";
133                 phy-handle = <&phy4>;
134                 phy-mode = "rgmii";
135         };
136
137         port@5 {
138                 status = "okay";
139                 phy-handle = <&phy5>;
140                 phy-mode = "rgmii";
141         };
142
143         mdio-bus {
144                 status = "okay";
145
146                 phy4: ethernet-phy@4 {
147                         reg = <4>;
148                         phy-mode = "rgmii";
149                 };
150
151                 phy5: ethernet-phy@5 {
152                         reg = <5>;
153                         phy-mode = "rgmii";
154                 };
155         };
156 };
157
158 &wmac {
159         ralink,mtd-eeprom = <&factory 0>;
160 };
161
162 &state_default {
163         default {
164                 ralink,group = "i2c", "uartf", "pa", "spi refclk",
165                                "wled";
166                 ralink,function = "gpio";
167         };
168 };
169
170 &pcie {
171         status = "okay";
172 };
173
174 &pcie0 {
175         wifi@0,0 {
176                 compatible = "mediatek,mt76";
177                 reg = <0x0000 0 0 0 0>;
178                 mediatek,mtd-eeprom = <&factory 0x8000>;
179                 ieee80211-freq-limit = <5000000 6000000>;
180         };
181 };
182
183 &uart {
184         status = "okay";
185 };