ramips: mt7620: tidy up ethernet node in DTS files
[openwrt/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 &state_default {
119 gpio {
120 groups = "i2c", "uartf", "nd_sd";
121 function = "gpio";
122 };
123 };
124
125 &ethernet {
126 pinctrl-names = "default";
127 pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
128
129 mtd-mac-address = <&factory 0x4>;
130
131 mediatek,portmap = "wllll";
132
133 port@5 {
134 status = "okay";
135 mediatek,fixed-link = <1000 1 1 1>;
136 phy-mode = "rgmii";
137 };
138
139 mdio-bus {
140 status = "okay";
141
142 phy0: ethernet-phy@0 {
143 reg = <0>;
144 phy-mode = "rgmii";
145 };
146
147 phy1: ethernet-phy@1 {
148 reg = <1>;
149 phy-mode = "rgmii";
150 };
151
152 phy2: ethernet-phy@2 {
153 reg = <2>;
154 phy-mode = "rgmii";
155 };
156
157 phy3: ethernet-phy@3 {
158 reg = <3>;
159 phy-mode = "rgmii";
160 };
161
162 phy4: ethernet-phy@4 {
163 reg = <4>;
164 phy-mode = "rgmii";
165 };
166
167 phy1f: ethernet-phy@1f {
168 reg = <0x1f>;
169 phy-mode = "rgmii";
170 };
171 };
172 };
173
174 &gsw {
175 mediatek,port4 = "gmac";
176 };
177
178 &wmac {
179 ralink,mtd-eeprom = <&factory 0x0>;
180 };
181
182 &pcie {
183 status = "okay";
184 };
185
186 &pcie0 {
187 wifi@0,0 {
188 reg = <0x0000 0 0 0 0>;
189 mediatek,mtd-eeprom = <&factory 0x8000>;
190 mediatek,2ghz = <0>;
191 };
192 };
193
194 &ehci {
195 status = "okay";
196 };
197
198 &ohci {
199 status = "okay";
200 };