ramips: mt7621: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7621_dlink_dap-x1860-a1.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 = "dlink,dap-x1860-a1", "mediatek,mt7621-soc";
10 model = "D-Link DAP-X1860 A1";
11
12 chosen {
13 bootargs = "console=ttyS0,115200";
14 };
15
16 aliases {
17 label-mac-device = &gmac0;
18 led-boot = &led_power_green;
19 led-failsafe = &led_power_red;
20 led-running = &led_power_green;
21 led-upgrade = &led_power_red;
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 wps {
28 label = "wps";
29 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_WPS_BUTTON>;
31 };
32
33 reset {
34 label = "reset";
35 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_RESTART>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led_power_green: power_green {
44 label = "green:power";
45 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
46 default-state = "on";
47 };
48
49 led_power_red: power_red {
50 label = "red:power";
51 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
52 };
53
54 power_orange {
55 label = "orange:power";
56 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
57 };
58
59 rssihigh {
60 label = "green:rssihigh";
61 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
62 };
63
64 rssimedium {
65 label = "green:rssimedium";
66 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
67 };
68
69 rssilow_orange {
70 label = "orange:rssilow";
71 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
72 };
73
74 rssilow_green {
75 label = "green:rssilow";
76 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
77 };
78 };
79
80 virtual_flash {
81 compatible = "mtd-concat";
82
83 devices = <&fwconcat0 &fwconcat1>;
84
85 partitions {
86 compatible = "fixed-partitions";
87 #address-cells = <1>;
88 #size-cells = <1>;
89
90 partition@0 {
91 label = "ubi";
92 reg = <0x0 0x0>;
93 };
94 };
95 };
96 };
97
98 &nand {
99 status = "okay";
100
101 mediatek,nmbm;
102 /* rsvd = Remapping Range / NAND Erase-Size */
103 /* rsvd = 0x800000 / 0x20000 */
104 mediatek,bmt-max-reserved-blocks = <64>;
105 /* Remapping should include raw-nand we operate upon without UBI layer. */
106 /* This includes (at least) the kernel which has to be loaded by U-Boot.*/
107 mediatek,bmt-remap-range =
108 <0x0 0x980000>;
109
110 partitions {
111 compatible = "fixed-partitions";
112 #address-cells = <1>;
113 #size-cells = <1>;
114
115 partition@0 {
116 label = "bootloader";
117 reg = <0x0 0x80000>;
118 read-only;
119 };
120
121 partition@80000 {
122 label = "config";
123 reg = <0x80000 0x80000>;
124 read-only;
125 };
126
127 factory: partition@100000 {
128 label = "factory";
129 reg = <0x100000 0x80000>;
130 read-only;
131
132 nvmem-layout {
133 compatible = "fixed-layout";
134 #address-cells = <1>;
135 #size-cells = <1>;
136
137 macaddr_factory_4: macaddr@4 {
138 reg = <0x4 0x6>;
139 };
140 };
141 };
142
143 partition@180000 {
144 label = "kernel";
145 reg = <0x180000 0x0800000>;
146 };
147
148 fwconcat0: partition@980000 {
149 label = "fwconcat0";
150 reg = <0x980000 0x2c00000>;
151 };
152
153 partition@3580000 {
154 label = "manufacture";
155 reg = <0x3580000 0x400000>;
156 read-only;
157 };
158
159 partition@3980000 {
160 label = "storage";
161 reg = <0x3980000 0x680000>;
162 read-only;
163 };
164
165 fwconcat1: partition@4000000 {
166 label = "fwconcat1";
167 reg = <0x4000000 0x3800000>;
168 };
169 };
170 };
171
172 &pcie {
173 status = "okay";
174 };
175
176 &pcie1 {
177 wifi@0,0 {
178 compatible = "mediatek,mt76";
179 reg = <0x0000 0 0 0 0>;
180 mediatek,mtd-eeprom = <&factory 0x0>;
181 mediatek,disable-radar-background;
182 };
183 };
184
185 &ethernet {
186 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
187 };
188
189 &gmac0 {
190 nvmem-cells = <&macaddr_factory_4>;
191 nvmem-cell-names = "mac-address";
192 };
193
194 &switch0 {
195 gpio-controller;
196 #gpio-cells = <2>;
197
198 ports {
199 port@0 {
200 status = "okay";
201 label = "lan";
202 };
203 };
204 };
205
206 &state_default {
207 gpio {
208 groups = "uart2";
209 function = "gpio";
210 };
211 };