82b7c8070e29dc2e49991518bbc071bcd1635b4e
[openwrt/staging/nbd.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 eeprom_factory_0: eeprom@0 {
138 reg = <0x0 0xe00>;
139 };
140
141 macaddr_factory_4: macaddr@4 {
142 reg = <0x4 0x6>;
143 };
144
145 precal_factory_e10: precal@e10 {
146 reg = <0xe10 0x19c10>;
147 };
148 };
149 };
150
151 partition@180000 {
152 label = "kernel";
153 reg = <0x180000 0x0800000>;
154 };
155
156 fwconcat0: partition@980000 {
157 label = "fwconcat0";
158 reg = <0x980000 0x2c00000>;
159 };
160
161 partition@3580000 {
162 label = "manufacture";
163 reg = <0x3580000 0x400000>;
164 read-only;
165 };
166
167 partition@3980000 {
168 label = "storage";
169 reg = <0x3980000 0x680000>;
170 read-only;
171 };
172
173 fwconcat1: partition@4000000 {
174 label = "fwconcat1";
175 reg = <0x4000000 0x3800000>;
176 };
177 };
178 };
179
180 &pcie {
181 status = "okay";
182 };
183
184 &pcie1 {
185 wifi@0,0 {
186 compatible = "mediatek,mt76";
187 reg = <0x0000 0 0 0 0>;
188 nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
189 nvmem-cell-names = "eeprom", "precal";
190 mediatek,disable-radar-background;
191 };
192 };
193
194 &ethernet {
195 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
196 };
197
198 &gmac0 {
199 nvmem-cells = <&macaddr_factory_4>;
200 nvmem-cell-names = "mac-address";
201 };
202
203 &switch0 {
204 gpio-controller;
205 #gpio-cells = <2>;
206
207 ports {
208 port@0 {
209 status = "okay";
210 label = "lan";
211 };
212 };
213 };
214
215 &state_default {
216 gpio {
217 groups = "uart2";
218 function = "gpio";
219 };
220 };