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