ath79: improve support for D-Link DIR-8x9 A1 series
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar9344_tplink_cpe.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9344.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/mtd/partitions/uimage.h>
8
9 / {
10 aliases {
11 label-mac-device = &wmac;
12 };
13
14 keys {
15 compatible = "gpio-keys";
16
17 reset {
18 linux,code = <KEY_RESTART>;
19 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
20 debounce-interval = <60>;
21 };
22 };
23 };
24
25 &ref {
26 clock-frequency = <40000000>;
27 };
28
29 &spi {
30 status = "okay";
31
32 flash@0 {
33 compatible = "jedec,spi-nor";
34 reg = <0>;
35 spi-max-frequency = <25000000>;
36
37 partitions {
38 compatible = "fixed-partitions";
39 #address-cells = <1>;
40 #size-cells = <1>;
41
42 uboot: partition@0 {
43 label = "u-boot";
44 reg = <0x000000 0x020000>;
45 read-only;
46 };
47
48 partition@20000 {
49 label = "partition-table";
50 reg = <0x020000 0x010000>;
51 read-only;
52 };
53
54 info: partition@30000 {
55 label = "info";
56 reg = <0x030000 0x010000>;
57 read-only;
58 };
59
60 partition@40000 {
61 label = "firmware";
62 reg = <0x040000 0x780000>;
63 compatible = "openwrt,uimage", "denx,uimage";
64 openwrt,ih-magic = <IH_MAGIC_OKLI>;
65 openwrt,offset = <0x3000>;
66 };
67
68 partition@7c0000 {
69 label = "config";
70 reg = <0x7c0000 0x030000>;
71 read-only;
72 };
73
74 art: partition@7f0000 {
75 label = "art";
76 reg = <0x7f0000 0x010000>;
77 read-only;
78 };
79 };
80 };
81 };
82
83 &wmac {
84 status = "okay";
85
86 mtd-cal-data = <&art 0x1000>;
87 nvmem-cells = <&macaddr_info_8>;
88 nvmem-cell-names = "mac-address";
89 };
90
91 &eth0 {
92 status = "okay";
93
94 phy-handle = <&swphy4>;
95
96 nvmem-cells = <&macaddr_info_8>;
97 nvmem-cell-names = "mac-address";
98 };
99
100 &eth1 {
101 status = "okay";
102 };
103
104 &gpio {
105 gpio_ext_lna0 {
106 gpio-hog;
107 gpios = <18 GPIO_ACTIVE_HIGH>;
108 output-high;
109 line-name = "tp-link:ext:lna0";
110 };
111
112 gpio_ext_lna1 {
113 gpio-hog;
114 gpios = <19 GPIO_ACTIVE_HIGH>;
115 output-high;
116 line-name = "tp-link:ext:lna1";
117 };
118 };
119
120 &info {
121 compatible = "nvmem-cells";
122 #address-cells = <1>;
123 #size-cells = <1>;
124
125 macaddr_info_8: macaddr@8 {
126 reg = <0x8 0x6>;
127 };
128 };