ramips: add support for Cudy X6
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_cudy_x6.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,x6", "mediatek,mt7621-soc";
10 model = "CUDY X6";
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 7 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 15 GPIO_ACTIVE_LOW>;
46 };
47
48 internet_red {
49 label = "red:internet";
50 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
51 };
52 };
53
54 };
55
56 &spi0 {
57 status = "okay";
58
59 flash@0 {
60 compatible = "jedec,spi-nor";
61 reg = <0>;
62 spi-max-frequency = <50000000>;
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 0x1f80000>;
91 };
92
93 partition@1fd0000 {
94 label = "debug";
95 reg = <0x1fd0000 0x10000>;
96 read-only;
97 };
98
99 partition@1fe0000 {
100 label = "backup";
101 reg = <0x1fe0000 0x10000>;
102 read-only;
103 };
104
105 bdinfo: partition@1ff0000 {
106 label = "bdinfo";
107 reg = <0x1ff0000 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 };
124 };
125
126 &gmac0 {
127 nvmem-cells = <&macaddr_bdinfo_de00>;
128 nvmem-cell-names = "mac-address";
129 };
130
131 &switch0 {
132 ports {
133 port@0 {
134 status = "okay";
135 label = "lan1";
136 };
137
138 port@1 {
139 status = "okay";
140 label = "lan2";
141 };
142
143 port@2 {
144 status = "okay";
145 label = "lan3";
146 };
147
148 port@3 {
149 status = "okay";
150 label = "lan4";
151 };
152
153 port@4 {
154 status = "okay";
155 label = "wan";
156 nvmem-cells = <&macaddr_bdinfo_de00>;
157 nvmem-cell-names = "mac-address";
158 mac-address-increment = <1>;
159 };
160 };
161 };
162
163 &state_default {
164 gpio {
165 groups = "uart3", "jtag";
166 function = "gpio";
167 };
168 };
169
170 &bdinfo {
171 compatible = "nvmem-cells";
172 #address-cells = <1>;
173 #size-cells = <1>;
174
175 macaddr_bdinfo_de00: macaddr@de00 {
176 reg = <0xde00 0x6>;
177 };
178 };