ramips: mt7621: convert to nvmem-layout
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_iodata_wn-xx-xr.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_power;
11 led-failsafe = &led_power;
12 led-running = &led_power;
13 led-upgrade = &led_power;
14 label-mac-device = &gmac1;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 wps {
21 label = "green:wps";
22 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
23 };
24
25 led_power: power {
26 label = "green:power";
27 gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
28 };
29 };
30
31 keys {
32 compatible = "gpio-keys";
33
34 reset {
35 label = "reset";
36 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_RESTART>;
38 };
39
40 repeater {
41 label = "repeater";
42 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
43 linux,code = <BTN_0>;
44 linux,input-type = <EV_SW>;
45 };
46
47 wps {
48 label = "wps";
49 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
50 linux,code = <KEY_WPS_BUTTON>;
51 };
52 };
53 };
54
55 &nand {
56 status = "okay";
57
58 mediatek,bbt;
59 mediatek,bmt-remap-range =
60 <0x0000000 0x0800000>,
61 <0x3600000 0x4980000>;
62
63 partitions: partitions {
64 compatible = "fixed-partitions";
65 #address-cells = <1>;
66 #size-cells = <1>;
67
68 partition@0 {
69 label = "u-boot";
70 reg = <0x0 0x0100000>;
71 read-only;
72 };
73
74 partition@100000 {
75 label = "u-boot-env";
76 reg = <0x0100000 0x0100000>;
77 read-only;
78 };
79
80 factory: partition@200000 {
81 label = "factory";
82 reg = <0x0200000 0x0100000>;
83
84 nvmem-layout {
85 compatible = "fixed-layout";
86 #address-cells = <1>;
87 #size-cells = <1>;
88
89 macaddr_factory_e000: macaddr@e000 {
90 reg = <0xe000 0x6>;
91 };
92
93 macaddr_factory_e006: macaddr@e006 {
94 reg = <0xe006 0x6>;
95 };
96 };
97 };
98
99 partition@300000 {
100 label = "SecondBoot";
101 reg = <0x0300000 0x0100000>;
102 read-only;
103 };
104
105 partition@400000 {
106 label = "kernel";
107 reg = <0x0400000 0x0400000>;
108 };
109
110 partition@800000 {
111 label = "ubi";
112 reg = <0x0800000 0x2e00000>;
113 };
114
115 partition@3600000 {
116 label = "Config";
117 reg = <0x3600000 0x0100000>;
118 read-only;
119 };
120
121 partition@3700000 {
122 label = "firmware_2";
123 reg = <0x3700000 0x3200000>;
124 };
125
126 partition@6900000 {
127 label = "Config_2";
128 reg = <0x6900000 0x0100000>;
129 read-only;
130 };
131
132 partition@6a00000 {
133 label = "persist";
134 reg = <0x6a00000 0x0100000>;
135 };
136 };
137 };
138
139 &gmac0 {
140 nvmem-cells = <&macaddr_factory_e000>;
141 nvmem-cell-names = "mac-address";
142 };
143
144 &gmac1 {
145 status = "okay";
146 label = "wan";
147 phy-handle = <&ethphy0>;
148
149 nvmem-cells = <&macaddr_factory_e006>;
150 nvmem-cell-names = "mac-address";
151 };
152
153 &mdio {
154 ethphy0: ethernet-phy@0 {
155 reg = <0>;
156 };
157 };
158
159 &switch0 {
160 ports {
161 port@1 {
162 status = "okay";
163 label = "lan4";
164 };
165
166 port@2 {
167 status = "okay";
168 label = "lan3";
169 };
170
171 port@3 {
172 status = "okay";
173 label = "lan2";
174 };
175
176 port@4 {
177 status = "okay";
178 label = "lan1";
179 };
180 };
181 };
182
183 &pcie {
184 status = "okay";
185 };
186
187 &state_default {
188 gpio {
189 groups = "uart2", "uart3", "wdt";
190 function = "gpio";
191 };
192 };
193
194 &xhci {
195 status = "disabled";
196 };