ath79: add support of D-Link DIR-825 B1
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7161_dlink_dir-825-b1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "ar7100.dtsi"
8
9 / {
10         compatible = "dlink,dir-825-b1", "qca,ar7161";
11         model = "D-Link DIR825B1";
12
13         aliases {
14                 led-status = &orange_power;
15         };
16
17         chosen {
18                 bootargs = "console=ttyS0,115200";
19         };
20
21         extosc: ref {
22                 compatible = "fixed-clock";
23                 #clock-cells = <0>;
24                 clock-output-names = "ref";
25                 clock-frequency = <40000000>;
26         };
27
28         leds {
29                 compatible = "gpio-leds";
30                 blue_usb {
31                         label = "d-link:blue:usb";
32                         gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
33                         default-state = "off";
34                         trigger-sources = <&usb_ochi_port>, <&usb_echi_port>;
35                         linux,default-trigger = "usbport";
36                 };
37
38                 orange_power: orange_power {
39                         label = "d-link:orange:power";
40                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
41                 };
42
43                 blue_power {
44                         label = "d-link:blue:power";
45                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
46                         default-state = "off";
47                 };
48
49                 blue_wps {
50                         label = "d-link:blue:wps";
51                         gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
52                         default-state = "off";
53                 };
54
55                 orange_planet {
56                         label = "d-link:orange:planet";
57                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
58                         default-state = "off";
59                 };
60
61                 blue_planet {
62                         label = "d-link:blue:planet";
63                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
64                         default-state = "off";
65                 };
66         };
67
68         ath9k-leds {
69                 compatible = "gpio-leds";
70
71                 wlan2g {
72                         label = "d-link:blue:wlan2g";
73                         gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>;
74                         default-state = "off";
75                         linux,default-trigger = "phy0tpt";
76                 };
77
78                 wlan5g {
79                         label = "d-link:blue:wlan5g";
80                         gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>;
81                         default-state = "off";
82                         linux,default-trigger = "phy1tpt";
83                 };
84
85         };
86
87         keys {
88                 compatible = "gpio-keys-polled";
89                 poll-interval = <20>;
90
91                 reset {
92                         label = "reset";
93                         linux,code = <KEY_RESTART>;
94                         gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
95                         debounce-interval = <60>;
96                 };
97
98                 wps {
99                         label = "wps";
100                         linux,code = <KEY_WPS_BUTTON>;
101                         gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
102                         debounce-interval = <60>;
103                 };
104         };
105
106         rtl8366s {
107                 compatible = "realtek,rtl8366s";
108                 gpio-sda = <&gpio 5 GPIO_ACTIVE_HIGH>;
109                 gpio-sck = <&gpio 7 GPIO_ACTIVE_HIGH>;
110                 realtek,initvals = <0x06 0x0108>;
111
112                 mdio-bus {
113                         #address-cells = <1>;
114                         #size-cells = <0>;
115                         status = "okay";
116
117                         phy-mask = <0x10>;
118
119                         phy4: ethernet-phy@4 {
120                                 reg = <4>;
121                                 phy-mode = "rgmii";
122                         };
123                 };
124         
125         };
126 };
127
128
129 &usb1 {
130         #address-cells = <1>;
131         #size-cells = <0>;
132         status = "okay";
133
134         usb_ochi_port: port@1 {
135                 reg = <1>;
136                 #trigger-source-cells = <0>;
137         };
138 };
139
140 &usb2 {
141         #address-cells = <1>;
142         #size-cells = <0>;
143         status = "okay";
144
145         usb_echi_port: port@1 {
146                 reg = <1>;
147                 #trigger-source-cells = <0>;
148         };
149 };
150
151 &usb_phy {
152         status = "okay";
153 };
154
155 &pcie0 {
156         status = "okay";
157
158         ath9k0: wifi@0,11 {
159                 compatible = "pci168c,0029";
160                 reg = <0x8800 0 0 0 0>;
161                 qca,no-eeprom;
162                 #gpio-cells = <2>;
163                 gpio-controller;
164         };
165
166         ath9k1: wifi@0,12 {
167                 compatible = "pci168c,0029";
168                 reg = <0x9000 0 0 0 0>;
169                 qca,no-eeprom;
170                 #gpio-cells = <2>;
171                 gpio-controller;
172         };
173 };
174
175 &uart {
176         status = "okay";
177 };
178
179 &pll {
180     clocks = <&extosc>;
181 };
182
183 &spi {
184         status = "okay";
185         num-cs = <1>;
186
187         flash@0 {
188                 compatible = "jedec,spi-nor";
189                 reg = <0>;
190                 spi-max-frequency = <25000000>;
191
192                 partitions {
193                         compatible = "fixed-partitions";
194                         #address-cells = <1>;
195                         #size-cells = <1>;
196
197                         partition@0 {
198                                 label = "u-boot";
199                                 reg = <0x000000 0x040000>;
200                                 read-only;
201                         };
202
203                         partition@40000 {
204                                 label = "config";
205                                 reg = <0x040000 0x010000>;
206                                 read-only;
207                         };
208
209                         partition@50000 {
210                                 label = "firmware";
211                                 reg = <0x050000 0x610000>;
212                         };
213
214                         caldata: partition@60000 {
215                                 label = "caldata";
216                                 reg = <0x660000 0x010000>;
217                                 read-only;
218                         };
219
220                         partition@670000 {
221                                 label = "unknown";
222                                 reg = <0x670000 0x190000>;
223                                 read-only;
224                         };
225                 };
226         };
227 };
228
229
230 &eth0 {
231         status = "okay";
232         pll-data = <0x11110000 0x00001099 0x00991099>;
233
234         fixed-link {
235                 speed = <1000>;
236                 full-duplex;
237         };
238
239 };
240
241 &eth1 {
242         status = "okay";
243         pll-data = <0x11110000 0x00001099 0x00991099>;
244
245         phy-handle = <&phy4>;
246
247 };