ramips: add support for JCG Q20
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_jcg_q20.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 = "jcg,q20", "mediatek,mt7621-soc";
10 model = "JCG Q20";
11
12 aliases {
13 led-boot = &led_status_red;
14 led-failsafe = &led_status_red;
15 led-running = &led_status_blue;
16 led-upgrade = &led_status_blue;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_status_red: status_red {
28 label = "red:status";
29 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
30 };
31
32 led_status_blue: status_blue {
33 label = "blue:status";
34 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
35 };
36 };
37
38 keys {
39 compatible = "gpio-keys";
40
41 reset {
42 label = "reset";
43 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
44 linux,code = <KEY_RESTART>;
45 };
46
47 wps {
48 label = "wps";
49 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
50 linux,code = <KEY_WPS_BUTTON>;
51 };
52 };
53
54 ubi-concat {
55 compatible = "mtd-concat";
56 devices = <&ubiconcat0 &ubiconcat1>;
57
58 partitions {
59 compatible = "fixed-partitions";
60 #address-cells = <1>;
61 #size-cells = <1>;
62
63 partition@0 {
64 label = "ubi";
65 reg = <0x0 0x5900000>;
66 };
67 };
68 };
69 };
70
71 &nand {
72 status = "okay";
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 partition@0 {
80 label = "Bootloader";
81 reg = <0x0 0x80000>;
82 read-only;
83 };
84
85 partition@80000 {
86 label = "Config";
87 reg = <0x80000 0x80000>;
88 };
89
90 factory: partition@100000 {
91 label = "Factory";
92 reg = <0x100000 0x80000>;
93 read-only;
94 };
95
96 partition@180000 {
97 label = "kernel";
98 reg = <0x180000 0x400000>;
99 };
100
101 ubiconcat0: partition@580000 {
102 label = "ubiconcat0";
103 reg = <0x580000 0x1c00000>;
104 };
105
106 partition@2180000 {
107 label = "firmware_backup";
108 reg = <0x2180000 0x2000000>;
109 };
110
111 partition@4180000 {
112 label = "rootfs_data_back";
113 reg = <0x4180000 0x80000>;
114 read-only;
115 };
116
117 partition@4200000 {
118 label = "nvram_config";
119 reg = <0x4200000 0x80000>;
120 read-only;
121 };
122
123 ubiconcat1: partition@4280000 {
124 label = "ubiconcat1";
125 reg = <0x4280000 0x3d00000>;
126 };
127
128 /*
129 * last 512 KiB are for the bad block table
130 */
131 };
132 };
133
134 &pcie {
135 status = "okay";
136 };
137
138 &pcie1 {
139 wifi@0,0 {
140 compatible = "mediatek,mt76";
141 reg = <0x0000 0 0 0 0>;
142 mediatek,mtd-eeprom = <&factory 0x0>;
143 };
144 };
145
146 &gmac0 {
147 mtd-mac-address = <&factory 0x3fff4>;
148 };
149
150 &switch0 {
151 ports {
152 port@0 {
153 status = "okay";
154 label = "wan";
155 mtd-mac-address = <&factory 0x3fffa>;
156 };
157
158 port@1 {
159 status = "okay";
160 label = "lan1";
161 };
162
163 port@4 {
164 status = "okay";
165 label = "lan2";
166 };
167 };
168 };
169
170 &state_default {
171 gpio {
172 groups = "jtag", "wdt";
173 function = "gpio";
174 };
175 };