ath79: add support for ALFA Network R36A
[openwrt/staging/mkresin.git] / target / linux / ath79 / dts / qca9531_alfa-network_r36a.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qca953x.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 model = "ALFA Network R36A";
10 compatible = "alfa-network,r36a", "qca,qca9531";
11
12 aliases {
13 label-mac-device = &wmac;
14 led-boot = &led_status;
15 led-failsafe = &led_status;
16 led-running = &led_status;
17 led-upgrade = &led_status;
18 };
19
20 gpio-export {
21 compatible = "gpio-export";
22 #size-cells = <0>;
23
24 usb-power {
25 gpio-export,name = "usb-power";
26 gpio-export,output = <1>;
27 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
28 };
29
30 watchdog-enable {
31 gpio-export,name = "watchdog-enable";
32 gpio-export,output = <1>;
33 gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
34 };
35 };
36
37 keys {
38 compatible = "gpio-keys";
39
40 reset {
41 label = "reset";
42 linux,code = <KEY_RESTART>;
43 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
44 debounce-interval = <60>;
45 };
46
47 rfkill {
48 label = "rfkill";
49 linux,code = <KEY_RFKILL>;
50 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
51 debounce-interval = <60>;
52 };
53 };
54
55 leds {
56 compatible = "gpio-leds";
57
58 pinctrl-names = "default";
59 pinctrl-0 = <&enable_gpio4 &enable_gpio16>;
60
61 lan {
62 label = "r36a:blue:lan";
63 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
64 };
65
66 led_status: status {
67 label = "r36a:blue:status";
68 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
69 };
70
71 usb {
72 label = "r36a:blue:usb";
73 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
74 trigger-sources = <&hub_port0>;
75 linux,default-trigger = "usbport";
76 };
77
78 wan {
79 label = "r36a:blue:wan";
80 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
81 };
82
83 wlan {
84 label = "r36a:blue:wlan";
85 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
86 linux,default-trigger = "phy0tpt";
87 };
88 };
89
90 watchdog {
91 compatible = "linux,wdt-gpio";
92 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
93 hw_algo = "toggle";
94 hw_margin_ms = <25000>;
95 always-running;
96 };
97 };
98
99 &eth0 {
100 status = "okay";
101
102 phy-handle = <&swphy4>;
103 mtd-mac-address = <&art 0x0>;
104 };
105
106 &eth1 {
107 /* Workaround: keep the Ethernet interfaces order/mapping correct
108 * (GMAC0 -> eth0, GMAC1 -> eth1, same as in old ar71xx target) */
109 compatible = "qca,qca9530-eth", "syscon", "simple-mfd";
110
111 mtd-mac-address = <&art 0x6>;
112 };
113
114 &pinmux {
115 enable_gpio4: pinmux_enable_gpio4 {
116 pinctrl-single,bits = <0x04 0x0 0xff>;
117 };
118
119 enable_gpio16: pinmux_enable_gpio16 {
120 pinctrl-single,bits = <0x10 0x0 0xff>;
121 };
122 };
123
124 &spi {
125 status = "okay";
126
127 num-cs = <1>;
128
129 flash@0 {
130 compatible = "jedec,spi-nor";
131 reg = <0>;
132 spi-max-frequency = <50000000>;
133 m25p,fast-read;
134
135 partitions {
136 compatible = "fixed-partitions";
137 #address-cells = <1>;
138 #size-cells = <1>;
139
140 partition@0 {
141 label = "u-boot";
142 reg = <0x000000 0x060000>;
143 read-only;
144 };
145
146 partition@60000 {
147 label = "u-boot-env";
148 reg = <0x060000 0x010000>;
149 };
150
151 art: partition@70000 {
152 label = "art";
153 reg = <0x070000 0x010000>;
154 read-only;
155 };
156
157 partition@80000 {
158 compatible = "denx,uimage";
159 label = "firmware";
160 reg = <0x080000 0xf80000>;
161 };
162 };
163 };
164 };
165
166 &uart {
167 status = "okay";
168 };
169
170 &usb0 {
171 status = "okay";
172
173 #address-cells = <1>;
174 #size-cells = <0>;
175
176 hub_port0: port@1 {
177 reg = <1>;
178 #trigger-source-cells = <0>;
179 };
180 };
181
182 &usb_phy {
183 status = "okay";
184 };
185
186 &wmac {
187 status = "okay";
188
189 mtd-cal-data = <&art 0x1000>;
190 };