ath79: add support for Arduino Yun
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar9331_arduino_yun.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 "ar9331.dtsi"
8
9 / {
10 model = "Arduino Yun";
11 compatible = "arduino,yun", "qca,ar9331";
12
13 aliases {
14 serial0 = &uart;
15 };
16
17 chosen {
18 bootargs = "console=ttyATH0,250000";
19 };
20
21 ahb {
22 apb {
23 pinmux_extended: pinmux@18040030 {
24 compatible = "pinctrl-single";
25 reg = <0x18040030 0x4>;
26
27 pinctrl-single,bit-per-mux;
28 pinctrl-single,register-width = <32>;
29 pinctrl-single,function-mask = <0x1>;
30 #pinctrl-cells = <2>;
31
32 enable_gpio11: pinmux_enable_gpio11 {
33 pinctrl-single,bits = <0x0 0x200 0x200>;
34 };
35 };
36
37 pinmux_bootstrap: pinmux@180600ac {
38 compatible = "pinctrl-single";
39 reg = <0x180600ac 0x4>;
40
41 pinctrl-single,bit-per-mux;
42 pinctrl-single,register-width = <32>;
43 pinctrl-single,function-mask = <0x1>;
44 #pinctrl-cells = <2>;
45
46 enable_gpio26_gpio27: pinmux_enable_gpio26_gpio27 {
47 pinctrl-single,bits = <0x0 0x40000 0x40000>;
48 };
49 };
50 };
51 };
52
53 leds {
54 compatible = "gpio-leds";
55
56 wlan {
57 label = "yun:blue:wlan";
58 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
59 linux,default-trigger = "phy0tpt";
60 };
61
62 usb {
63 label = "yun:white:usb";
64 gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
65 trigger-sources = <&hub_port1>;
66 linux,default-trigger = "usbport";
67 };
68 };
69
70 keys {
71 compatible = "gpio-keys";
72
73 config {
74 label = "config";
75 linux,code = <BTN_0>;
76 gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
77 };
78 };
79
80 gpio-export {
81 compatible = "gpio-export";
82
83 gpio_spi_enable {
84 gpio-export,name = "yun:oe:spi";
85 gpio-export,output = <0>;
86 gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
87 };
88
89 gpio_handshake_enable {
90 gpio-export,name = "yun:oe:hs";
91 gpio-export,output = <0>;
92 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
93 };
94
95 gpio_uart_enable {
96 gpio-export,name = "yun:oe:uart";
97 gpio-export,output = <0>;
98 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
99 };
100 };
101
102 reg_usb_vbus: reg_usb_vbus {
103 compatible = "regulator-fixed";
104 regulator-name = "usb_vbus";
105 regulator-min-microvolt = <5000000>;
106 regulator-max-microvolt = <5000000>;
107 enable-active-high;
108 };
109 };
110
111 &uart {
112 status = "okay";
113 };
114
115 &gpio {
116 status = "okay";
117 };
118
119 &pinmux {
120 pinctrl-names = "default";
121 pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins>;
122 };
123
124 &switch_led_disable_pins {
125 pinctrl-single,bits = <0x0 0x80 0xf8>;
126 };
127
128 &pinmux_extended {
129 pinctrl-names = "default";
130 pinctrl-0 = <&enable_gpio11>;
131 };
132
133 &pinmux_bootstrap {
134 pinctrl-names = "default";
135 pinctrl-0 = <&enable_gpio26_gpio27>;
136 };
137
138 &usb {
139 status = "okay";
140
141 #address-cells = <1>;
142 #size-cells = <0>;
143 dr_mode = "host";
144 vbus-supply = <&reg_usb_vbus>;
145
146 port@1 {
147 #address-cells = <1>;
148 #size-cells = <0>;
149 reg = <1>;
150 #trigger-source-cells = <0>;
151
152 hub_port1: port@1 {
153 reg = <1>;
154 #trigger-source-cells = <0>;
155 };
156 };
157 };
158
159 &usb_phy {
160 status = "okay";
161 };
162
163 &spi {
164 status = "okay";
165
166 num-cs = <1>;
167
168 flash@0 {
169 compatible = "jedec,spi-nor";
170 reg = <0>;
171 spi-max-frequency = <50000000>;
172
173 partitions {
174 compatible = "fixed-partitions";
175 #address-cells = <1>;
176 #size-cells = <1>;
177
178 partition@0 {
179 label = "u-boot";
180 reg = <0x0 0x40000>;
181 read-only;
182 };
183
184 partition@40000 {
185 label = "u-boot-env";
186 reg = <0x40000 0x10000>;
187 };
188
189 partition@50000 {
190 compatible = "denx,uimage";
191 label = "firmware";
192 reg = <0x50000 0xf90000>;
193 };
194
195 partition@fe0000 {
196 label = "nvram";
197 reg = <0xfe0000 0x10000>;
198 };
199
200 art: partition@ff0000 {
201 label = "art";
202 reg = <0xff0000 0x10000>;
203 read-only;
204 };
205 };
206 };
207 };
208
209 &eth0 {
210 status = "okay";
211 };
212
213 &eth1 {
214 status = "okay";
215
216 compatible = "syscon", "simple-mfd";
217 };
218
219 &wmac {
220 status = "okay";
221
222 mtd-cal-data = <&art 0x1000>;
223 };