ath79: convert to new LED color/function format where possible
[openwrt/staging/robimarko.git] / target / linux / ath79 / dts / ar7242_tplink_tl-wr2543-v1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar7242.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "tplink,tl-wr2543-v1", "qca,ar7242";
11 model = "TP-Link TL-WR2543N/ND";
12
13 aliases {
14 led-boot = &led_wps;
15 led-failsafe = &led_wps;
16 led-running = &led_wps;
17 led-upgrade = &led_wps;
18 label-mac-device = &eth0;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200n8";
23 };
24
25 keys {
26 compatible = "gpio-keys";
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 leds {
44 compatible = "gpio-leds";
45
46 led_wps: wps {
47 function = LED_FUNCTION_WPS;
48 color = <LED_COLOR_ID_GREEN>;
49 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
50 };
51
52 usb {
53 function = LED_FUNCTION_USB;
54 color = <LED_COLOR_ID_GREEN>;
55 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
56 trigger-sources = <&hub_port>;
57 linux,default-trigger = "usbport";
58 };
59 };
60
61 ath9k-leds {
62 compatible = "gpio-leds";
63
64 wlan2g {
65 label = "green:wlan2g";
66 gpios = <&ath9k 0 GPIO_ACTIVE_LOW>;
67 linux,default-trigger = "phy0tpt";
68 };
69
70 wlan5g {
71 label = "green:wlan5g";
72 gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
73 linux,default-trigger = "phy0tpt";
74 };
75 };
76
77 rtl8367 {
78 compatible = "realtek,rtl8367";
79 gpio-sda = <&gpio 1 GPIO_ACTIVE_HIGH>;
80 gpio-sck = <&gpio 6 GPIO_ACTIVE_HIGH>;
81 realtek,extif0 = <1 0 1 1 1 1 1 1 2>;
82
83 mdio-bus {
84 #address-cells = <1>;
85 #size-cells = <0>;
86 status = "okay";
87
88 phy0: ethernet-phy@0 {
89 reg = <0>;
90 };
91 };
92 };
93 };
94
95 &spi {
96 status = "okay";
97
98 flash@0 {
99 compatible = "jedec,spi-nor";
100 reg = <0>;
101 spi-max-frequency = <25000000>;
102 m25p,fast-read;
103
104 partitions {
105 compatible = "fixed-partitions";
106 #address-cells = <1>;
107 #size-cells = <1>;
108
109 uboot: partition@0 {
110 label = "u-boot";
111 reg = <0x000000 0x020000>;
112 read-only;
113
114 nvmem-layout {
115 compatible = "fixed-layout";
116 #address-cells = <1>;
117 #size-cells = <1>;
118
119 macaddr_uboot_1fc00: macaddr@1fc00 {
120 reg = <0x1fc00 0x6>;
121 };
122 };
123 };
124
125 partition@20000 {
126 compatible = "tplink,firmware";
127 label = "firmware";
128 reg = <0x020000 0x7d0000>;
129 };
130
131 art: partition@7f0000 {
132 label = "art";
133 reg = <0x7f0000 0x010000>;
134 read-only;
135
136 nvmem-layout {
137 compatible = "fixed-layout";
138 #address-cells = <1>;
139 #size-cells = <1>;
140
141 cal_art_1000: cal@1000 {
142 reg = <0x1000 0x440>;
143 };
144 };
145 };
146 };
147 };
148 };
149
150 &usb {
151 status = "okay";
152 };
153
154 &usb_phy {
155 status = "okay";
156 };
157
158 &pcie {
159 status = "okay";
160
161 ath9k: wifi@0,0 {
162 reg = <0x0000 0 0 0 0>;
163 #gpio-cells = <2>;
164 gpio-controller;
165 nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_art_1000>;
166 nvmem-cell-names = "mac-address", "calibration";
167 };
168 };
169
170 &eth0 {
171 status = "okay";
172
173 phy-mode = "rgmii";
174 nvmem-cells = <&macaddr_uboot_1fc00>;
175 nvmem-cell-names = "mac-address";
176
177 phy-handle = <&phy0>;
178 fixed-link {
179 speed = <1000>;
180 full-duplex;
181 };
182 };