ramips: add support for YunCore G720
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_wavlink_wl-wn53xax.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
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 aliases {
11 led-boot = &led_status_red;
12 led-failsafe = &led_status_red;
13 led-running = &led_status_blue;
14 led-upgrade = &led_status_red;
15 };
16
17 keys {
18 compatible = "gpio-keys";
19
20 reset {
21 label = "Reset Button";
22 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
23 linux,code = <KEY_RESTART>;
24 };
25
26 touch { /* RH6015C touch sensor -> GPIO 14 */
27 label = "Touch Button";
28 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
29 linux,code = <BTN_0>;
30 };
31
32 turbo {
33 label = "Turbo Button";
34 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
35 linux,code = <BTN_1>;
36 };
37
38 wps {
39 label = "WPS Button";
40 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
41 linux,code = <KEY_WPS_BUTTON>;
42 };
43 };
44
45 leds {
46 compatible = "gpio-leds";
47
48 led_status_blue: status_blue {
49 function = LED_FUNCTION_POWER;
50 color = <LED_COLOR_ID_BLUE>;
51 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
52 };
53
54 led_status_red: status_red {
55 function = LED_FUNCTION_POWER;
56 color = <LED_COLOR_ID_RED>;
57 gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
58 };
59
60 wifi2g {
61 label = "blue:wifi2g";
62 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
63 linux,default-trigger = "phy0tpt";
64 };
65 };
66 };
67
68 &i2c {
69 status = "okay";
70 };
71
72 &spi0 {
73 status = "okay";
74
75 flash@0 {
76 compatible = "jedec,spi-nor";
77 reg = <0>;
78 spi-max-frequency = <40000000>;
79
80 partitions {
81 compatible = "fixed-partitions";
82 #address-cells = <1>;
83 #size-cells = <1>;
84
85 partition@0 {
86 label = "u-boot";
87 reg = <0x0 0x30000>;
88 read-only;
89 };
90
91 partition@30000 {
92 label = "config";
93 reg = <0x30000 0x10000>;
94 read-only;
95 };
96
97 partition@40000 {
98 label = "factory";
99 reg = <0x40000 0x10000>;
100 read-only;
101
102 nvmem-layout {
103 compatible = "fixed-layout";
104 #address-cells = <1>;
105 #size-cells = <1>;
106
107 eeprom_factory_0: eeprom@0 {
108 reg = <0x0 0x400>;
109 };
110
111 eeprom_factory_8000: eeprom@8000 {
112 reg = <0x8000 0x4da8>;
113 };
114
115 macaddr_factory_e000: macaddr@e000 {
116 reg = <0xe000 0x6>;
117 };
118
119 macaddr_factory_e006: macaddr@e006 {
120 reg = <0xe006 0x6>;
121 };
122 };
123 };
124
125 partition@50000 {
126 compatible = "denx,uimage";
127 label = "firmware";
128 reg = <0x50000 0xeb0000>;
129 };
130
131 partition@f00000 {
132 label = "vendor";
133 reg = <0xf00000 0x100000>;
134 read-only;
135 };
136 };
137 };
138 };
139
140 &pcie {
141 status = "okay";
142 };
143
144 &pcie0 {
145 wifi0: mt76@0,0 {
146 compatible = "mediatek,mt76";
147 reg = <0x0000 0 0 0 0>;
148 nvmem-cells = <&eeprom_factory_0>;
149 nvmem-cell-names = "eeprom";
150 };
151 };
152
153 &pcie1 {
154 wifi1: mt76@0,0 {
155 compatible = "mediatek,mt76";
156 reg = <0x0000 0 0 0 0>;
157 nvmem-cells = <&eeprom_factory_8000>;
158 nvmem-cell-names = "eeprom";
159 };
160 };
161
162 &ethernet {
163 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
164 };
165
166 &gmac0 {
167 nvmem-cells = <&macaddr_factory_e000>;
168 nvmem-cell-names = "mac-address";
169 };
170
171 &switch0 {
172 ports {
173 port0: port@0 {
174 status = "okay";
175 };
176
177 port1: port@1 {
178 status = "okay";
179 };
180
181 port2: port@2 {
182 status = "okay";
183 };
184
185 port3: port@3 {
186 status = "okay";
187 };
188
189 port@4 {
190 status = "okay";
191 label = "wan";
192 nvmem-cells = <&macaddr_factory_e006>;
193 nvmem-cell-names = "mac-address";
194 };
195 };
196 };
197
198 &state_default {
199 gpio {
200 groups = "rgmii2", "jtag", "wdt";
201 function = "gpio";
202 };
203 };
204
205 &uartlite2 {
206 status = "okay";
207 };