ramips: mt7621: convert NETGEAR devices EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_glinet_gl-mt1300.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 = "glinet,gl-mt1300", "mediatek,mt7621-soc";
10 model = "GL.iNet GL-MT1300";
11
12 aliases {
13 led-boot = &led_run;
14 led-failsafe = &led_run;
15 led-running = &led_run;
16 led-upgrade = &led_run;
17 label-mac-device = &gmac1;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 switch {
34 label = "switch";
35 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
36 linux,code = <BTN_0>;
37 linux,input-type = <EV_SW>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 led_run: run {
45 label = "blue:run";
46 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
47 };
48
49 system {
50 label = "white:system";
51 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
52 };
53 };
54 };
55
56 &i2c {
57 status = "okay";
58 };
59
60 &sdhci {
61 status = "okay";
62 };
63
64 &spi0 {
65 status = "okay";
66
67 flash@0 {
68 compatible = "jedec,spi-nor";
69 reg = <0>;
70 spi-max-frequency = <50000000>;
71 broken-flash-reset;
72
73 partitions {
74 compatible = "fixed-partitions";
75 #address-cells = <1>;
76 #size-cells = <1>;
77
78 partition@0 {
79 label = "u-boot";
80 reg = <0x0 0x30000>;
81 read-only;
82 };
83
84 partition@30000 {
85 label = "u-boot-env";
86 reg = <0x30000 0x10000>;
87 read-only;
88 };
89
90 factory: partition@40000 {
91 label = "factory";
92 reg = <0x40000 0x10000>;
93 read-only;
94
95 nvmem-layout {
96 compatible = "fixed-layout";
97 #address-cells = <1>;
98 #size-cells = <1>;
99
100 eeprom_factory_0: eeprom@0 {
101 reg = <0x0 0x4da8>;
102 };
103
104 macaddr_factory_4000: macaddr@4000 {
105 compatible = "mac-base";
106 reg = <0x4000 0x6>;
107 #nvmem-cell-cells = <1>;
108 };
109 };
110 };
111
112 partition@50000 {
113 compatible = "denx,uimage";
114 label = "firmware";
115 reg = <0x50000 0x1fb0000>;
116 };
117 };
118 };
119 };
120
121 &pcie {
122 status = "okay";
123 };
124
125 &pcie0 {
126 wifi@0,0 {
127 compatible = "mediatek,mt76";
128 reg = <0x0000 0 0 0 0>;
129 nvmem-cells = <&eeprom_factory_0>;
130 nvmem-cell-names = "eeprom";
131 };
132 };
133
134 &gmac0 {
135 nvmem-cells = <&macaddr_factory_4000 1>;
136 nvmem-cell-names = "mac-address";
137 };
138
139 &gmac1 {
140 status = "okay";
141 label = "wan";
142 phy-handle = <&ethphy4>;
143
144 nvmem-cells = <&macaddr_factory_4000 0>;
145 nvmem-cell-names = "mac-address";
146 };
147
148 &mdio {
149 ethphy4: ethernet-phy@4 {
150 reg = <4>;
151 };
152 };
153
154 &switch0 {
155 ports {
156 port@2 {
157 status = "okay";
158 label = "lan1";
159 };
160
161 port@3 {
162 status = "okay";
163 label = "lan2";
164 };
165 };
166 };
167
168 &uartlite3 {
169 status = "okay";
170 };
171
172 &state_default {
173 gpio {
174 group = "wdt", "jtag";
175 function = "gpio";
176 };
177 };