ac638ad92944481e0b6e6feb0e2bd10f27300adc
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621_xzwifi_creativebox-v1.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 = "xzwifi,creativebox-v1", "mediatek,mt7621-soc";
10 model = "CreativeBox v1";
11
12 aliases {
13 led-boot = &led_sys;
14 led-failsafe = &led_sys;
15 led-running = &led_sys;
16 led-upgrade = &led_sys;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 };
22
23 leds {
24 compatible = "gpio-leds";
25
26 power {
27 label = "blue:power";
28 gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
29 default-state = "on";
30 };
31
32 led_sys: sys {
33 label = "blue:sys";
34 gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
35 };
36
37 internet {
38 label = "blue:internet";
39 gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
40 };
41
42 wlan2g {
43 label = "blue:wlan2g";
44 gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
45 linux,default-trigger = "phy0tpt";
46 };
47
48 wlan5g {
49 label = "blue:wlan5g";
50 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
51 linux,default-trigger = "phy1tpt";
52 };
53 };
54
55 keys {
56 compatible = "gpio-keys";
57
58 reset {
59 label = "reset";
60 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
61 linux,code = <KEY_RESTART>;
62 };
63 };
64
65 gpio_export {
66 compatible = "gpio-export";
67 #size-cells = <0>;
68
69 power_usb2 {
70 gpio-export,name = "power_usb2";
71 gpio-export,output = <1>;
72 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
73 };
74
75 power_usb3 {
76 gpio-export,name = "power_usb3";
77 gpio-export,output = <1>;
78 gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
79 };
80
81 power_sata {
82 gpio-export,name = "power_sata";
83 gpio-export,output = <1>;
84 gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
85 };
86 };
87 };
88
89 &spi0 {
90 status = "okay";
91
92 flash@0 {
93 compatible = "jedec,spi-nor";
94 reg = <0>;
95 spi-max-frequency = <40000000>;
96 broken-flash-reset;
97
98 partitions {
99 compatible = "fixed-partitions";
100 #address-cells = <1>;
101 #size-cells = <1>;
102
103 partition@0 {
104 label = "u-boot";
105 reg = <0x0 0x30000>;
106 read-only;
107 };
108
109 partition@30000 {
110 label = "u-boot-env";
111 reg = <0x30000 0x10000>;
112 read-only;
113 };
114
115 factory: partition@40000 {
116 label = "factory";
117 reg = <0x40000 0x10000>;
118 read-only;
119
120 nvmem-layout {
121 compatible = "fixed-layout";
122 #address-cells = <1>;
123 #size-cells = <1>;
124
125 eeprom_factory_0: eeprom@0 {
126 reg = <0x0 0x400>;
127 };
128
129 eeprom_factory_8000: eeprom@8000 {
130 reg = <0x8000 0x200>;
131 };
132
133 macaddr_factory_e000: macaddr@e000 {
134 reg = <0xe000 0x6>;
135 };
136 };
137 };
138
139 partition@50000 {
140 compatible = "denx,uimage";
141 label = "firmware";
142 reg = <0x50000 0x1fb0000>;
143 };
144 };
145 };
146 };
147
148 &sdhci {
149 status = "okay";
150 };
151
152 &pcie {
153 status = "okay";
154 };
155
156 &pcie0 {
157 wifi@0,0 {
158 compatible = "pci1400,7603";
159 reg = <0x0000 0 0 0 0>;
160 nvmem-cells = <&eeprom_factory_0>;
161 nvmem-cell-names = "eeprom";
162 };
163 };
164
165 &pcie1 {
166 wifi@0,0 {
167 compatible = "pci14c3,7662";
168 reg = <0x0000 0 0 0 0>;
169 nvmem-cells = <&eeprom_factory_8000>;
170 nvmem-cell-names = "eeprom";
171 ieee80211-freq-limit = <5000000 6000000>;
172 };
173 };
174
175 &ethernet {
176 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
177 };
178
179 &gmac0 {
180 nvmem-cells = <&macaddr_factory_e000>;
181 nvmem-cell-names = "mac-address";
182 };
183
184 &switch0 {
185 ports {
186 port@0 {
187 status = "okay";
188 label = "lan1";
189 };
190
191 port@1 {
192 status = "okay";
193 label = "lan2";
194 };
195
196 port@2 {
197 status = "okay";
198 label = "lan3";
199 };
200
201 port@3 {
202 status = "okay";
203 label = "lan4";
204 };
205
206 port@4 {
207 status = "okay";
208 label = "wan";
209 nvmem-cells = <&macaddr_factory_e000>;
210 nvmem-cell-names = "mac-address";
211 mac-address-increment = <1>;
212 };
213 };
214 };
215
216 &state_default {
217 gpio {
218 groups = "wdt", "rgmii2";
219 function = "gpio";
220 };
221 };