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