ramips: Cudy X6 fixes / improvements
[openwrt/staging/dedeckeh.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_red;
15 led-running = &led_internet_blue;
16 led-upgrade = &led_internet_red;
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 led_internet_red: 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 partition@1ff0000 {
106 label = "bdinfo";
107 reg = <0x1ff0000 0x10000>;
108 read-only;
109
110 compatible = "nvmem-cells";
111 #address-cells = <1>;
112 #size-cells = <1>;
113
114 macaddr_bdinfo_de00: macaddr@de00 {
115 reg = <0xde00 0x6>;
116 };
117 };
118 };
119 };
120 };
121
122 &pcie {
123 status = "okay";
124 };
125
126 &pcie1 {
127 wifi@0,0 {
128 compatible = "mediatek,mt76";
129 reg = <0x0000 0 0 0 0>;
130 mediatek,mtd-eeprom = <&factory 0x0000>;
131 mediatek,disable-radar-background;
132
133 nvmem-cells = <&macaddr_bdinfo_de00>;
134 nvmem-cell-names = "mac-address";
135 };
136 };
137
138 &gmac0 {
139 nvmem-cells = <&macaddr_bdinfo_de00>;
140 nvmem-cell-names = "mac-address";
141 };
142
143 &gmac1 {
144 status = "okay";
145 label = "wan";
146 phy-handle = <&ethphy4>;
147
148 nvmem-cells = <&macaddr_bdinfo_de00>;
149 nvmem-cell-names = "mac-address";
150 mac-address-increment = <1>;
151 };
152
153 &mdio {
154 ethphy4: ethernet-phy@4 {
155 reg = <4>;
156 };
157 };
158
159 &switch0 {
160 ports {
161 port@0 {
162 status = "okay";
163 label = "lan1";
164 };
165
166 port@1 {
167 status = "okay";
168 label = "lan2";
169 };
170
171 port@2 {
172 status = "okay";
173 label = "lan3";
174 };
175
176 port@3 {
177 status = "okay";
178 label = "lan4";
179 };
180 };
181 };
182
183 &state_default {
184 gpio {
185 groups = "uart3", "jtag";
186 function = "gpio";
187 };
188 };