ramips: add support for EnGenius ESR600
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_engenius_esr600.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 = "engenius,esr600", "ralink,mt7620a-soc";
11         model = "EnGenius ESR600";
12
13         chosen {
14                 bootargs = "console=ttyS0,115200";
15         };
16
17         aliases {
18                 led-boot = &led_power;
19                 led-failsafe = &led_power;
20                 led-running = &led_power;
21                 led-upgrade = &led_power;
22         };
23
24         leds {
25                 compatible = "gpio-leds";
26
27                 led_power: power {
28                         label = "esr600:amber:power";
29                         gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
30                 };
31
32                 wps2g {
33                         label = "esr600:amber:wps2g";
34                         gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
35                 };
36
37                 wlan5g {
38                         label = "esr600:blue:wlan5g";
39                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
40                 };
41
42                 wlan2g {
43                         label = "esr600:blue:wlan2g";
44                         gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
45                 };
46         };
47
48         keys {
49                 compatible = "gpio-keys";
50
51                 reset {
52                         label = "reset";
53                         gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
54                         linux,code = <KEY_RESTART>;
55                         debounce-interval = <60>;
56                 };
57
58                 wps {
59                         label = "wps";
60                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
61                         linux,code = <KEY_WPS_BUTTON>;
62                         debounce-interval = <60>;
63                 };
64
65         };
66
67  };
68
69 &gpio1 {
70         status = "okay";
71 };
72
73 &gpio2 {
74         status = "okay";
75 };
76
77 &gpio3 {
78         status = "okay";
79 };
80
81 &spi0 {
82         status = "okay";
83
84         flash@0 {
85                 compatible = "jedec,spi-nor";
86                 reg = <0>;
87                 spi-max-frequency = <50000000>;
88                 m25p,fast-read;
89
90                 partitions {
91                         compatible = "fixed-partitions";
92                         #address-cells = <1>;
93                         #size-cells = <1>;
94
95                         partition@0 {
96                                 label = "u-boot";
97                                 reg = <0x0 0x30000>;
98                                 read-only;
99                         };
100
101                         partition@30000 {
102                                 label = "u-boot-env";
103                                 reg = <0x30000 0x10000>;
104                                 read-only;
105                         };
106
107                         factory: partition@40000 {
108                                 label = "factory";
109                                 reg = <0x40000 0x10000>;
110                                 read-only;
111                         };
112
113                         iNIC_rf: partition@50000 {
114                                 label = "iNIC_rf";
115                                 reg = <0x50000 0x10000>;
116                                 read-only;
117                         };
118
119                         partition@60000 {
120                                 label = "firmware";
121                                 reg = <0x60000 0xf40000>;
122                                 compatible = "denx,uimage";
123                         };
124
125                         partition@fa0000 {
126                                 label = "backup";
127                                 reg = <0xfa0000 0x10000>;
128                                 read-only;
129                         };
130
131                         partition@fb0000 {
132                                 label = "storage";
133                                 reg = <0xfb0000 0x50000>;
134                                 read-only;
135                         };
136                 };
137         };
138 };
139
140 &ethernet {
141         status = "okay";
142         pinctrl-names = "default";
143         pinctrl-0 = <&rgmii1_pins &mdio_pins>;
144         mtd-mac-address = <&iNIC_rf 0x4>;
145
146         port@5 {
147                 status = "okay";
148                 phy-mode = "rgmii";
149                 mediatek,fixed-link = <1000 1 1 1>;
150         };
151
152         mdio-bus {
153                 status = "okay";
154                 mediatek,mdio-mode;
155
156                 ethernet-phy@0 {
157                         reg = <0>;
158                         phy-mode = "rgmii";
159                         qca,ar8327-initvals = <
160                                 0x10 0x40000000 /* POWER-ON STRAPPING */
161                                 0x04 0x07600000 /* PORT0 PAD MODE CTRL */
162                                 0x7c 0x0000007e /* PORT0 STATUS */
163                                 0x0c 0x05600000 /* PORT6 PAD MODE CTRL */
164                                 0x94 0x0000007e /* PORT6 STATUS */
165                                 >;
166                 };
167         };
168 };
169
170 &pinctrl {
171         state_default: pinctrl0 {
172                 gpio {
173                         ralink,group =  "i2c",  /* gpio0: 1-2 */
174                                 "uartf",        /* gpio0: 7-14 */
175                                 "nd_sd",        /* gpio2: 45-59 */
176                                 "wled";         /* gpio3: 72 */
177                         ralink,function = "gpio";
178                 };
179         };
180 };
181
182 &pcie {
183         status = "okay";
184 };
185
186 &pcie0 {
187         wifi@0,0 {
188                 compatible = "pci1814,5592";
189                 reg = <0x0 0 0 0 0>;
190                 ralink,mtd-eeprom = <&factory 0x0>;
191         };
192 };
193
194 &wmac {
195         ralink,mtd-eeprom = <&iNIC_rf 0x0>;
196 };
197
198 &ehci {
199         status = "okay";
200 };
201
202 &ohci {
203         status = "okay";
204 };