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