ramips: Add support for Cudy WR1300 v3
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_tplink_eap235-wall-v1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "tplink,eap235-wall-v1", "mediatek,mt7621-soc";
11 model = "TP-Link EAP235-Wall v1";
12
13 aliases {
14 label-mac-device = &gmac0;
15 led-boot = &led_status;
16 led-failsafe = &led_status;
17 led-running = &led_status;
18 led-upgrade = &led_status;
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 led_status: status {
25 label = "white:status";
26 color = <LED_COLOR_ID_WHITE>;
27 function = LED_FUNCTION_STATUS;
28 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
29 };
30 };
31
32 keys {
33 compatible = "gpio-keys";
34
35 led {
36 label = "led";
37 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
38 linux,code = <KEY_LIGHTS_TOGGLE>;
39 };
40
41 reset {
42 label = "reset";
43 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
44 linux,code = <KEY_RESTART>;
45 };
46 };
47
48 gpio-export {
49 compatible = "gpio-export";
50
51 poe_passthrough {
52 gpio-export,name = "poe-passthrough";
53 gpio-export,output = <0>;
54 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
55 };
56 };
57 };
58
59 &spi0 {
60 status = "okay";
61
62 flash@0 {
63 compatible = "jedec,spi-nor";
64 reg = <0>;
65 spi-max-frequency = <20000000>;
66
67 partitions {
68 compatible = "fixed-partitions";
69 #address-cells = <1>;
70 #size-cells = <1>;
71
72 partition@0 {
73 label = "u-boot";
74 reg = <0x00000 0x80000>;
75 read-only;
76 };
77
78 partition@80000 {
79 label = "partition-table";
80 reg = <0x80000 0x10000>;
81 read-only;
82 };
83
84 info: partition@90000 {
85 compatible = "nvmem-cells";
86 label = "product-info";
87 reg = <0x90000 0x10000>;
88 #address-cells = <1>;
89 #size-cells = <1>;
90 read-only;
91
92 macaddr_info_8: macaddr@8 {
93 reg = <0x8 0x6>;
94 };
95 };
96
97 partition@a0000 {
98 compatible = "tplink,firmware";
99 label = "firmware";
100 reg = <0x0a0000 0xd20000>;
101 };
102
103 partition@dc0000 {
104 label = "user-config";
105 reg = <0xdc0000 0x030000>;
106 read-only;
107 };
108
109 /* 0xdf0000 - 0xf30000 unused */
110
111 partition@f30000 {
112 label = "mutil-log";
113 reg = <0xf30000 0x080000>;
114 read-only;
115 };
116
117 partition@fb0000 {
118 label = "oops";
119 reg = <0xfb0000 0x040000>;
120 read-only;
121 };
122
123 radio: partition@ff0000 {
124 compatible = "nvmem-cells";
125 label = "radio";
126 reg = <0xff0000 0x010000>;
127 #address-cells = <1>;
128 #size-cells = <1>;
129 read-only;
130
131 eeprom_radio_0: eeprom@0 {
132 reg = <0x0 0x400>;
133 };
134
135 eeprom_radio_8000: eeprom@8000 {
136 reg = <0x8000 0x4da8>;
137 };
138 };
139 };
140 };
141 };
142
143 &state_default {
144 gpio {
145 groups = "uart2", "uart3";
146 function = "gpio";
147 };
148 };
149
150 &pcie {
151 status = "okay";
152 };
153
154 &pcie0 {
155 wifi@0,0 {
156 reg = <0x0000 0 0 0 0>;
157 nvmem-cells = <&eeprom_radio_0>, <&macaddr_info_8>;
158 nvmem-cell-names = "eeprom", "mac-address";
159 };
160 };
161
162 &pcie1 {
163 wifi@0,0 {
164 reg = <0x0000 0 0 0 0>;
165 ieee80211-freq-limit = <5000000 6000000>;
166 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_info_8>;
167 nvmem-cell-names = "eeprom", "mac-address";
168 mac-address-increment = <1>;
169 };
170 };
171
172 &gmac0 {
173 nvmem-cells = <&macaddr_info_8>;
174 nvmem-cell-names = "mac-address";
175 };
176
177 &gmac1 {
178 status = "okay";
179 label = "lan0";
180 phy-handle = <&ethphy0>;
181
182 nvmem-cells = <&macaddr_info_8>;
183 nvmem-cell-names = "mac-address";
184 };
185
186 &mdio {
187 ethphy0: ethernet-phy@0 {
188 reg = <0>;
189 };
190 };
191
192 &switch0 {
193 ports {
194 port@1 {
195 status = "okay";
196 label = "lan3";
197 };
198
199 port@2 {
200 status = "okay";
201 label = "lan2";
202 };
203
204 port@3 {
205 status = "okay";
206 label = "lan1";
207 };
208 };
209 };