d9ad11b506f9e6139e0c022651c2247099d41323
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_edimax_ew-7478apc.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8 #include <dt-bindings/mtd/partitions/uimage.h>
9
10 / {
11 compatible = "edimax,ew-7478apc", "ralink,mt7620a-soc";
12 model = "Edimax EW-7478APC";
13
14 aliases {
15 led-boot = &led_power;
16 led-failsafe = &led_power;
17 led-running = &led_power;
18 led-upgrade = &led_power;
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset_wps {
25 label = "reset_wps";
26 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29 };
30
31 leds {
32 compatible = "gpio-leds";
33
34 led_power: power {
35 function = LED_FUNCTION_POWER;
36 color = <LED_COLOR_ID_WHITE>;
37 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
38 };
39
40 internet {
41 label = "blue:internet";
42 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
43 };
44
45 wlan {
46 function = LED_FUNCTION_WLAN;
47 color = <LED_COLOR_ID_BLUE>;
48 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
49 };
50
51 usb {
52 function = LED_FUNCTION_USB;
53 color = <LED_COLOR_ID_BLUE>;
54 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
55 trigger-sources = <&ohci_port1>, <&ehci_port1>;
56 linux,default-trigger = "usbport";
57 };
58 };
59 };
60
61 &gpio2 {
62 status = "okay";
63
64 enable_usb_power {
65 gpio-hog;
66 line-name = "enable USB power";
67 gpios = <5 GPIO_ACTIVE_HIGH>;
68 output-high;
69 };
70 };
71
72 &spi0 {
73 status = "okay";
74
75 flash@0 {
76 compatible = "jedec,spi-nor";
77 reg = <0>;
78 spi-max-frequency = <10000000>;
79
80 partitions {
81 compatible = "fixed-partitions";
82 #address-cells = <1>;
83 #size-cells = <1>;
84
85 partition@0 {
86 label = "u-boot";
87 reg = <0x0 0x30000>;
88 read-only;
89 };
90
91 partition@30000 {
92 label = "u-boot-env";
93 reg = <0x30000 0x10000>;
94 read-only;
95 };
96
97 factory: partition@40000 {
98 label = "factory";
99 reg = <0x40000 0x10000>;
100 read-only;
101
102 nvmem-layout {
103 compatible = "fixed-layout";
104 #address-cells = <1>;
105 #size-cells = <1>;
106
107 eeprom_factory_0: eeprom@0 {
108 reg = <0x0 0x200>;
109 };
110
111 eeprom_factory_8000: eeprom@8000 {
112 reg = <0x8000 0x200>;
113 };
114
115 macaddr_factory_4: macaddr@4 {
116 reg = <0x4 0x6>;
117 };
118 };
119 };
120
121 partition@50000 {
122 label = "cimage";
123 reg = <0x50000 0x20000>;
124 read-only;
125 };
126
127 partition@70000 {
128 compatible = "openwrt,uimage", "denx,uimage";
129 openwrt,offset = <FW_EDIMAX_OFFSET>;
130 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
131 label = "firmware";
132 reg = <0x00070000 0x00790000>;
133 };
134 };
135 };
136 };
137
138 &state_default {
139 gpio {
140 groups = "i2c", "uartf", "nd_sd";
141 function = "gpio";
142 };
143 };
144
145 &ethernet {
146 pinctrl-names = "default";
147 pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
148
149 nvmem-cells = <&macaddr_factory_4>;
150 nvmem-cell-names = "mac-address";
151
152 mediatek,portmap = "wllll";
153
154 port@5 {
155 status = "okay";
156 mediatek,fixed-link = <1000 1 1 1>;
157 phy-mode = "rgmii";
158 };
159
160 mdio-bus {
161 status = "okay";
162
163 phy0: ethernet-phy@0 {
164 reg = <0>;
165 phy-mode = "rgmii";
166 };
167
168 phy1: ethernet-phy@1 {
169 reg = <1>;
170 phy-mode = "rgmii";
171 };
172
173 phy2: ethernet-phy@2 {
174 reg = <2>;
175 phy-mode = "rgmii";
176 };
177
178 phy3: ethernet-phy@3 {
179 reg = <3>;
180 phy-mode = "rgmii";
181 };
182
183 phy4: ethernet-phy@4 {
184 reg = <4>;
185 phy-mode = "rgmii";
186 };
187
188 phy1f: ethernet-phy@1f {
189 reg = <0x1f>;
190 phy-mode = "rgmii";
191 };
192 };
193 };
194
195 &gsw {
196 mediatek,ephy-base = /bits/ 8 <12>;
197 };
198
199 &wmac {
200 nvmem-cells = <&eeprom_factory_0>;
201 nvmem-cell-names = "eeprom";
202 };
203
204 &pcie {
205 status = "okay";
206 };
207
208 &pcie0 {
209 wifi@0,0 {
210 reg = <0x0000 0 0 0 0>;
211 nvmem-cells = <&eeprom_factory_8000>;
212 nvmem-cell-names = "eeprom";
213 ieee80211-freq-limit = <5000000 6000000>;
214 };
215 };
216
217 &ehci {
218 status = "okay";
219 };
220
221 &ohci {
222 status = "okay";
223 };