ramips: add support for TP-Link RE200 v1
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_tplink_re200-v1.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 = "tplink,re200-v1", "ralink,mt7620a-soc";
11         model = "TP-Link RE200 v1";
12
13         aliases {
14                 led-boot = &led_power;
15                 led-failsafe = &led_power;
16                 led-running = &led_power;
17                 led-upgrade = &led_power;
18                 label-mac-device = &ethernet;
19         };
20
21         chosen {
22                 bootargs = "console=ttyS0,57600n8";
23         };
24
25         leds {
26                 compatible = "gpio-leds";
27
28                 led_power: power {
29                         label = "re200-v1:green:power";
30                         gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
31                 };
32
33                 lan {
34                         label = "re200-v1:green:lan";
35                         gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
36                 };
37
38                 wlan {
39                         label = "re200-v1:green:wlan";
40                         gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
41                 };
42
43                 qss {
44                         label = "re200-v1:green:qss";
45                         gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
46                 };
47
48                 wlan2g_red {
49                         label = "re200-v1:red:wlan2g";
50                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
51                 };
52
53                 wlan2g_green {
54                         label = "re200-v1:green:wlan2g";
55                         gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
56                         linux,default-trigger = "phy1radio";
57                 };
58         };
59
60         keys {
61                 compatible = "gpio-keys";
62
63                 reset {
64                         label = "reset";
65                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
66                         linux,code = <KEY_RESTART>;
67                 };
68
69                 wps {
70                         label = "wps";
71                         gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
72                         linux,code = <KEY_WPS_BUTTON>;
73                 };
74         };
75 };
76
77
78 &state_default {
79         gpio {
80                 ralink,group = "i2c", "uartf", "ephy", "wled", "rgmii1", "spi refclk";
81                 ralink,function = "gpio";
82         };
83 };
84
85 &spi0 {
86         status = "okay";
87
88         flash@0 {
89                 compatible = "jedec,spi-nor";
90                 reg = <0>;
91                 spi-max-frequency = <50000000>;
92
93                 partitions {
94                         compatible = "fixed-partitions";
95                         #address-cells = <1>;
96                         #size-cells = <1>;
97
98                         uboot: partition@0 {
99                                 label = "u-boot";
100                                 reg = <0x0 0x20000>;
101                                 read-only;
102                         };
103
104                         partition@20000 {
105                                 compatible = "tplink,firmware";
106                                 label = "firmware";
107                                 reg = <0x20000 0x7c0000>;
108                         };
109
110                         partition@7e0000 {
111                                 label = "userconfig";
112                                 reg = <0x7e0000 0x10000>;
113                                 read-only;
114                         };
115
116                         radio: partition@7f0000 {
117                                 label = "radio";
118                                 reg = <0x7f0000 0x10000>;
119                                 read-only;
120                         };
121                 };
122         };
123 };
124
125 &gpio1 {
126         status = "okay";
127 };
128
129 &gpio2 {
130         status = "okay";
131 };
132
133 &gpio3 {
134         status = "okay";
135 };
136
137 &ethernet {
138         mtd-mac-address = <&uboot 0x1fc00>;
139 };
140
141 &wmac {
142         ralink,mtd-eeprom = <&radio 0x0>;
143         mtd-mac-address = <&uboot 0x1fc00>;
144 };
145
146 &pcie {
147         status = "okay";
148 };
149
150 &pcie0 {
151         mt76@0,0 {
152                 reg = <0x0000 0 0 0 0>;
153                 mediatek,mtd-eeprom = <&radio 0x8000>;
154                 mtd-mac-address = <&uboot 0x1fc00>;
155                 mtd-mac-address-increment = <2>;
156                 ieee80211-freq-limit = <5000000 6000000>;
157         };
158 };