ath79: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar9341_tplink_tl-wr842n-v2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include <dt-bindings/leds/common.h>
4
5 #include "ar9341_tplink.dtsi"
6
7 / {
8 model = "TP-Link TL-WR842N/ND v2";
9 compatible = "tplink,tl-wr842n-v2", "qca,ar9341";
10
11 aliases {
12 label-mac-device = &wmac;
13 };
14
15 keys {
16 compatible = "gpio-keys";
17
18 rfkill {
19 label = "WiFi";
20 linux,code = <KEY_RFKILL>;
21 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
22 debounce-interval = <60>;
23 };
24
25 reset {
26 label = "Reset";
27 linux,code = <KEY_RESTART>;
28 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
29 debounce-interval = <60>;
30 };
31 };
32
33 gpio-export {
34 compatible = "gpio-export";
35
36 gpio_usb_power {
37 gpio-export,name = "tp-link:power:usb";
38 gpio-export,output = <1>;
39 gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
40 };
41 };
42 };
43
44 &leds {
45 usb {
46 function = LED_FUNCTION_USB;
47 color = <LED_COLOR_ID_GREEN>;
48 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
49 trigger-sources = <&hub_port>;
50 linux,default-trigger = "usbport";
51 };
52 };
53
54 &spi {
55 status = "okay";
56
57 flash@0 {
58 compatible = "jedec,spi-nor";
59 reg = <0>;
60 spi-max-frequency = <25000000>;
61
62 partitions {
63 compatible = "fixed-partitions";
64 #address-cells = <1>;
65 #size-cells = <1>;
66
67 uboot: partition@0 {
68 label = "u-boot";
69 reg = <0x000000 0x020000>;
70 read-only;
71
72 nvmem-layout {
73 compatible = "fixed-layout";
74 #address-cells = <1>;
75 #size-cells = <1>;
76
77 macaddr_uboot_1fc00: macaddr@1fc00 {
78 compatible = "mac-base";
79 reg = <0x1fc00 0x6>;
80 #nvmem-cell-cells = <1>;
81 };
82 };
83 };
84
85 partition@20000 {
86 compatible = "tplink,firmware";
87 label = "firmware";
88 reg = <0x020000 0x7d0000>;
89 };
90
91 art: partition@7f0000 {
92 label = "art";
93 reg = <0x7f0000 0x010000>;
94 read-only;
95 };
96 };
97 };
98 };
99
100 &usb {
101 status = "okay";
102 };
103
104 &usb_phy {
105 status = "okay";
106 };
107
108 &eth0 {
109 nvmem-cells = <&macaddr_uboot_1fc00 (-1)>;
110 nvmem-cell-names = "mac-address";
111 };
112
113 &eth1 {
114 phy-handle = <&swphy4>;
115
116 nvmem-cells = <&macaddr_uboot_1fc00 0>;
117 nvmem-cell-names = "mac-address";
118 };
119
120 &wmac {
121 mtd-cal-data = <&art 0x1000>;
122
123 nvmem-cells = <&macaddr_uboot_1fc00 0>;
124 nvmem-cell-names = "mac-address";
125 };