ath79: DTS file style update and harmonization
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7241_tplink_tl-wr842n-v1.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 "ar7241.dtsi"
8
9 / {
10         compatible = "tplink,tl-wr842n-v1", "qca,ar7241";
11         model = "TP-Link TL-WR842N/ND v1";
12
13         aliases {
14                 led-boot = &led_system;
15                 led-failsafe = &led_system;
16                 led-running = &led_system;
17                 led-upgrade = &led_system;
18                 label-mac-device = &ath9k;
19         };
20
21         keys {
22                 compatible = "gpio-keys";
23
24                 rfkill {
25                         label = "rfkill";
26                         linux,code = <KEY_RFKILL>;
27                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
28                         debounce-interval = <60>;
29                 };
30
31                 reset {
32                         label = "reset";
33                         linux,code = <KEY_RESTART>;
34                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
35                         debounce-interval = <60>;
36                 };
37         };
38
39         leds {
40                 compatible = "gpio-leds";
41
42                 led_system: system {
43                         label = "tp-link:green:system";
44                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
45                 };
46
47                 qss {
48                         label = "tp-link:green:qss";
49                         gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
50                 };
51
52                 led3g {
53                         label = "tp-link:green:3g";
54                         gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
55                         trigger-sources = <&hub_port>;
56                         linux,default-trigger = "usbport";
57                 };
58         };
59
60         ath9k-leds {
61                 compatible = "gpio-leds";
62
63                 wlan {
64                         label = "tp-link:green:wlan";
65                         gpios = <&ath9k 0 GPIO_ACTIVE_LOW>;
66                         linux,default-trigger = "phy0tpt";
67                 };
68         };
69
70         gpio-export {
71                 compatible = "gpio-export";
72
73                 gpio_usb_power {
74                         gpio-export,name = "tp-link:power:usb";
75                         gpio-export,output = <1>;
76                         gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
77                 };
78         };
79 };
80
81 &usb {
82         #address-cells = <1>;
83         #size-cells = <0>;
84         status = "okay";
85
86         hub_port: port@1 {
87                 reg = <1>;
88                 #trigger-source-cells = <0>;
89         };
90 };
91
92 &usb_phy {
93         status = "okay";
94 };
95
96 &spi {
97         status = "okay";
98
99         num-cs = <1>;
100
101         flash@0 {
102                 compatible = "jedec,spi-nor";
103                 reg = <0>;
104                 spi-max-frequency = <25000000>;
105
106                 partitions {
107                         compatible = "fixed-partitions";
108                         #address-cells = <1>;
109                         #size-cells = <1>;
110
111                         uboot: partition@0 {
112                                 reg = <0x0 0x20000>;
113                                 label = "u-boot";
114                                 read-only;
115                         };
116
117                         partition@20000 {
118                                 compatible = "tplink,firmware";
119                                 reg = <0x20000 0x7d0000>;
120                                 label = "firmware";
121                         };
122
123                         partition@7f0000 {
124                                 reg = <0x7f0000 0x10000>;
125                                 label = "art";
126                                 read-only;
127                         };
128                 };
129         };
130 };
131
132 &pcie {
133         status = "okay";
134
135         ath9k: wifi@0,0 {
136                 compatible = "pci168c,002e";
137                 reg = <0x0000 0 0 0 0>;
138                 #gpio-cells = <2>;
139                 gpio-controller;
140                 qca,no-eeprom;
141                 mtd-mac-address = <&uboot 0x1fc00>;
142         };
143 };
144
145 &eth0 {
146         status = "okay";
147
148         mtd-mac-address = <&uboot 0x1fc00>;
149         mtd-mac-address-increment = <(-1)>;
150 };
151
152 &eth1 {
153         status = "okay";
154
155         mtd-mac-address = <&uboot 0x1fc00>;
156         mtd-mac-address-increment = <1>;
157 };
158
159 &gpio {
160         status = "okay";
161 };
162
163 &uart {
164         status = "okay";
165 };