ramips: add support for Cudy WR1300
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_cudy_wr1300.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9 compatible = "cudy,wr1300", "mediatek,mt7621-soc";
10 model = "Cudy WR1300";
11
12 aliases {
13 led-boot = &led_sys;
14 led-failsafe = &led_sys;
15 led-running = &led_sys;
16 led-upgrade = &led_sys;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 wps {
34 label = "wps";
35 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_WPS_BUTTON>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led_sys: sys {
44 label = "green:sys";
45 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
46 };
47
48 usb {
49 label = "green:usb";
50 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
51 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
52 linux,default-trigger = "usbport";
53 };
54
55 wps {
56 label = "green:wps";
57 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
58 };
59 };
60 };
61
62 &spi0 {
63 status = "okay";
64
65 flash@0 {
66 compatible = "jedec,spi-nor";
67 reg = <0>;
68 spi-max-frequency = <80000000>;
69 m25p,fast-read;
70
71 partitions {
72 compatible = "fixed-partitions";
73 #address-cells = <1>;
74 #size-cells = <1>;
75
76 partition@0 {
77 label = "u-boot";
78 reg = <0x0 0x30000>;
79 read-only;
80 };
81
82 partition@30000 {
83 label = "u-boot-env";
84 reg = <0x30000 0x10000>;
85 read-only;
86 };
87
88 factory: partition@40000 {
89 label = "factory";
90 reg = <0x40000 0x10000>;
91 read-only;
92 };
93
94 partition@50000 {
95 compatible = "denx,uimage";
96 label = "firmware";
97 reg = <0x50000 0xf80000>;
98 };
99
100 partition@fd0000 {
101 label = "debug";
102 reg = <0xfd0000 0x10000>;
103 read-only;
104 };
105
106 partition@fe0000 {
107 label = "backup";
108 reg = <0xfe0000 0x10000>;
109 read-only;
110 };
111
112 bdinfo: partition@ff0000 {
113 label = "bdinfo";
114 reg = <0xff0000 0x10000>;
115 read-only;
116 };
117 };
118 };
119 };
120
121 &pcie {
122 status = "okay";
123 };
124
125 &pcie0 {
126 wifi@0,0 {
127 compatible = "pci14c3,7603";
128 reg = <0x0000 0 0 0 0>;
129 mediatek,mtd-eeprom = <&factory 0x0000>;
130 mtd-mac-address = <&bdinfo 0xde00>;
131 ieee80211-freq-limit = <2400000 2500000>;
132
133 led {
134 led-active-low;
135 };
136 };
137 };
138
139 &pcie1 {
140 wifi@0,0 {
141 compatible = "pci14c3,7662";
142 reg = <0x0000 0 0 0 0>;
143 mediatek,mtd-eeprom = <&factory 0x8000>;
144 mtd-mac-address = <&bdinfo 0xde00>;
145 mtd-mac-address-increment = <2>;
146 ieee80211-freq-limit = <5000000 6000000>;
147
148 led {
149 led-sources = <2>;
150 led-active-low;
151 };
152 };
153 };
154
155 &gmac0 {
156 mtd-mac-address = <&bdinfo 0xde00>;
157 };
158
159 &switch0 {
160 ports {
161 port@0 {
162 status = "okay";
163 label = "lan4";
164 };
165
166 port@1 {
167 status = "okay";
168 label = "lan3";
169 };
170
171 port@2 {
172 status = "okay";
173 label = "lan2";
174 };
175
176 port@3 {
177 status = "okay";
178 label = "lan1";
179 };
180
181 port@4 {
182 status = "okay";
183 label = "wan";
184 mtd-mac-address = <&bdinfo 0xde00>;
185 mtd-mac-address-increment = <1>;
186 };
187 };
188 };
189
190 &state_default {
191 gpio {
192 groups = "wdt", "i2c", "jtag";
193 function = "gpio";
194 };
195 };