ath79: ar: convert to nvmem-layout
[openwrt/staging/hauke.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 nvmem-layout {
107 compatible = "fixed-layout";
108 #address-cells = <1>;
109 #size-cells = <1>;
110
111 macaddr_uboot_1fc00: macaddr@1fc00 {
112 reg = <0x1fc00 0x6>;
113 };
114 };
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 nvmem-cells = <&macaddr_uboot_1fc00>;
142 nvmem-cell-names = "mac-address";
143 };
144 };
145
146 &eth0 {
147 status = "okay";
148
149 nvmem-cells = <&macaddr_uboot_1fc00>;
150 nvmem-cell-names = "mac-address";
151 mac-address-increment = <(-1)>;
152 };
153
154 &eth1 {
155 nvmem-cells = <&macaddr_uboot_1fc00>;
156 nvmem-cell-names = "mac-address";
157 mac-address-increment = <1>;
158 };