5737c0ce68f1261ee0b7fec215015e4f35125027
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_hanyang_hyc-g920.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 = "hanyang,hyc-g920", "mediatek,mt7621-soc";
10 model = "CJ-Hello HYC-G920";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 bootargs-override = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_power: power {
28 label = "red:power";
29 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
30 };
31
32 usb {
33 label = "green:usb";
34 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
35 trigger-sources = <&ehci_port2>;
36 linux,default-trigger = "usbport";
37 };
38 };
39
40 keys {
41 compatible = "gpio-keys";
42
43 reset {
44 label = "reset";
45 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
46 linux,code = <KEY_RESTART>;
47 debounce-interval = <60>;
48 };
49 };
50 };
51
52 &spi0 {
53 status = "okay";
54
55 flash@0 {
56 compatible = "jedec,spi-nor";
57 reg = <0>;
58 spi-max-frequency = <40000000>;
59
60 partitions {
61 compatible = "fixed-partitions";
62 #address-cells = <1>;
63 #size-cells = <1>;
64
65 partition@0 {
66 label = "bootloader";
67 reg = <0x0 0x30000>;
68 read-only;
69 };
70
71 partition@30000 {
72 label = "mac";
73 reg = <0x30000 0x10000>;
74 read-only;
75 };
76
77 factory: partition@40000 {
78 label = "factory";
79 reg = <0x40000 0x10000>;
80 read-only;
81
82 nvmem-layout {
83 compatible = "fixed-layout";
84 #address-cells = <1>;
85 #size-cells = <1>;
86
87 eeprom_factory_0: eeprom@0 {
88 reg = <0x0 0x200>;
89 };
90
91 eeprom_factory_8000: eeprom@8000 {
92 reg = <0x8000 0x200>;
93 };
94
95 macaddr_factory_4: macaddr@4 {
96 compatible = "mac-base";
97 reg = <0x4 0x6>;
98 #nvmem-cell-cells = <1>;
99 };
100
101 macaddr_factory_8004: macaddr@8004 {
102 reg = <0x8004 0x6>;
103 };
104 };
105 };
106
107 partition@50000 {
108 compatible = "denx,uimage";
109 label = "firmware";
110 reg = <0x50000 0xfb0000>;
111 };
112
113 partition@fb0000 {
114 label = "config ";
115 reg = <0xfb0000 0x20000>;
116 read-only;
117 };
118
119 partition@fd0000 {
120 label = "config_bak ";
121 reg = <0xfd0000 0x20000>;
122 read-only;
123 };
124
125 partition@ff0000 {
126 label = "mac_bak ";
127 reg = <0xff0000 0x10000>;
128 read-only;
129 };
130 };
131 };
132 };
133
134 &pcie {
135 status = "okay";
136 };
137
138 &pcie0 {
139 wifi@0,0 {
140 compatible = "mediatek,mt76";
141 reg = <0x0000 0 0 0 0>;
142 nvmem-cells = <&eeprom_factory_8000>;
143 nvmem-cell-names = "eeprom";
144 ieee80211-freq-limit = <5000000 6000000>;
145
146 led {
147 led-sources = <2>;
148 led-active-low;
149 };
150 };
151 };
152
153 &pcie1 {
154 wifi@0,0 {
155 compatible = "mediatek,mt76";
156 reg = <0x0000 0 0 0 0>;
157 nvmem-cells = <&eeprom_factory_0>;
158 nvmem-cell-names = "eeprom";
159 ieee80211-freq-limit = <2400000 2500000>;
160
161 led {
162 led-sources = <2>;
163 led-active-low;
164 };
165 };
166 };
167
168 &gmac0 {
169 nvmem-cells = <&macaddr_factory_4 0>;
170 nvmem-cell-names = "mac-address";
171 };
172
173 &switch0 {
174 ports {
175 port@0 {
176 status = "okay";
177 label = "wan";
178 nvmem-cells = <&macaddr_factory_4 1>;
179 nvmem-cell-names = "mac-address";
180 };
181
182 port@1 {
183 status = "okay";
184 label = "lan1";
185 };
186
187 port@2 {
188 status = "okay";
189 label = "lan2";
190 };
191
192 port@3 {
193 status = "okay";
194 label = "lan3";
195 };
196
197 port@4 {
198 status = "okay";
199 label = "lan4";
200 };
201 };
202 };
203
204 &state_default {
205 gpio {
206 groups = "sdhci";
207 function = "gpio";
208 };
209 };