7bec688f866fe5ac00a8edffd8ed4ea4da5e4043
[openwrt/staging/wigyori.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 reg = <0x4 0x6>;
97 };
98
99 macaddr_factory_8004: macaddr@8004 {
100 reg = <0x8004 0x6>;
101 };
102 };
103 };
104
105 partition@50000 {
106 compatible = "denx,uimage";
107 label = "firmware";
108 reg = <0x50000 0xfb0000>;
109 };
110
111 partition@fb0000 {
112 label = "config ";
113 reg = <0xfb0000 0x20000>;
114 read-only;
115 };
116
117 partition@fd0000 {
118 label = "config_bak ";
119 reg = <0xfd0000 0x20000>;
120 read-only;
121 };
122
123 partition@ff0000 {
124 label = "mac_bak ";
125 reg = <0xff0000 0x10000>;
126 read-only;
127 };
128 };
129 };
130 };
131
132 &pcie {
133 status = "okay";
134 };
135
136 &pcie0 {
137 wifi@0,0 {
138 compatible = "mediatek,mt76";
139 reg = <0x0000 0 0 0 0>;
140 nvmem-cells = <&eeprom_factory_8000>;
141 nvmem-cell-names = "eeprom";
142 ieee80211-freq-limit = <5000000 6000000>;
143
144 led {
145 led-sources = <2>;
146 led-active-low;
147 };
148 };
149 };
150
151 &pcie1 {
152 wifi@0,0 {
153 compatible = "mediatek,mt76";
154 reg = <0x0000 0 0 0 0>;
155 nvmem-cells = <&eeprom_factory_0>;
156 nvmem-cell-names = "eeprom";
157 ieee80211-freq-limit = <2400000 2500000>;
158
159 led {
160 led-sources = <2>;
161 led-active-low;
162 };
163 };
164 };
165
166 &gmac0 {
167 nvmem-cells = <&macaddr_factory_4>;
168 nvmem-cell-names = "mac-address";
169 };
170
171 &switch0 {
172 ports {
173 port@0 {
174 status = "okay";
175 label = "wan";
176 nvmem-cells = <&macaddr_factory_4>;
177 nvmem-cell-names = "mac-address";
178 mac-address-increment = <1>;
179 };
180
181 port@1 {
182 status = "okay";
183 label = "lan1";
184 };
185
186 port@2 {
187 status = "okay";
188 label = "lan2";
189 };
190
191 port@3 {
192 status = "okay";
193 label = "lan3";
194 };
195
196 port@4 {
197 status = "okay";
198 label = "lan4";
199 };
200 };
201 };
202
203 &state_default {
204 gpio {
205 groups = "sdhci";
206 function = "gpio";
207 };
208 };