ramips: Add support for CJ-Hello HYC-G920
[openwrt/staging/nbd.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
83 partition@50000 {
84 compatible = "denx,uimage";
85 label = "firmware";
86 reg = <0x50000 0xfb0000>;
87 };
88
89 partition@fb0000 {
90 label = "config ";
91 reg = <0xfb0000 0x20000>;
92 read-only;
93 };
94
95 partition@fd0000 {
96 label = "config_bak ";
97 reg = <0xfd0000 0x20000>;
98 read-only;
99 };
100
101 partition@ff0000 {
102 label = "mac_bak ";
103 reg = <0xff0000 0x10000>;
104 read-only;
105 };
106 };
107 };
108 };
109
110 &pcie {
111 status = "okay";
112 };
113
114 &pcie0 {
115 wifi@0,0 {
116 compatible = "mediatek,mt76";
117 reg = <0x0000 0 0 0 0>;
118 mediatek,mtd-eeprom = <&factory 0x8000>;
119
120 led {
121 led-sources = <2>;
122 led-active-low;
123 };
124 };
125 };
126
127 &pcie1 {
128 wifi@0,0 {
129 compatible = "mediatek,mt76";
130 reg = <0x0000 0 0 0 0>;
131 mediatek,mtd-eeprom = <&factory 0x0000>;
132
133 led {
134 led-sources = <2>;
135 led-active-low;
136 };
137 };
138 };
139
140 &gmac0 {
141 nvmem-cells = <&macaddr_factory_4>;
142 nvmem-cell-names = "mac-address";
143 };
144
145 &switch0 {
146 ports {
147 port@0 {
148 status = "okay";
149 label = "wan";
150 nvmem-cells = <&macaddr_factory_4>;
151 nvmem-cell-names = "mac-address";
152 mac-address-increment = <1>;
153 };
154
155 port@1 {
156 status = "okay";
157 label = "lan1";
158 };
159
160 port@2 {
161 status = "okay";
162 label = "lan2";
163 };
164
165 port@3 {
166 status = "okay";
167 label = "lan3";
168 };
169
170 port@4 {
171 status = "okay";
172 label = "lan4";
173 };
174 };
175 };
176
177 &state_default {
178 gpio {
179 groups = "sdhci";
180 function = "gpio";
181 };
182 };
183
184 &factory {
185 compatible = "nvmem-cells";
186 #address-cells = <1>;
187 #size-cells = <1>;
188
189 macaddr_factory_4: macaddr@4 {
190 reg = <0x4 0x6>;
191 };
192
193 macaddr_factory_8004: macaddr@8004 {
194 reg = <0x8004 0x6>;
195 };
196 };