ramips: add support for ALFA Network Quad-E4G
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_edimax_ew-7478apc.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7620a.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10         compatible = "edimax,ew-7478apc", "ralink,mt7620a-soc";
11         model = "Edimax EW-7478APC";
12
13         aliases {
14                 led-boot = &led_power;
15                 led-failsafe = &led_power;
16                 led-running = &led_power;
17                 led-upgrade = &led_power;
18         };
19
20         chosen {
21                 bootargs = "console=ttyS0,57600";
22         };
23
24         keys {
25                 compatible = "gpio-keys";
26
27                 reset_wps {
28                         label = "reset_wps";
29                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
30                         linux,code = <KEY_RESTART>;
31                 };
32         };
33
34         leds {
35                 compatible = "gpio-leds";
36
37                 led_power: power {
38                         label = "ew-7478apc:white:power";
39                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
40                 };
41
42                 internet {
43                         label = "ew-7478apc:blue:internet";
44                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
45                 };
46
47                 wlan {
48                         label = "ew-7478apc:blue:wlan";
49                         gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
50                 };
51
52                 usb {
53                         label = "ew-7478apc:blue:usb";
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
103                         partition@50000 {
104                                 label = "cimage";
105                                 reg = <0x50000 0x20000>;
106                                 read-only;
107                         };
108
109                         partition@70000 {
110                                 compatible = "edimax,uimage";
111                                 label = "firmware";
112                                 reg = <0x00070000 0x00790000>;
113                         };
114                 };
115         };
116 };
117
118 &pinctrl {
119         state_default: pinctrl0 {
120                 gpio {
121                         ralink,group = "i2c", "uartf", "nd_sd";
122                         ralink,function = "gpio";
123                 };
124         };
125 };
126
127 &ethernet {
128         status = "okay";
129         mtd-mac-address = <&factory 0x4>;
130         pinctrl-names = "default";
131         pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
132         mediatek,portmap = "wllll";
133
134         port@5 {
135                 status = "okay";
136                 mediatek,fixed-link = <1000 1 1 1>;
137                 phy-mode = "rgmii";
138         };
139
140         mdio-bus {
141                 status = "okay";
142
143                 phy0: ethernet-phy@0 {
144                         reg = <0>;
145                         phy-mode = "rgmii";
146                 };
147
148                 phy1: ethernet-phy@1 {
149                         reg = <1>;
150                         phy-mode = "rgmii";
151                 };
152
153                 phy2: ethernet-phy@2 {
154                         reg = <2>;
155                         phy-mode = "rgmii";
156                 };
157
158                 phy3: ethernet-phy@3 {
159                         reg = <3>;
160                         phy-mode = "rgmii";
161                 };
162
163                 phy4: ethernet-phy@4 {
164                         reg = <4>;
165                         phy-mode = "rgmii";
166                 };
167
168                 phy1f: ethernet-phy@1f {
169                         reg = <0x1f>;
170                         phy-mode = "rgmii";
171                 };
172         };
173 };
174
175 &gsw {
176         mediatek,port4 = "gmac";
177 };
178
179 &wmac {
180         ralink,mtd-eeprom = <&factory 0>;
181 };
182
183 &pcie {
184         status = "okay";
185 };
186
187 &pcie0 {
188         wifi@0,0 {
189                 reg = <0x0000 0 0 0 0>;
190                 mediatek,mtd-eeprom = <&factory 0x8000>;
191                 mediatek,2ghz = <0>;
192         };
193 };
194
195 &ehci {
196         status = "okay";
197 };
198
199 &ohci {
200         status = "okay";
201 };