ath79: add support for TP-Link MR-3040 v2
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9558_buffalo_bhr-4grv2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "qca9557.dtsi"
8
9 / {
10         compatible = "buffalo,bhr-4grv2", "qca,qca9557";
11         model = "Buffalo BHR-4GRV2";
12
13         aliases {
14                 led-boot = &power;
15                 led-failsafe = &power;
16                 led-running = &power;
17                 led-upgrade = &power;
18         };
19
20         chosen {
21                 bootargs = "console=ttyS0,115200n8";
22         };
23
24         gpio-leds {
25                 compatible = "gpio-leds";
26
27                 power: power {
28                         label = "bhr-4grv2:green:power";
29                         gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
30                         default-state = "on";
31                 };
32
33                 diag {
34                         label = "bhr-4grv2:orange:diag";
35                         gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
36                         default-state = "off";
37                 };
38
39                 vpn_orange {
40                         label = "bhr-4grv2:orange:vpn";
41                         gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
42                         default-state = "off";
43                 };
44
45                 vpn_green {
46                         label = "bhr-4grv2:green:vpn";
47                         gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
48                         default-state = "off";
49                 };
50         };
51
52         gpio-keys-polled {
53                 compatible = "gpio-keys-polled";
54                 poll-interval = <20>;
55
56                 reset {
57                         label = "reset";
58                         gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
59                         linux,code = <KEY_RESTART>;
60                         debounce-interval = <60>;
61                 };
62
63                 eco {
64                         label = "eco";
65                         gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
66                         linux,code = <BTN_0>;
67                         linux,input-type = <EV_SW>;
68                         debounce-interval = <60>;
69                 };
70         };
71 };
72
73 &spi {
74         status = "okay";
75         num-cs = <1>;
76
77         flash@0 {
78                 compatible = "jedec,spi-nor";
79                 reg = <0>;
80                 spi-max-frequency = <25000000>;
81
82                 partitions {
83                         compatible = "fixed-partitions";
84                         #address-cells = <1>;
85                         #size-cells = <1>;
86
87                         partition@0 {
88                                 label = "u-boot";
89                                 reg = <0x000000 0x040000>;
90                                 read-only;
91                         };
92
93                         partition@40000 {
94                                 label = "u-boot-env";
95                                 reg = <0x040000 0x010000>;
96                                 read-only;
97                         };
98
99                         partition@50000 {
100                                 label = "rootfs";
101                                 reg = <0x050000 0xe30000>;
102                         };
103
104                         partition@e80000 {
105                                 label = "kernel";
106                                 reg = <0xe80000 0x170000>;
107                         };
108
109                         art: partition@ff0000 {
110                                 label = "art";
111                                 reg = <0xff0000 0x010000>;
112                                 read-only;
113                         };
114                 };
115         };
116 };
117
118 &mdio0 {
119         status = "okay";
120
121         phy0: ethernet-phy@0 {
122                 reg = <0>;
123
124                 qca,ar8327-initvals = <
125                     0x04 0x80080080 /* PORT0 PAD MODE CTRL */
126                     0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
127                     0x7c 0x0000007e /* PORT0_STATUS */
128                     0x94 0x0000007e /* PORT6 STATUS */
129                 >;
130         };
131 };
132
133 &eth0 {
134         status = "okay";
135
136         mtd-mac-address = <&art 0x0>;
137         phy-handle = <&phy0>;
138         pll-data = <0x56000000 0x00000101 0x00001616>;
139 };
140
141 &eth1 {
142         status = "okay";
143
144         mtd-mac-address = <&art 0x6>;
145         pll-data = <0x03000101 0x00000101 0x00001616>;
146
147         fixed-link {
148                 speed = <1000>;
149                 full-duplex;
150         };
151 };
152
153 &uart {
154         status = "okay";
155 };