ath79: add support for ON Networks N150R
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7240_tl-wr740n-v2.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 "ar7240.dtsi"
8
9 / {
10         compatible = "tplink,tl-wr740n-v2", "qca,ar7240";
11         model = "TP-Link TL-WR740N v2";
12
13         aliases {
14                 led-status = &led_system;
15         };
16
17         memory@0 {
18                 device_type = "memory";
19                 reg = <0x0 0x2000000>;
20         };
21
22         gpio-keys-polled {
23                 compatible = "gpio-keys-polled";
24                 #address-cells = <1>;
25                 #size-cells = <0>;
26                 poll-interval = <20>;
27
28                 reset {
29                         label = "reset";
30                         linux,code = <KEY_RESTART>;
31                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
32                         debounce-interval = <60>;
33                 };
34
35                 wps {
36                         label = "wps";
37                         linux,code = <KEY_WPS_BUTTON>;
38                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
39                         debounce-interval = <60>;
40                 };
41         };
42
43         gpio-leds {
44                 compatible = "gpio-leds";
45                 pinctrl-names = "default";
46                 pinctrl-0 = <&switch_led_pins>;
47
48                 led_system: system {
49                         label = "tl-wr740n-v2:green:system";
50                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
51                 };
52
53                 lan1 {
54                         label = "tl-wr740n-v2:green:lan1";
55                         gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
56                 };
57
58                 lan2 {
59                         label = "tl-wr740n-v2:green:lan2";
60                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
61                 };
62
63                 lan3 {
64                         label = "tl-wr740n-v2:green:lan3";
65                         gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
66                 };
67
68                 lan4 {
69                         label = "tl-wr740n-v2:green:lan4";
70                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
71                 };
72
73                 wan {
74                         label = "tl-wr740n-v2:green:wan";
75                         gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
76                 };
77
78                 wlan {
79                         label = "tl-wr740n-v2:green:wlan";
80                         gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
81                         default-state = "off";
82                         linux,default-trigger = "phy0tpt";
83                 };
84
85                 wps {
86                         label = "tl-wr740n-v2:green:wps";
87                         gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
88                 };
89         };
90 };
91
92 &spi {
93         status = "okay";
94         num-cs = <1>;
95
96         flash@0 {
97                 #address-cells = <1>;
98                 #size-cells = <1>;
99                 compatible = "jedec,spi-nor";
100                 reg = <0>;
101                 spi-max-frequency = <25000000>;
102
103                 partitions {
104                         compatible = "fixed-partitions";
105                         #address-cells = <1>;
106                         #size-cells = <1>;
107
108                         uboot: partition@0 {
109                                 reg = <0x0 0x20000>;
110                                 label = "u-boot";
111                                 read-only;
112                         };
113
114                         firmware: partition@20000 {
115                                 reg = <0x20000 0x3d0000>;
116                                 label = "firmware";
117                         };
118
119                         art: partition@3f0000 {
120                                 reg = <0x3f0000 0x10000>;
121                                 label = "art";
122                                 read-only;
123                         };
124                 };
125         };
126 };
127
128 &eth0 {
129         status = "okay";
130
131         phy-handle = <&phy4>;
132
133         mtd-mac-address = <&uboot 0x1fc00>;
134         mtd-mac-address-increment = <(-1)>;
135 };
136
137 &eth1 {
138         status = "okay";
139
140         mtd-mac-address = <&uboot 0x1fc00>;
141         mtd-mac-address-increment = <1>;
142 };
143
144 &mdio0 {
145         status = "okay";
146
147         phy4: ethernet-phy@4 {
148                 reg = <4>;
149                 phy-mode = "mii";
150         };
151 };
152
153 &pcie {
154         status = "okay";
155
156         ath9k: wifi@168c,002b {
157                 compatible = "pci168c,002b";
158                 reg = <0x0000 0 0 0 0>;
159                 qca,no-eeprom;
160                 mtd-mac-address = <&uboot 0x1fc00>;
161                 #gpio-cells = <2>;
162                 gpio-controller;
163         };
164 };
165
166 &pinmux {
167         switch_led_pins: pinmux_switch_led_pins {
168                 pinctrl-single,bits = <0x0 0x0 0xf8>;
169         };
170 };
171
172 &uart {
173         status = "okay";
174 };