ramips: mt7620a: convert to nvmem-layout
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_xiaomi_mi-router-cr660x.dtsi
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 aliases {
10 led-boot = &led_sys_yellow;
11 led-failsafe = &led_sys_yellow;
12 led-running = &led_sys_blue;
13 led-upgrade = &led_sys_yellow;
14 label-mac-device = &gmac0;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200n8";
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 led_sys_yellow: sys_yellow {
25 label = "yellow:sys";
26 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
27 };
28
29 led_sys_blue: sys_blue {
30 label = "blue:sys";
31 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
32 };
33
34 net_yellow {
35 label = "yellow:net";
36 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
37 };
38
39 net_blue {
40 label = "blue:net";
41 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
42 };
43 };
44
45 keys {
46 compatible = "gpio-keys";
47
48 reset {
49 label = "reset";
50 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
51 linux,code = <KEY_RESTART>;
52 };
53
54 wps {
55 label = "wps";
56 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
57 linux,code = <KEY_WPS_BUTTON>;
58 };
59 };
60 };
61
62 &nand {
63 status = "okay";
64
65 partitions {
66 compatible = "fixed-partitions";
67 #address-cells = <1>;
68 #size-cells = <1>;
69
70 partition@0 {
71 label = "Bootloader";
72 reg = <0x0 0x80000>;
73 read-only;
74 };
75
76 partition@80000 {
77 label = "Nvram";
78 reg = <0x80000 0x40000>;
79 read-only;
80 };
81
82 partition@c0000 {
83 label = "Bdata";
84 reg = <0xc0000 0x40000>;
85 read-only;
86 };
87
88 factory: partition@100000 {
89 compatible = "nvmem-cells";
90 label = "Factory";
91 reg = <0x100000 0x80000>;
92 #address-cells = <1>;
93 #size-cells = <1>;
94 read-only;
95
96 eeprom_factory_0: eeprom@0 {
97 reg = <0x0 0xe00>;
98 };
99
100 macaddr_factory_3fff4: macaddr@3fff4 {
101 reg = <0x3fff4 0x6>;
102 };
103
104 macaddr_factory_3fffa: macaddr@3fffa {
105 reg = <0x3fffa 0x6>;
106 };
107 };
108
109 partition@180000 {
110 label = "crash";
111 reg = <0x180000 0x40000>;
112 read-only;
113 };
114
115 partition@1c0000 {
116 label = "crash_log";
117 reg = <0x1c0000 0x40000>;
118 read-only;
119 };
120
121 /* "kernel" and "ubi" partition is the result of
122 * squashing next consecutive stock partitions:
123 * 1. firmware 0x0200000 - 0x2000000 (Stock firmware 0)
124 * 2. firmware1 0x2000000 - 0x3e00000 (Stock firmware 1)
125 * 3. overlay 0x3e00000 - 0x7000000 (Stock fw Ubi overlay)
126 * 4. obr 0x7000000 - 0x8000000 (Unallocated?)
127 */
128
129 partition@200000 {
130 label = "kernel";
131 reg = <0x200000 0x400000>;
132 };
133
134 partition@600000 {
135 label = "ubi";
136 reg = <0x600000 0x7980000>;
137 };
138
139 /*
140 * Leave 512 KiB for the bad block table
141 */
142 };
143 };
144
145 &pcie {
146 status = "okay";
147 };
148
149 &pcie1 {
150 wifi@0,0 {
151 compatible = "mediatek,mt76";
152 reg = <0x0000 0 0 0 0>;
153 nvmem-cells = <&eeprom_factory_0>;
154 nvmem-cell-names = "eeprom";
155 mediatek,disable-radar-background;
156 };
157 };
158
159 &gmac0 {
160 nvmem-cells = <&macaddr_factory_3fff4>;
161 nvmem-cell-names = "mac-address";
162 };
163
164 &gmac1 {
165 status = "okay";
166 label = "wan";
167 phy-handle = <&ethphy4>;
168
169 nvmem-cells = <&macaddr_factory_3fffa>;
170 nvmem-cell-names = "mac-address";
171 };
172
173 &mdio {
174 ethphy4: ethernet-phy@4 {
175 reg = <4>;
176 };
177 };
178
179 &switch0 {
180 ports {
181 port@0 {
182 status = "okay";
183 label = "lan1";
184 };
185
186 port@1 {
187 status = "okay";
188 label = "lan2";
189 };
190
191 port@2 {
192 status = "okay";
193 label = "lan3";
194 };
195 };
196 };
197
198 &state_default {
199 gpio {
200 groups = "jtag", "uart3", "wdt";
201 function = "gpio";
202 };
203 };