ramips: add support for cudy WR2100
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_cudy_wr2100.dts
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
8 / {
9 compatible = "cudy,wr2100", "mediatek,mt7621-soc";
10 model = "Cudy WR2100";
11
12 aliases {
13 led-boot = &led_internet_blue;
14 led-failsafe = &led_internet_blue;
15 led-running = &led_internet_blue;
16 led-upgrade = &led_internet_blue;
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 8 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 wps {
34 label = "wps";
35 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_WPS_BUTTON>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led_internet_blue: internet_blue {
44 label = "blue:internet";
45 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
46 };
47
48 internet_red {
49 label = "red:internet";
50 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
51 };
52
53 wan {
54 label = "green:wan";
55 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
56 };
57
58 lan1 {
59 label = "green:lan1";
60 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
61 };
62
63 lan2 {
64 label = "green:lan2";
65 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
66 };
67
68 lan3 {
69 label = "green:lan3";
70 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
71 };
72
73 lan4 {
74 label = "green:lan4";
75 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
76 };
77 };
78 };
79
80 &gmac0 {
81 mtd-mac-address = <&bdinfo 0xde00>;
82 };
83
84 &pcie {
85 status = "okay";
86 };
87
88 &pcie0 {
89 wifi@0,0 {
90 compatible = "mediatek,mt76";
91 reg = <0x0000 0 0 0 0>;
92 mediatek,mtd-eeprom = <&factory 0x0000>;
93 ieee80211-freq-limit = <2400000 2500000>;
94 };
95 };
96
97 &pcie1 {
98 wifi@1,0 {
99 compatible = "mediatek,mt76";
100 reg = <0x0000 0 0 0 0>;
101 mediatek,mtd-eeprom = <&factory 0x8000>;
102 ieee80211-freq-limit = <5000000 6000000>;
103 };
104 };
105
106 &spi0 {
107 status = "okay";
108
109 flash@0 {
110 compatible = "jedec,spi-nor";
111 reg = <0>;
112 spi-max-frequency = <50000000>;
113
114 partitions {
115 compatible = "fixed-partitions";
116 #address-cells = <1>;
117 #size-cells = <1>;
118
119 partition@0 {
120 label = "u-boot";
121 reg = <0x0 0x30000>;
122 read-only;
123 };
124
125 partition@30000 {
126 label = "u-boot-env";
127 reg = <0x30000 0x10000>;
128 read-only;
129 };
130
131 factory: partition@40000 {
132 label = "factory";
133 reg = <0x40000 0x10000>;
134 read-only;
135 };
136
137 partition@50000 {
138 compatible = "denx,uimage";
139 label = "firmware";
140 reg = <0x50000 0xf80000>;
141 };
142
143 partition@fd0000 {
144 label = "debug";
145 reg = <0xfd0000 0x10000>;
146 read-only;
147 };
148
149 partition@fe0000 {
150 label = "backup";
151 reg = <0xfe0000 0x10000>;
152 read-only;
153 };
154
155 bdinfo: partition@ff0000 {
156 label = "bdinfo";
157 reg = <0xff0000 0x10000>;
158 read-only;
159 };
160 };
161 };
162 };
163
164 &state_default {
165 gpio {
166 groups = "i2c", "jtag", "uart2", "uart3", "wdt";
167 function = "gpio";
168 };
169 };
170
171 &switch0 {
172 ports {
173 port@0 {
174 status = "okay";
175 label = "lan1";
176 };
177
178 port@1 {
179 status = "okay";
180 label = "lan2";
181 };
182
183 port@2 {
184 status = "okay";
185 label = "lan3";
186 };
187
188 port@3 {
189 status = "okay";
190 label = "lan4";
191 };
192
193 port@4 {
194 status = "okay";
195 label = "wan";
196
197 mtd-mac-address = <&bdinfo 0xde00>;
198 mtd-mac-address-increment = <1>;
199 };
200 };
201 };