ramips: add support for SNR-CPE-ME2-SFP
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_asus_rt-ac57u.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 = "asus,rt-ac57u", "mediatek,mt7621-soc";
10 model = "ASUS RT-AC57U";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_power: power {
23 label = "blue:power";
24 gpios = <&gpio 48 GPIO_ACTIVE_LOW>;
25 };
26
27 usb {
28 label = "blue:usb";
29 gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
30 trigger-sources = <&ehci_port2>;
31 linux,default-trigger = "usbport";
32 };
33 };
34
35 keys {
36 compatible = "gpio-keys";
37
38 wps {
39 label = "wps";
40 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
41 linux,code = <KEY_WPS_BUTTON>;
42 debounce-interval = <60>;
43 };
44
45 reset {
46 label = "reset";
47 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_RESTART>;
49 debounce-interval = <60>;
50 };
51 };
52
53 led-regulator {
54 compatible = "regulator-fixed";
55 regulator-name = "LED-Power";
56 gpio = <&gpio 46 GPIO_ACTIVE_LOW>;
57 regulator-min-microvolt = <3300000>;
58 regulator-max-microvolt = <3300000>;
59 regulator-always-on;
60 };
61 };
62
63 &spi0 {
64 status = "okay";
65
66 flash@0 {
67 compatible = "jedec,spi-nor";
68 reg = <0>;
69 spi-max-frequency = <10000000>;
70
71 partitions {
72 compatible = "fixed-partitions";
73 #address-cells = <1>;
74 #size-cells = <1>;
75
76 partition@0 {
77 label = "u-boot";
78 reg = <0x0 0x30000>;
79 read-only;
80 };
81
82 partition@30000 {
83 label = "config";
84 reg = <0x30000 0x10000>;
85 read-only;
86 };
87
88 factory: partition@40000 {
89 label = "factory";
90 reg = <0x40000 0x10000>;
91 read-only;
92 };
93
94 partition@50000 {
95 compatible = "denx,uimage";
96 label = "firmware";
97 reg = <0x50000 0xfb0000>;
98 };
99 };
100 };
101 };
102
103 &pcie {
104 status = "okay";
105 };
106
107 &pcie0 {
108 wifi@0,0 {
109 compatible = "mediatek,mt76";
110 reg = <0x0000 0 0 0 0>;
111 mediatek,mtd-eeprom = <&factory 0x8000>;
112
113 led {
114 led-sources = <2>;
115 led-active-low;
116 };
117 };
118 };
119
120 &pcie1 {
121 wifi@0,0 {
122 compatible = "mediatek,mt76";
123 reg = <0x0000 0 0 0 0>;
124 mediatek,mtd-eeprom = <&factory 0x0000>;
125
126 led {
127 led-active-low;
128 };
129 };
130 };
131
132 &gmac0 {
133 nvmem-cells = <&macaddr_factory_e000>;
134 nvmem-cell-names = "mac-address";
135 };
136
137 &gmac1 {
138 status = "okay";
139 label = "wan";
140 phy-handle = <&ethphy0>;
141
142 nvmem-cells = <&macaddr_factory_e006>;
143 nvmem-cell-names = "mac-address";
144 };
145
146 &mdio {
147 ethphy0: ethernet-phy@0 {
148 reg = <0>;
149 };
150 };
151
152 &switch0 {
153 ports {
154 port@1 {
155 status = "okay";
156 label = "lan1";
157 };
158
159 port@2 {
160 status = "okay";
161 label = "lan2";
162 };
163
164 port@3 {
165 status = "okay";
166 label = "lan3";
167 };
168
169 port@4 {
170 status = "okay";
171 label = "lan4";
172 };
173 };
174 };
175
176 &state_default {
177 gpio {
178 groups = "sdhci";
179 function = "gpio";
180 };
181 };
182
183 &factory {
184 compatible = "nvmem-cells";
185 #address-cells = <1>;
186 #size-cells = <1>;
187
188 macaddr_factory_e000: macaddr@e000 {
189 reg = <0xe000 0x6>;
190 };
191
192 macaddr_factory_e006: macaddr@e006 {
193 reg = <0xe006 0x6>;
194 };
195 };