ramips: add support for EnGenius ESR600
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_dlink_dwr-118-a1.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 = "dlink,dwr-118-a1", "ralink,mt7620a-soc";
11         model = "D-Link DWR-118 A1";
12
13         aliases {
14                 led-boot = &led_internet;
15                 led-failsafe = &led_internet;
16                 led-upgrade = &led_internet;
17         };
18
19         keys {
20                 compatible = "gpio-keys-polled";
21                 poll-interval = <20>;
22
23                 wps {
24                         label = "wps";
25                         gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
26                         linux,code = <KEY_WPS_BUTTON>;
27                 };
28
29                 reset {
30                         label = "reset";
31                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
32                         linux,code = <KEY_RESTART>;
33                 };
34         };
35
36         leds {
37                 compatible = "gpio-leds";
38
39                 wan {
40                         label = "dwr-118-a1:green:wan";
41                         gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
42                 };
43
44                 led_internet: internet {
45                         label = "dwr-118-a1:green:internet";
46                         gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
47                 };
48
49                 lan {
50                         label = "dwr-118-a1:green:lan";
51                         gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
52                 };
53
54                 wlan2g {
55                         label = "dwr-118-a1:green:wlan2g";
56                         gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
57                 };
58
59                 usb {
60                         label = "dwr-118-a1:green:usb";
61                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
62                         trigger-sources = <&ohci_port1>, <&ehci_port1>;
63                         linux,default-trigger = "usbport";
64                 };
65         };
66
67         gpio_export {
68                 compatible = "gpio-export";
69                 #size-cells = <0>;
70
71                 usb {
72                         gpio-export,name = "usb";
73                         gpio-export,output = <0>;
74                         gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
75                 };
76         };
77 };
78
79 &gpio1 {
80         status = "okay";
81 };
82
83 &gpio2 {
84         status = "okay";
85 };
86
87 &gpio3 {
88         status = "okay";
89 };
90
91 &spi0 {
92         status = "okay";
93
94         flash@0 {
95                 compatible = "jedec,spi-nor";
96                 reg = <0>;
97                 spi-max-frequency = <80000000>;
98
99                 partitions {
100                         compatible = "fixed-partitions";
101                         #address-cells = <1>;
102                         #size-cells = <1>;
103
104                         partition@0 {
105                                 label = "jboot";
106                                 reg = <0x0 0x10000>;
107                                 read-only;
108                         };
109
110                         partition@10000 {
111                                 compatible = "amit,jimage";
112                                 label = "firmware";
113                                 reg = <0x10000 0xfe0000>;
114                         };
115
116                         config: partition@ff0000 {
117                                 label = "config";
118                                 reg = <0xff0000 0x10000>;
119                                 read-only;
120                         };
121                 };
122         };
123 };
124
125 &ehci {
126         status = "okay";
127 };
128
129 &ohci {
130         status = "okay";
131 };
132
133 &pinctrl {
134         state_default: pinctrl0 {
135                 default {
136                         ralink,group = "ephy", "uartf", "spi refclk", "wled";
137                         ralink,function = "gpio";
138                 };
139         };
140 };
141
142 &pcie {
143         status = "okay";
144 };
145
146 &pcie0 {
147         wifi@0,0 {
148                 reg = <0x0000 0 0 0 0>;
149                 mtd-mac-address = <&config 0xe496>;
150                 mtd-mac-address-increment = <(2)>;
151                 mediatek,mtd-eeprom = <&config 0xe083>;
152
153                 led {
154                         led-sources = <0>;
155                         led-active-low;
156                 };
157         };
158 };
159
160 &ethernet {
161         status = "okay";
162         pinctrl-names = "default";
163         pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
164
165         port@4 {
166                 status = "okay";
167                 phy-handle = <&phy4>;
168                 phy-mode = "rgmii";
169         };
170
171         port@5 {
172                 status = "okay";
173                 phy-handle = <&phy5>;
174                 phy-mode = "rgmii";
175         };
176
177         mdio-bus {
178                 status = "okay";
179
180                 phy4: ethernet-phy@4 {
181                         reg = <4>;
182                         phy-mode = "rgmii-rxid";
183                 };
184
185                 phy5: ethernet-phy@5 {
186                         reg = <5>;
187                         phy-mode = "rgmii-rxid";
188                 };
189         };
190 };
191
192 &gsw {
193         mediatek,port4 = "gmac";
194 };