95addff3c02652e95f31095da49a5ffc4b7237a4
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_tplink_re200.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7628an.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 aliases {
10 label-mac-device = &ethernet;
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,57600n8";
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29
30 wps {
31 label = "wps";
32 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
33 linux,code = <KEY_WPS_BUTTON>;
34 };
35 };
36
37 leds {
38 compatible = "gpio-leds";
39
40 wps {
41 label = "green:wps";
42 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
43 };
44
45 wifi {
46 label = "green:wifi";
47 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
48 };
49
50 lan {
51 label = "green:lan";
52 gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
53 };
54
55 led_power: power {
56 label = "green:power";
57 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
58 };
59
60 wifi2g_green {
61 label = "green:wifi2g";
62 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
63 linux,default-trigger = "phy0tpt";
64 };
65
66 wifi5g_green {
67 label = "green:wifi5g";
68 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
69 linux,default-trigger = "phy1tpt";
70 };
71
72 wifi2g_red {
73 label = "red:wifi2g";
74 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
75 };
76
77 wifi5g_red {
78 label = "red:wifi5g";
79 gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
80 };
81 };
82 };
83
84 &spi0 {
85 status = "okay";
86
87 flash@0 {
88 compatible = "jedec,spi-nor";
89 reg = <0>;
90 spi-max-frequency = <50000000>;
91
92 partitions {
93 compatible = "fixed-partitions";
94 #address-cells = <1>;
95 #size-cells = <1>;
96
97 partition@0 {
98 label = "u-boot";
99 reg = <0x0 0x20000>;
100 read-only;
101 };
102
103 partition@20000 {
104 compatible = "tplink,firmware";
105 label = "firmware";
106 reg = <0x20000 0x7a0000>;
107 };
108
109 config: partition@7c0000 {
110 label = "config";
111 reg = <0x7c0000 0x30000>;
112 read-only;
113 };
114
115 radio: partition@7f0000 {
116 label = "radio";
117 reg = <0x7f0000 0x10000>;
118 read-only;
119 };
120 };
121 };
122 };
123
124 &state_default {
125 gpio {
126 groups = "p4led_an", "p3led_an", "p2led_an", "p1led_an",
127 "p0led_an", "wled_an", "i2c", "wdt", "refclk";
128 function = "gpio";
129 };
130 };
131
132 &ethernet {
133 mtd-mac-address = <&config 0x2008>;
134 };
135
136 &wmac {
137 status = "okay";
138
139 mediatek,mtd-eeprom = <&radio 0x0>;
140 mtd-mac-address = <&config 0x2008>;
141 mtd-mac-address-increment = <1>;
142 };
143
144 &pcie {
145 status = "okay";
146 };
147
148 &pcie0 {
149 mt76@0,0 {
150 reg = <0x0000 0 0 0 0>;
151 mediatek,mtd-eeprom = <&radio 0x8000>;
152 ieee80211-freq-limit = <5000000 6000000>;
153 mtd-mac-address = <&config 0x2008>;
154 mtd-mac-address-increment = <2>;
155 };
156 };