ramips: add support for TP-Link RE305 v1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_tplink_re305-v1.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 = "tplink,re305-v1", "mediatek,mt7628an-soc";
11 model = "TP-Link RE305 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,57600";
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 reset {
29 label = "reset";
30 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33
34 wps {
35 label = "wps";
36 gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_WPS_BUTTON>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 led_power: power {
45 label = "re305-v1:blue:power";
46 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
47 };
48
49 wlan2g {
50 label = "re305-v1:blue:wlan2g";
51 gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
52 linux,default-trigger = "phy0tpt";
53 };
54
55 wlan5g {
56 label = "re305-v1:blue:wlan5g";
57 gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
58 linux,default-trigger = "phy1tpt";
59 };
60
61 rssi1 {
62 label = "re305-v1:red:rssi";
63 gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
64 };
65
66 rssi2 {
67 label = "re305-v1:blue:rssi";
68 gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
69 };
70 };
71 };
72
73 &spi0 {
74 status = "okay";
75
76 flash@0 {
77 compatible = "jedec,spi-nor";
78 reg = <0>;
79 spi-max-frequency = <50000000>;
80
81 partitions {
82 compatible = "fixed-partitions";
83 #address-cells = <1>;
84 #size-cells = <1>;
85
86 partition@0 {
87 label = "u-boot";
88 reg = <0x0 0x20000>;
89 read-only;
90 };
91
92 partition@20000 {
93 compatible = "tplink,firmware";
94 label = "firmware";
95 reg = <0x20000 0x5e0000>;
96 };
97
98 config: partition@600000 {
99 label = "config";
100 reg = <0x600000 0x50000>;
101 read-only;
102 };
103
104 /*
105 The flash space between 0x650000 and 0x7f0000 is blank in the
106 stock firmware so it is left out as well.
107 */
108
109 radio: partition@7f0000 {
110 label = "radio";
111 reg = <0x7f0000 0x10000>;
112 read-only;
113 };
114 };
115 };
116 };
117
118 &state_default {
119 gpio {
120 ralink,group = "refclk", "wdt", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an";
121 ralink,function = "gpio";
122 };
123 };
124
125 &pcie {
126 status = "okay";
127 };
128
129 &pcie0 {
130 mt76@0,0 {
131 compatible = "mediatek,mt76";
132 reg = <0x0000 0 0 0 0>;
133 mediatek,mtd-eeprom = <&radio 0x8000>;
134 ieee80211-freq-limit = <5000000 6000000>;
135 mtd-mac-address = <&config 0x10008>;
136 mtd-mac-address-increment = <2>;
137 };
138 };
139
140 &wmac {
141 status = "okay";
142
143 mediatek,mtd-eeprom = <&radio 0x0>;
144 mtd-mac-address = <&config 0x10008>;
145 mtd-mac-address-increment = <1>;
146 };
147
148 &ethernet {
149 mtd-mac-address = <&config 0x10008>;
150 };