ramips: mt7621: convert NETGEAR devices EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_cudy_wr1300-v2v3.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9 aliases {
10 led-boot = &led_sys;
11 led-failsafe = &led_sys;
12 led-running = &led_sys;
13 led-upgrade = &led_sys;
14 label-mac-device = &gmac0;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200";
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29
30 wps {
31 label = "wps";
32 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
33 linux,code = <KEY_WPS_BUTTON>;
34 };
35 };
36
37 leds {
38 compatible = "gpio-leds";
39
40 led_sys: sys {
41 label = "green:sys";
42 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
43 };
44
45 wps {
46 label = "green:wps";
47 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
48 };
49 };
50 };
51
52 &spi0 {
53 status = "okay";
54
55 flash@0 {
56 compatible = "jedec,spi-nor";
57 reg = <0>;
58 spi-max-frequency = <40000000>;
59
60 partitions {
61 compatible = "fixed-partitions";
62 #address-cells = <1>;
63 #size-cells = <1>;
64
65 partition@0 {
66 label = "u-boot";
67 reg = <0x0 0x30000>;
68 read-only;
69 };
70
71 partition@30000 {
72 label = "u-boot-env";
73 reg = <0x30000 0x10000>;
74 read-only;
75 };
76
77 partition@40000 {
78 label = "factory";
79 reg = <0x40000 0x10000>;
80 read-only;
81
82 nvmem-layout {
83 compatible = "fixed-layout";
84 #address-cells = <1>;
85 #size-cells = <1>;
86
87 eeprom_factory_0: eeprom@0 {
88 reg = <0x0 0x400>;
89 };
90
91 eeprom_factory_8000: eeprom@8000 {
92 reg = <0x8000 0x4da8>;
93 };
94 };
95 };
96
97 partition@50000 {
98 compatible = "denx,uimage";
99 label = "firmware";
100 reg = <0x50000 0xf80000>;
101 };
102
103 partition@fd0000 {
104 label = "debug";
105 reg = <0xfd0000 0x10000>;
106 read-only;
107 };
108
109 partition@fe0000 {
110 label = "backup";
111 reg = <0xfe0000 0x10000>;
112 read-only;
113 };
114
115 partition@ff0000 {
116 label = "bdinfo";
117 reg = <0xff0000 0x10000>;
118 read-only;
119
120 nvmem-layout {
121 compatible = "fixed-layout";
122 #address-cells = <1>;
123 #size-cells = <1>;
124
125 macaddr_bdinfo_de00: macaddr@de00 {
126 compatible = "mac-base";
127 reg = <0xde00 0x6>;
128 #nvmem-cell-cells = <1>;
129 };
130 };
131 };
132 };
133 };
134 };
135
136 &pcie {
137 status = "okay";
138 };
139
140 &gmac0 {
141 nvmem-cells = <&macaddr_bdinfo_de00 0>;
142 nvmem-cell-names = "mac-address";
143 };
144
145 &gmac1 {
146 status = "okay";
147 label = "wan";
148 phy-handle = <&ethphy4>;
149
150 nvmem-cells = <&macaddr_bdinfo_de00 1>;
151 nvmem-cell-names = "mac-address";
152 };
153
154 &mdio {
155 ethphy4: ethernet-phy@4 {
156 reg = <4>;
157 };
158 };
159
160 &switch0 {
161 ports {
162 port@0 {
163 status = "okay";
164 label = "lan4";
165 };
166
167 port@1 {
168 status = "okay";
169 label = "lan3";
170 };
171
172 port@2 {
173 status = "okay";
174 label = "lan2";
175 };
176
177 port@3 {
178 status = "okay";
179 label = "lan1";
180 };
181 };
182 };
183
184 &state_default {
185 gpio {
186 groups = "wdt", "i2c", "jtag";
187 function = "gpio";
188 };
189 };