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