8489c8a1e6a62625d1cca8f7c01326680d4bd1ad
[openwrt/staging/mkresin.git] / target / linux / ath79 / dts / qca9561_avm_fritz4020.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 "qca956x.dtsi"
8
9 / {
10 compatible = "avm,fritz4020", "qca,qca9560";
11 model = "AVM FRITZ!Box 4020";
12
13 aliases {
14 led-boot = &power;
15 led-failsafe = &info_red;
16 led-running = &power;
17 led-upgrade = &info_red;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200n8";
22 };
23
24 led_spi {
25 compatible = "spi-gpio";
26 #address-cells = <1>;
27 #size-cells = <0>;
28
29 gpio-sck = <&gpio 20 GPIO_ACTIVE_HIGH>;
30 gpio-mosi = <&gpio 19 GPIO_ACTIVE_HIGH>;
31 num-chipselects = <0>;
32
33 led_gpio: led_gpio@0 {
34 compatible = "fairchild,74hc595";
35 reg = <0>;
36 gpio-controller;
37 #gpio-cells = <2>;
38 registers-number = <1>;
39 lines-initial-states = /bits/ 8 <0xff>;
40 spi-max-frequency = <10000000>;
41
42 gpio_latch_bit {
43 gpio-hog;
44 gpios = <7 GPIO_ACTIVE_HIGH>;
45 output-high;
46 line-name = "gpio-latch-bit";
47 };
48 };
49 };
50
51 leds {
52 compatible = "gpio-leds";
53
54 power: power {
55 label = "fritz4020:green:power";
56 gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
57 default-state = "on";
58 };
59
60 wlan {
61 label = "fritz4020:green:wlan";
62 gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>;
63 linux,default-trigger = "phy0tpt";
64 default-state = "off";
65 };
66
67 lan {
68 label = "fritz4020:green:lan";
69 gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
70 default-state = "off";
71 };
72
73 wan {
74 label = "fritz4020:green:wan";
75 gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>;
76 default-state = "off";
77 };
78
79 info {
80 label = "fritz4020:green:info";
81 gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
82 default-state = "off";
83 };
84
85 info_red: info_red {
86 label = "fritz4020:red:info";
87 gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
88 default-state = "off";
89 };
90 };
91
92 keys {
93 compatible = "gpio-keys-polled";
94 poll-interval = <100>;
95
96 wps_button {
97 label = "WPS button";
98 linux,code = <KEY_WPS_BUTTON>;
99 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
100 };
101
102 wlan_button {
103 label = "WLAN button";
104 linux,code = <KEY_RFKILL>;
105 gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
106 };
107 };
108 };
109
110 &uart {
111 status = "okay";
112 };
113
114 &gpio {
115 status = "okay";
116 };
117
118 &spi {
119 status = "okay";
120 num-cs = <1>;
121
122 flash@0 {
123 compatible = "jedec,spi-nor";
124 reg = <0>;
125 spi-max-frequency = <25000000>;
126
127 partitions {
128 compatible = "fixed-partitions";
129 #address-cells = <1>;
130 #size-cells = <1>;
131
132 partition@0 {
133 label = "urlader";
134 reg = <0x000000 0x020000>;
135 read-only;
136 };
137
138 partition@1 {
139 label = "firmware";
140 reg = <0x020000 0xee0000>;
141 };
142
143 partition@2 {
144 label = "tffs (1)";
145 reg = <0xf00000 0x080000>;
146 read-only;
147 };
148
149 partition@3 {
150 label = "tffs (2)";
151 reg = <0xf80000 0x080000>;
152 read-only;
153 };
154 };
155 };
156 };
157
158 &eth0 {
159 status = "okay";
160
161 phy-mode = "mii";
162 phy-handle = <&swphy0>;
163
164 gmac-config {
165 device = <&gmac>;
166
167 switch-phy-addr-swap = <1>;
168 switch-phy-swap = <1>;
169 };
170 };
171
172 &eth1 {
173 status = "okay";
174 };
175
176 &wmac {
177 status = "okay";
178 qca,no-eeprom;
179 };