09763db388c13c2ac3f4b2dc3b7eeca8d6b73758
[openwrt/staging/wigyori.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/mtd/partitions/uimage.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 keys {
21 compatible = "gpio-keys";
22
23 reset_wps {
24 label = "reset_wps";
25 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
26 linux,code = <KEY_RESTART>;
27 };
28 };
29
30 leds {
31 compatible = "gpio-leds";
32
33 led_power: power {
34 label = "white:power";
35 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
36 };
37
38 internet {
39 label = "blue:internet";
40 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
41 };
42
43 wlan {
44 label = "blue:wlan";
45 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
46 };
47
48 usb {
49 label = "blue:usb";
50 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
51 trigger-sources = <&ohci_port1>, <&ehci_port1>;
52 linux,default-trigger = "usbport";
53 };
54 };
55 };
56
57 &gpio2 {
58 status = "okay";
59
60 enable_usb_power {
61 gpio-hog;
62 line-name = "enable USB power";
63 gpios = <5 GPIO_ACTIVE_HIGH>;
64 output-high;
65 };
66 };
67
68 &spi0 {
69 status = "okay";
70
71 flash@0 {
72 compatible = "jedec,spi-nor";
73 reg = <0>;
74 spi-max-frequency = <10000000>;
75
76 partitions {
77 compatible = "fixed-partitions";
78 #address-cells = <1>;
79 #size-cells = <1>;
80
81 partition@0 {
82 label = "u-boot";
83 reg = <0x0 0x30000>;
84 read-only;
85 };
86
87 partition@30000 {
88 label = "u-boot-env";
89 reg = <0x30000 0x10000>;
90 read-only;
91 };
92
93 factory: partition@40000 {
94 label = "factory";
95 reg = <0x40000 0x10000>;
96 read-only;
97 };
98
99 partition@50000 {
100 label = "cimage";
101 reg = <0x50000 0x20000>;
102 read-only;
103 };
104
105 partition@70000 {
106 compatible = "openwrt,uimage", "denx,uimage";
107 openwrt,offset = <FW_EDIMAX_OFFSET>;
108 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
109 label = "firmware";
110 reg = <0x00070000 0x00790000>;
111 };
112 };
113 };
114 };
115
116 &state_default {
117 gpio {
118 groups = "i2c", "uartf", "nd_sd";
119 function = "gpio";
120 };
121 };
122
123 &ethernet {
124 pinctrl-names = "default";
125 pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
126
127 mtd-mac-address = <&factory 0x4>;
128
129 mediatek,portmap = "wllll";
130
131 port@5 {
132 status = "okay";
133 mediatek,fixed-link = <1000 1 1 1>;
134 phy-mode = "rgmii";
135 };
136
137 mdio-bus {
138 status = "okay";
139
140 phy0: ethernet-phy@0 {
141 reg = <0>;
142 phy-mode = "rgmii";
143 };
144
145 phy1: ethernet-phy@1 {
146 reg = <1>;
147 phy-mode = "rgmii";
148 };
149
150 phy2: ethernet-phy@2 {
151 reg = <2>;
152 phy-mode = "rgmii";
153 };
154
155 phy3: ethernet-phy@3 {
156 reg = <3>;
157 phy-mode = "rgmii";
158 };
159
160 phy4: ethernet-phy@4 {
161 reg = <4>;
162 phy-mode = "rgmii";
163 };
164
165 phy1f: ethernet-phy@1f {
166 reg = <0x1f>;
167 phy-mode = "rgmii";
168 };
169 };
170 };
171
172 &wmac {
173 ralink,mtd-eeprom = <&factory 0x0>;
174 };
175
176 &pcie {
177 status = "okay";
178 };
179
180 &pcie0 {
181 wifi@0,0 {
182 reg = <0x0000 0 0 0 0>;
183 mediatek,mtd-eeprom = <&factory 0x8000>;
184 mediatek,2ghz = <0>;
185 };
186 };
187
188 &ehci {
189 status = "okay";
190 };
191
192 &ohci {
193 status = "okay";
194 };