mediatek: filogic: add support for Cudy RE3000 v1
[openwrt/openwrt.git] / target / linux / mediatek / dts / mt7981b-cudy-re3000-v1.dts
1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
2
3 /dts-v1/;
4
5 #include <dt-bindings/leds/common.h>
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 #include "mt7981.dtsi"
10
11 / {
12 model = "Cudy RE3000 v1";
13 compatible = "cudy,re3000-v1", "mediatek,mt7981";
14
15 aliases {
16 serial0 = &uart0;
17 label-mac-device = &gmac1;
18 led-boot = &led_status;
19 led-failsafe = &led_status;
20 led-running = &led_status;
21 led-upgrade = &led_status;
22 };
23
24 chosen {
25 stdout-path = "serial0:115200n8";
26 };
27
28 gpio-keys {
29 compatible = "gpio-keys";
30
31 reset {
32 label = "reset";
33 linux,code = <KEY_RESTART>;
34 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
35 };
36
37 wps {
38 label = "wps";
39 linux,code = <KEY_WPS_BUTTON>;
40 gpios = <&pio 0 GPIO_ACTIVE_LOW>;
41 };
42 };
43
44 leds {
45 compatible = "gpio-leds";
46
47 led_status: led@0 {
48 function = LED_FUNCTION_STATUS;
49 color = <LED_COLOR_ID_WHITE>;
50 gpios = <&pio 10 GPIO_ACTIVE_LOW>;
51 };
52
53 led@1 {
54 label = "red:wifi5";
55 gpios = <&pio 7 GPIO_ACTIVE_LOW>;
56 linux,default-trigger = "phy1tpt";
57 };
58
59 led@2 {
60 label = "white:wifi2";
61 gpios = <&pio 6 GPIO_ACTIVE_LOW>;
62 linux,default-trigger = "phy0tpt";
63 };
64
65 led@3 {
66 function = LED_FUNCTION_LAN;
67 color = <LED_COLOR_ID_GREEN>;
68 gpios = <&pio 9 GPIO_ACTIVE_LOW>;
69 };
70
71 led@4 {
72 function = LED_FUNCTION_WPS;
73 color = <LED_COLOR_ID_WHITE>;
74 gpios = <&pio 11 GPIO_ACTIVE_LOW>;
75 };
76 };
77 };
78
79 &uart0 {
80 status = "okay";
81 };
82
83 &watchdog {
84 status = "okay";
85 };
86
87 &eth {
88 pinctrl-names = "default";
89 pinctrl-0 = <&mdio_pins>;
90 status = "okay";
91
92 gmac1: mac@1 {
93 compatible = "mediatek,eth-mac";
94 reg = <1>;
95 phy-mode = "gmii";
96 phy-handle = <&int_gbe_phy>;
97 nvmem-cell-names = "mac-address";
98 nvmem-cells = <&macaddr_bdinfo_de00 0>;
99 };
100 };
101
102 &mdio_bus {
103 switch: switch@1f {
104 compatible = "mediatek,mt7531";
105 reg = <31>;
106 reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
107 };
108 };
109
110 &spi0 {
111 status = "disabled";
112 };
113
114 &spi2 {
115 pinctrl-names = "default";
116 pinctrl-0 = <&spi2_flash_pins>;
117 status = "okay";
118
119 flash@0 {
120 #address-cells = <1>;
121 #size-cells = <1>;
122
123 compatible = "jedec,spi-nor";
124 reg = <0>;
125
126 spi-max-frequency = <25000000>;
127 spi-tx-bus-width = <4>;
128 spi-rx-bus-width = <4>;
129
130 partitions {
131 compatible = "fixed-partitions";
132 #address-cells = <1>;
133 #size-cells = <1>;
134
135 partition@00000 {
136 label = "BL2";
137 reg = <0x00000 0x40000>;
138 read-only;
139 };
140
141 partition@40000 {
142 label = "u-boot-env";
143 reg = <0x40000 0x10000>;
144 read-only;
145 };
146
147 factory: partition@50000 {
148 label = "Factory";
149 reg = <0x50000 0x10000>;
150 read-only;
151
152 nvmem-layout {
153 compatible = "fixed-layout";
154 #address-cells = <1>;
155 #size-cells = <1>;
156
157 eeprom_factory_0: eeprom@0 {
158 reg = <0x0 0x1000>;
159 };
160 };
161 };
162
163 bdinfo: partition@60000 {
164 label = "bdinfo";
165 reg = <0x60000 0x10000>;
166 read-only;
167
168 nvmem-layout {
169 compatible = "fixed-layout";
170 #address-cells = <1>;
171 #size-cells = <1>;
172
173 macaddr_bdinfo_de00: macaddr@de00 {
174 compatible = "mac-base";
175 reg = <0xde00 0x6>;
176 #nvmem-cell-cells = <1>;
177 };
178 };
179 };
180
181 partition@70000 {
182 label = "FIP";
183 reg = <0x70000 0x80000>;
184 read-only;
185 };
186
187 partition@f0000 {
188 compatible = "denx,fit";
189 label = "firmware";
190 reg = <0xf0000 0xf10000>;
191 };
192 };
193 };
194 };
195
196 &pio {
197 spi2_flash_pins: spi2-pins {
198 mux {
199 function = "spi";
200 groups = "spi2", "spi2_wp_hold";
201 };
202
203 conf-pu {
204 pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
205 drive-strength = <8>;
206 bias-pull-up = <103>;
207 };
208
209 conf-pd {
210 pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
211 drive-strength = <8>;
212 bias-pull-down = <103>;
213 };
214 };
215 };
216
217 &wifi {
218 status = "okay";
219 nvmem-cells = <&eeprom_factory_0>;
220 nvmem-cell-names = "eeprom";
221 };