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