ramips: add support for Cudy WR1300 v2
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_cudy_wr1300-v2.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-v2", "mediatek,mt7621-soc";
10 model = "Cudy WR1300 v2";
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 7 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_LOW>;
46 };
47
48 wps {
49 label = "green:wps";
50 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
51 };
52 };
53 };
54
55 &spi0 {
56 status = "okay";
57
58 flash@0 {
59 compatible = "jedec,spi-nor";
60 reg = <0>;
61 spi-max-frequency = <80000000>;
62 m25p,fast-read;
63
64 partitions {
65 compatible = "fixed-partitions";
66 #address-cells = <1>;
67 #size-cells = <1>;
68
69 partition@0 {
70 label = "u-boot";
71 reg = <0x0 0x30000>;
72 read-only;
73 };
74
75 partition@30000 {
76 label = "u-boot-env";
77 reg = <0x30000 0x10000>;
78 read-only;
79 };
80
81 factory: partition@40000 {
82 label = "factory";
83 reg = <0x40000 0x10000>;
84 read-only;
85 };
86
87 partition@50000 {
88 compatible = "denx,uimage";
89 label = "firmware";
90 reg = <0x50000 0xf80000>;
91 };
92
93 partition@fd0000 {
94 label = "debug";
95 reg = <0xfd0000 0x10000>;
96 read-only;
97 };
98
99 partition@fe0000 {
100 label = "backup";
101 reg = <0xfe0000 0x10000>;
102 read-only;
103 };
104
105 bdinfo: partition@ff0000 {
106 label = "bdinfo";
107 reg = <0xff0000 0x10000>;
108 read-only;
109 };
110 };
111 };
112 };
113
114 &pcie {
115 status = "okay";
116 };
117
118 &pcie1 {
119 wifi@0,0 {
120 compatible = "mediatek,mt76";
121 reg = <0x0000 0 0 0 0>;
122 mediatek,mtd-eeprom = <&factory 0x0000>;
123 nvmem-cells = <&macaddr_bdinfo_de00>;
124 nvmem-cell-names = "mac-address";
125 };
126 };
127
128 &pcie0 {
129 wifi@0,0 {
130 compatible = "mediatek,mt76";
131 reg = <0x0000 0 0 0 0>;
132 mediatek,mtd-eeprom = <&factory 0x8000>;
133 nvmem-cells = <&macaddr_bdinfo_de00>;
134 nvmem-cell-names = "mac-address";
135 mac-address-increment = <2>;
136 };
137 };
138
139 &gmac0 {
140 nvmem-cells = <&macaddr_bdinfo_de00>;
141 nvmem-cell-names = "mac-address";
142 };
143
144 &gmac1 {
145 status = "okay";
146 label = "wan";
147 phy-handle = <&ethphy4>;
148
149 nvmem-cells = <&macaddr_bdinfo_de00>;
150 nvmem-cell-names = "mac-address";
151 mac-address-increment = <1>;
152 };
153
154 &mdio {
155 ethphy4: ethernet-phy@4 {
156 reg = <4>;
157 };
158 };
159
160 &switch0 {
161 ports {
162 port@0 {
163 status = "okay";
164 label = "lan4";
165 };
166
167 port@1 {
168 status = "okay";
169 label = "lan3";
170 };
171
172 port@2 {
173 status = "okay";
174 label = "lan2";
175 };
176
177 port@3 {
178 status = "okay";
179 label = "lan1";
180 };
181 };
182 };
183
184 &state_default {
185 gpio {
186 groups = "wdt", "i2c", "jtag";
187 function = "gpio";
188 };
189 };
190
191 &bdinfo {
192 compatible = "nvmem-cells";
193 #address-cells = <1>;
194 #size-cells = <1>;
195
196 macaddr_bdinfo_de00: macaddr@de00 {
197 reg = <0xde00 0x6>;
198 };
199 };