mediatek: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / mediatek / dts / mt7981b-cetron-ct3003.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 /dts-v1/;
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "mt7981.dtsi"
8
9 / {
10 model = "Cetron CT3003";
11 compatible = "cetron,ct3003", "mediatek,mt7981";
12
13 aliases {
14 serial0 = &uart0;
15 led-boot = &led_status_red;
16 led-failsafe = &led_status_red;
17 led-running = &led_status_green;
18 led-upgrade = &led_status_green;
19 };
20
21 chosen {
22 stdout-path = "serial0:115200n8";
23 };
24
25 memory {
26 reg = <0 0x40000000 0 0x10000000>;
27 };
28
29 gpio-keys {
30 compatible = "gpio-keys";
31
32 reset {
33 label = "reset";
34 linux,code = <KEY_RESTART>;
35 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
36 };
37
38 wps {
39 label = "wps";
40 linux,code = <KEY_WPS_BUTTON>;
41 gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
42 };
43 };
44
45 leds {
46 compatible = "gpio-leds";
47
48 led_status_red: led_status_red {
49 label = "red:status";
50 gpios = <&pio 3 GPIO_ACTIVE_LOW>;
51 };
52
53 led_status_green: led_status_green {
54 label = "green:status";
55 gpios = <&pio 7 GPIO_ACTIVE_LOW>;
56 };
57 };
58 };
59
60 &eth {
61 status = "okay";
62
63 gmac0: mac@0 {
64 compatible = "mediatek,eth-mac";
65 reg = <0>;
66 phy-mode = "2500base-x";
67
68 nvmem-cells = <&macaddr_art_0>;
69 nvmem-cell-names = "mac-address";
70
71 fixed-link {
72 speed = <2500>;
73 full-duplex;
74 pause;
75 };
76 };
77 };
78
79 &mdio_bus {
80 switch: switch@1f {
81 compatible = "mediatek,mt7531";
82 reg = <31>;
83 reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
84 interrupt-controller;
85 #interrupt-cells = <1>;
86 interrupt-parent = <&pio>;
87 interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
88 };
89 };
90
91 &spi0 {
92 pinctrl-names = "default";
93 pinctrl-0 = <&spi0_flash_pins>;
94 status = "okay";
95
96 spi_nand@0 {
97 compatible = "spi-nand";
98 #address-cells = <1>;
99 #size-cells = <1>;
100 reg = <0>;
101
102 spi-max-frequency = <52000000>;
103 spi-tx-bus-width = <4>;
104 spi-rx-bus-width = <4>;
105
106 mediatek,nmbm;
107 mediatek,bmt-max-ratio = <1>;
108 mediatek,bmt-max-reserved-blocks = <64>;
109
110 partitions {
111 compatible = "fixed-partitions";
112 #address-cells = <1>;
113 #size-cells = <1>;
114
115 partition@0 {
116 label = "BL2";
117 reg = <0x0000000 0x0100000>;
118 read-only;
119 };
120
121 partition@100000 {
122 label = "u-boot-env";
123 reg = <0x0100000 0x0080000>;
124 };
125
126 partition@180000 {
127 label = "art";
128 reg = <0x0180000 0x0100000>;
129 read-only;
130
131 nvmem-layout {
132 compatible = "fixed-layout";
133 #address-cells = <1>;
134 #size-cells = <1>;
135
136 macaddr_art_0: macaddr@0 {
137 reg = <0x0 0x6>;
138 };
139 };
140 };
141
142 factory: partition@280000 {
143 label = "Factory";
144 reg = <0x0280000 0x0100000>;
145 read-only;
146 };
147
148 partition@380000 {
149 label = "FIP";
150 reg = <0x0380000 0x0200000>;
151 read-only;
152 };
153
154 partition@580000 {
155 label = "ubi";
156 reg = <0x0580000 0x2000000>;
157 };
158
159 partition@2580000 {
160 label = "ubi_backup";
161 reg = <0x2580000 0x2000000>;
162 };
163
164 partition@4580000 {
165 label = "Config_backup";
166 reg = <0x4580000 0x0400000>;
167 };
168 };
169 };
170 };
171
172 &switch {
173 ports {
174 #address-cells = <1>;
175 #size-cells = <0>;
176
177 port@0 {
178 reg = <0>;
179 label = "lan1";
180 };
181
182 port@1 {
183 reg = <1>;
184 label = "lan2";
185 };
186
187 port@2 {
188 reg = <2>;
189 label = "lan3";
190 };
191
192 port@3 {
193 reg = <3>;
194 label = "wan";
195 };
196
197 port@6 {
198 reg = <6>;
199 ethernet = <&gmac0>;
200 phy-mode = "2500base-x";
201
202 fixed-link {
203 speed = <2500>;
204 full-duplex;
205 pause;
206 };
207 };
208 };
209 };
210
211 &pio {
212 spi0_flash_pins: spi0-pins {
213 mux {
214 function = "spi";
215 groups = "spi0", "spi0_wp_hold";
216 };
217
218 conf-pu {
219 pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
220 drive-strength = <MTK_DRIVE_8mA>;
221 bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
222 };
223
224 conf-pd {
225 pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
226 drive-strength = <MTK_DRIVE_8mA>;
227 bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
228 };
229 };
230 };
231
232 &uart0 {
233 status = "okay";
234 };
235
236 &watchdog {
237 status = "okay";
238 };
239
240 &wifi {
241 status = "okay";
242
243 mediatek,mtd-eeprom = <&factory 0x0>;
244 };