Revert "ramips: convert MT7915 EEPROM to NVMEM format"
[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 compatible = "nvmem-cells";
92 label = "Factory";
93 reg = <0x100000 0x80000>;
94 #address-cells = <1>;
95 #size-cells = <1>;
96 read-only;
97
98 eeprom_factory_0: eeprom@0 {
99 reg = <0x0 0xe00>;
100 };
101
102 macaddr_factory_3fff4: macaddr@3fff4 {
103 reg = <0x3fff4 0x6>;
104 };
105
106 macaddr_factory_3fffa: macaddr@3fffa {
107 reg = <0x3fffa 0x6>;
108 };
109 };
110
111 partition@180000 {
112 label = "kernel";
113 reg = <0x180000 0x400000>;
114 };
115
116 ubiconcat0: partition@580000 {
117 label = "ubiconcat0";
118 reg = <0x580000 0x1c00000>;
119 };
120
121 partition@2180000 {
122 label = "firmware_backup";
123 reg = <0x2180000 0x2000000>;
124 };
125
126 partition@4180000 {
127 label = "rootfs_data_back";
128 reg = <0x4180000 0x80000>;
129 read-only;
130 };
131
132 partition@4200000 {
133 label = "nvram_config";
134 reg = <0x4200000 0x80000>;
135 read-only;
136 };
137
138 ubiconcat1: partition@4280000 {
139 label = "ubiconcat1";
140 reg = <0x4280000 0x3d00000>;
141 };
142
143 /*
144 * last 512 KiB are for the bad block table
145 */
146 };
147 };
148
149 &pcie {
150 status = "okay";
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 mediatek,disable-radar-background;
160 };
161 };
162
163 &gmac0 {
164 nvmem-cells = <&macaddr_factory_3fff4>;
165 nvmem-cell-names = "mac-address";
166 };
167
168 &gmac1 {
169 status = "okay";
170 label = "wan";
171 phy-handle = <&ethphy0>;
172
173 nvmem-cells = <&macaddr_factory_3fffa>;
174 nvmem-cell-names = "mac-address";
175 };
176
177 &mdio {
178 ethphy0: ethernet-phy@0 {
179 reg = <0>;
180 };
181 };
182
183 &switch0 {
184 ports {
185 port@1 {
186 status = "okay";
187 label = "lan1";
188 };
189
190 port@4 {
191 status = "okay";
192 label = "lan2";
193 };
194 };
195 };
196
197 &state_default {
198 gpio {
199 groups = "jtag", "wdt";
200 function = "gpio";
201 };
202 };