ramips: mt7621: convert Ubiquiti devices EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_tplink_eap615-wall-v1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "tplink,eap615-wall-v1", "mediatek,mt7621-soc";
11 model = "TP-Link EAP615-Wall v1";
12
13 aliases {
14 label-mac-device = &gmac0;
15 led-boot = &led_status;
16 led-failsafe = &led_status;
17 led-running = &led_status;
18 led-upgrade = &led_status;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 leds {
26 compatible = "gpio-leds";
27
28 led_status: status {
29 label = "white:status";
30 color = <LED_COLOR_ID_WHITE>;
31 function = LED_FUNCTION_STATUS;
32 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
33 };
34 };
35
36 keys {
37 compatible = "gpio-keys";
38
39 led {
40 label = "led";
41 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
42 linux,code = <KEY_LIGHTS_TOGGLE>;
43 };
44
45 reset {
46 label = "reset";
47 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_RESTART>;
49 };
50 };
51
52 gpio-export {
53 compatible = "gpio-export";
54
55 poe_passthrough {
56 gpio-export,name = "poe-passthrough";
57 gpio-export,output = <0>;
58 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
59 };
60 };
61 };
62
63 &ethernet {
64 reg = <0x1e100000 0xe000>;
65 };
66
67 &spi0 {
68 status = "okay";
69
70 flash@0 {
71 compatible = "jedec,spi-nor";
72 reg = <0>;
73 spi-max-frequency = <20000000>;
74
75 partitions {
76 compatible = "fixed-partitions";
77 #address-cells = <1>;
78 #size-cells = <1>;
79
80 partition@0 {
81 label = "u-boot";
82 reg = <0x0 0x80000>;
83 read-only;
84 };
85
86 partition@80000 {
87 label = "partition-table";
88 reg = <0x80000 0x10000>;
89 read-only;
90 };
91
92 info: partition@90000 {
93 label = "product-info";
94 reg = <0x90000 0x10000>;
95 read-only;
96
97 nvmem-layout {
98 compatible = "fixed-layout";
99 #address-cells = <1>;
100 #size-cells = <1>;
101
102 macaddr_info_8: macaddr@8 {
103 reg = <0x8 0x6>;
104 };
105 };
106 };
107
108 partition@a0000 {
109 compatible = "denx,fit";
110 label = "firmware";
111 reg = <0xa0000 0xcf0000>;
112 };
113
114 partition@d90000 {
115 label = "user-config";
116 reg = <0xd90000 0x60000>;
117 read-only;
118 };
119
120 partition@f30000 {
121 label = "mutil-log";
122 reg = <0xf30000 0x80000>;
123 read-only;
124 };
125
126 partition@fb0000 {
127 label = "oops";
128 reg = <0xfb0000 0x40000>;
129 read-only;
130 };
131
132 radio: partition@ff0000 {
133 label = "radio";
134 reg = <0xff0000 0x10000>;
135 read-only;
136
137 nvmem-layout {
138 compatible = "fixed-layout";
139 #address-cells = <1>;
140 #size-cells = <1>;
141
142 eeprom_radio_0: eeprom@0 {
143 reg = <0x0 0xe00>;
144 };
145 };
146 };
147 };
148 };
149 };
150
151 &state_default {
152 gpio {
153 groups = "uart2", "uart3";
154 function = "gpio";
155 };
156 };
157
158 &pcie {
159 status = "okay";
160 };
161
162 &pcie1 {
163 wifi@0,0 {
164 compatible = "mediatek,mt76";
165 reg = <0x0000 0 0 0 0>;
166 nvmem-cells = <&eeprom_radio_0>;
167 nvmem-cell-names = "eeprom";
168 mediatek,disable-radar-background;
169 };
170 };
171
172 &gmac0 {
173 nvmem-cells = <&macaddr_info_8>;
174 nvmem-cell-names = "mac-address";
175 };
176
177 &gmac1 {
178 status = "okay";
179 label = "lan0";
180 phy-handle = <&ethphy0>;
181
182 nvmem-cells = <&macaddr_info_8>;
183 nvmem-cell-names = "mac-address";
184 };
185
186 &mdio {
187 ethphy0: ethernet-phy@0 {
188 reg = <0>;
189 };
190 };
191
192 &switch0 {
193 ports {
194 port@1 {
195 status = "okay";
196 label = "lan3";
197 };
198
199 port@2 {
200 status = "okay";
201 label = "lan2";
202 };
203
204 port@3 {
205 status = "okay";
206 label = "lan1";
207 };
208 };
209 };