1280906Sganbold/*-
2280906Sganbold * Copyright (c) 2013-2015 John Wehle <john@feith.com>
3280906Sganbold * All rights reserved.
4280906Sganbold *
5280906Sganbold * Redistribution and use in source and binary forms, with or without
6280906Sganbold * modification, are permitted provided that the following conditions
7280906Sganbold * are met:
8280906Sganbold * 1. Redistributions of source code must retain the above copyright
9280906Sganbold *    notice, this list of conditions and the following disclaimer.
10280906Sganbold * 2. Redistributions in binary form must reproduce the above copyright
11280906Sganbold *    notice, this list of conditions and the following disclaimer in the
12280906Sganbold *    documentation and/or other materials provided with the distribution.
13280906Sganbold *
14280906Sganbold * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15280906Sganbold * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16280906Sganbold * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17280906Sganbold * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18280906Sganbold * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19280906Sganbold * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20280906Sganbold * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21280906Sganbold * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22280906Sganbold * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23280906Sganbold * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24280906Sganbold * SUCH DAMAGE.
25280906Sganbold *
26280906Sganbold * $FreeBSD: releng/11.0/sys/boot/fdt/dts/arm/vsatv102-m6.dts 283352 2015-05-24 07:09:16Z ganbold $
27280906Sganbold */
28280906Sganbold
29280906Sganbold/*
30280906Sganbold * The ordering of certain devices is significant (e.g. usb depends on
31280906Sganbold * usb-phy which depends on gpio, also the timer should appear early on
32280906Sganbold * to provide a reasonably accurate DELAY implementation).
33280906Sganbold *
34280906Sganbold * Both usb-phys devices must be configured to prevent the usb controller
35280906Sganbold * from hanging during initialization.
36280906Sganbold */
37280906Sganbold
38280906Sganbold/dts-v1/;
39280906Sganbold
40280906Sganbold/memreserve/ 0x84900000 0x00600000;			/* 6MB frame buffer */
41280906Sganbold
42281415Sganbold#include "meson6.dtsi"
43281415Sganbold
44280906Sganbold/ {
45280906Sganbold	/*
46280906Sganbold	 * My development unit visually appears to be a Visson ATV-102
47280906Sganbold	 * and the specs for both my unit and the Visson ATV-102 say
48280906Sganbold	 * the SoC is an aml8726-m3.  However the uboot prompt says
49280906Sganbold	 * m6_mbx_v1, the RTC is located on SECBUS2 instead of AOBUS,
50280906Sganbold	 * and there are two cores so it seems my unit is a newer
51280906Sganbold	 * version using the later processor.
52280906Sganbold	 */
53280906Sganbold
54280906Sganbold	model = "visson,atv-102";
55281415Sganbold	compatible = "visson,atv-102", "amlogic,meson6";
56280906Sganbold
57280906Sganbold	#address-cells = <1>;
58280906Sganbold	#size-cells = <1>;
59280906Sganbold
60280906Sganbold	aliases {
61280906Sganbold		soc = &soc;
62280906Sganbold		screen = &screen;
63281415Sganbold		uart0 = &uart_AO;
64280906Sganbold	};
65280906Sganbold
66280906Sganbold	memory {
67280906Sganbold		device_type = "memory";
68280906Sganbold		reg = <0x80000000 0x40000000>;		/* 1GB RAM */
69280906Sganbold	};
70280906Sganbold
71281415Sganbold	soc: soc {
72280906Sganbold		device_type = "soc";
73280906Sganbold		bus-frequency = <0>;
74280906Sganbold
75281415Sganbold		pic: pic@c1109a40 {
76280906Sganbold			device_type = "interrupt-controller";
77280906Sganbold			compatible = "amlogic,aml8726-pic";
78281415Sganbold			reg = <0xc1109a40 128>;	/* cbus 0x2690 */
79280906Sganbold
80280906Sganbold			interrupt-controller;
81281415Sganbold			#interrupt-cells = <3>;
82280906Sganbold		};
83280906Sganbold
84281415Sganbold		scu: scu@c4300000 {
85280906Sganbold			compatible = "arm,cortex-a9-scu";
86281415Sganbold			reg = <0xc4300000 0x1000>;
87280906Sganbold		};
88280906Sganbold
89281415Sganbold		cpuconfig: cpuconfig@d901ff80 {
90280906Sganbold			compatible = "amlogic,aml8726-cpuconfig";
91281415Sganbold			reg = <0xd901ff80 8>;
92280906Sganbold		};
93280906Sganbold
94281415Sganbold		ccm@c1104140 {
95280906Sganbold			compatible = "amlogic,aml8726-ccm";
96281415Sganbold			reg = <0xc1104140 20>;	/* cbus 0x1050 */
97280906Sganbold
98280906Sganbold			functions = "ethernet", "i2c", "rng", "sdio",
99280906Sganbold				    "uart-a", "uart-b", "uart-c",
100280906Sganbold				    "usb-a", "usb-b";
101280906Sganbold		};
102280906Sganbold
103281415Sganbold		pinctrl: pinctrl@c11080b0 {
104280906Sganbold			compatible = "amlogic,aml8726-pinctrl";
105281415Sganbold			reg = <0xc11080b0 40>,	/* mux */
106281415Sganbold			      <0xc11080e8 24>,	/* pu/pd */
107281415Sganbold			      <0xc11080e8 24>,	/* pull enable */
108281415Sganbold			      <0xc8100014 4>,	/* ao mux */
109281415Sganbold			      <0xc810002c 4>,	/* ao pu/pd */
110281415Sganbold			      <0xc810002c 4>;	/* ao pull enable */
111280906Sganbold
112280906Sganbold			/*
113280906Sganbold			 * Currently only pin muxing that deviates
114280906Sganbold			 * from the power on default of gpio is
115280906Sganbold			 * specified here.
116280906Sganbold			 */
117280906Sganbold
118280906Sganbold			pinctrl-names = "default";
119280906Sganbold			pinctrl-0 = <&pins_uartao &pins_ethernet &pins_hdmi>;
120280906Sganbold
121280906Sganbold			pins_ethernet: ethernet {
122280906Sganbold				amlogic,pins = "ref_clk_in",
123280906Sganbold					       "tx_clk", "tx_en",
124280906Sganbold					       "tx_d0",  "tx_d1",
125280906Sganbold					       "tx_d2",  "tx_d3",
126280906Sganbold					       "rx_clk", "rx_dv",
127280906Sganbold					       "rx_d0",  "rx_d1",
128280906Sganbold					       "rx_d2",  "rx_d3",
129280906Sganbold					       "mdc",    "mdio";
130280906Sganbold				amlogic,function = "ethernet";
131280906Sganbold			};
132280906Sganbold
133280906Sganbold			pins_hdmi: hdmi {
134280906Sganbold				amlogic,pins = "cec", "hpd",
135280906Sganbold					       "scl", "sda";
136280906Sganbold				amlogic,function = "hdmi";
137280906Sganbold			};
138280906Sganbold
139280906Sganbold			pins_sdio_b: sdio_b {
140280906Sganbold				amlogic,pins = "clk", "cmd",
141280906Sganbold					       "d0",  "d1",
142280906Sganbold					       "d2",  "d3";
143280906Sganbold				amlogic,function = "sdio-b";
144280906Sganbold			};
145280906Sganbold
146280906Sganbold			pins_uartao: uartao {
147280906Sganbold				amlogic,pins = "tx", "rx";
148280906Sganbold				amlogic,function = "uart-ao";
149280906Sganbold			};
150280906Sganbold		};
151280906Sganbold
152281415Sganbold		rtc@da004340 {
153280906Sganbold			compatible = "amlogic,aml8726-rtc";
154281415Sganbold			reg = <0xda004340 20>;	/* secbus2 0xd0 */
155281415Sganbold			interrupts = <0 72 1>;	/* AM_IRQ2(8) */
156280906Sganbold		};
157280906Sganbold
158281415Sganbold		clkmsr: clkmsr@c1108758 {
159280906Sganbold			compatible = "amlogic,aml8726-clkmsr";
160281415Sganbold			reg = <0xc1108758 16>;	/* cbus 0x21d6 */
161280906Sganbold
162281415Sganbold			clocks = <&clk81>;
163280906Sganbold		};
164280906Sganbold
165281415Sganbold		gpioao: gpio@c8100024 {
166280906Sganbold			/* gpio unit 7 */
167280906Sganbold			compatible = "amlogic,aml8726-gpio";
168281415Sganbold			reg = <0xc8100024 4>,	/* oen aobus 0x9 */
169281415Sganbold			      <0xc8100024 4>,	/* out */
170281415Sganbold			      <0xc8100028 4>;	/* in */
171280906Sganbold
172280906Sganbold			gpio-controller;
173280906Sganbold			#gpio-cells = <1>;
174280906Sganbold			pin-count = <12>;
175280906Sganbold		};
176280906Sganbold
177281415Sganbold		gpio5: gpio@c110806c {
178280906Sganbold			compatible = "amlogic,aml8726-gpio";
179281415Sganbold			reg = <0xc110806c 4>,	/* oen cbus 0x201b */
180281415Sganbold			      <0xc1108070 4>,	/* out */
181281415Sganbold			      <0xc1108074 4>;	/* in */
182280906Sganbold
183280906Sganbold			gpio-controller;
184280906Sganbold			#gpio-cells = <1>;
185280906Sganbold			pin-count = <32>;
186280906Sganbold		};
187280906Sganbold
188281415Sganbold		gpio6: gpio@c1108020 {
189280906Sganbold			compatible = "amlogic,aml8726-gpio";
190281415Sganbold			reg = <0xc1108020 4>,	/* oen cbus 0x2008 */
191281415Sganbold			      <0xc1108024 4>,	/* out */
192281415Sganbold			      <0xc1108028 4>;	/* in */
193280906Sganbold
194280906Sganbold			gpio-controller;
195280906Sganbold			#gpio-cells = <1>;
196280906Sganbold			pin-count = <29>;
197280906Sganbold		};
198280906Sganbold
199281415Sganbold		mmc@c1108c20 {
200280906Sganbold			compatible = "amlogic,aml8726-mmc";
201281415Sganbold			reg = <0xc1108c20 32>;	/* cbus 0x2308 */
202281415Sganbold			interrupts = <0 28 1>;	/* AM_IRQ0(28) */
203280906Sganbold
204281415Sganbold			clocks = <&clk81>;
205281415Sganbold
206280906Sganbold			pinctrl-names = "default";
207280906Sganbold			pinctrl-0 = <&pins_sdio_b>;
208280906Sganbold
209280906Sganbold			mmc-voltages = "3.3";
210280906Sganbold
211280906Sganbold			mmc-pwr-en = <&gpio5 31 0>;	/* card_8 */
212280906Sganbold			ins-detect = <&gpio5 29 0>;	/* card_6 */
213280906Sganbold		};
214280906Sganbold
215281415Sganbold		rng@c1108100 {
216280906Sganbold			compatible = "amlogic,aml8726-rng";
217281415Sganbold			reg = <0xc1108100 8>;	/* cbus 0x2040 */
218280906Sganbold		};
219280906Sganbold
220281415Sganbold		usb-phy@c1108400 {
221280906Sganbold			/* usb-a phy */
222280906Sganbold			compatible = "amlogic,aml8726-m6-usb-phy";
223281415Sganbold			reg = <0xc1108400 32>;	/* cbus 0x2100 */
224280906Sganbold		};
225280906Sganbold
226281415Sganbold		usb-phy@c1108420 {
227280906Sganbold			/* usb-b phy */
228280906Sganbold			compatible = "amlogic,aml8726-m6-usb-phy";
229281415Sganbold			reg = <0xc1108420 32>;	/* cbus 0x2108 */
230280906Sganbold
231280906Sganbold			usb-pwr-en = <&gpioao 3 1>,	/* gpioao_3 vbus */
232280906Sganbold				     <&gpio6 11 0>;	/* gpioe_11 wifi */
233280906Sganbold		};
234280906Sganbold
235281415Sganbold		usb@c9040000 {
236280906Sganbold			/* usb-a */
237280906Sganbold			compatible = "synopsys,designware-hs-otg2";
238281415Sganbold			reg = <0xc9040000 0x40000>;	/* ahbbus 0x40000*/
239281415Sganbold			interrupts = <0 30 4>;		/* AM_IRQ0(30) */
240280906Sganbold			#address-cells = <1>;
241280906Sganbold			#size-cells = <0>;
242280906Sganbold		};
243280906Sganbold
244281415Sganbold		usb@c90c0000 {
245280906Sganbold			/* usb-b */
246280906Sganbold			compatible = "synopsys,designware-hs-otg2";
247281415Sganbold			reg = <0xc90c0000 0x40000>;	/* ahbbus 0xc0000 */
248281415Sganbold			interrupts = <0 31 4>;		/* AM_IRQ0(31) */
249280906Sganbold			#address-cells = <1>;
250280906Sganbold			#size-cells = <0>;
251280906Sganbold
252280906Sganbold			dr_mode = "host";
253280906Sganbold		};
254280906Sganbold
255281415Sganbold		eth@c9410000 {
256280906Sganbold			/* ethernet */
257280906Sganbold			compatible = "snps,dwmac";
258281415Sganbold			reg = <0xc9410000 0x2000>;	/* ahbbus 0x410000 */
259281415Sganbold			interrupts = <0 8 1>;		/* AM_IRQ0(8) */
260280906Sganbold			#address-cells = <1>;
261280906Sganbold			#size-cells = <0>;
262280906Sganbold
263280906Sganbold			eth-phy-rst = <&gpio5 15 0>;	/* gpioy_15 phy-rst */
264280906Sganbold		};
265280906Sganbold
266281415Sganbold		screen: fb@c8006324 {
267280906Sganbold			device_type = "display";
268280906Sganbold			compatible = "amlogic,aml8726-fb";
269281415Sganbold			reg = <0xc8006324 12>,		/* CANVAS */
270281415Sganbold			      <0xc1106800 1024>,	/* VIU */
271281415Sganbold			      <0xc1107400 1024>;	/* VPP */
272281415Sganbold			interrupts = <0 2 1>,		/* AM_IRQ0(2) */
273281415Sganbold				     <0 3 1>,		/* AM_IRQ0(3) */
274281415Sganbold				     <0 12 1>,		/* AM_IRQ0(12) */
275281415Sganbold				     <0 13 1>;		/* AM_IRQ0(13) */
276280906Sganbold
277280906Sganbold			address = <0x84900000>;	/* match memreserve */
278280906Sganbold			width = <720>;
279280906Sganbold			height = <480>;
280280906Sganbold			depth = <24>;
281280906Sganbold			linebytes = <2160>;
282280906Sganbold		};
283280906Sganbold	};
284280906Sganbold
285283352Sganbold	leds {
286283352Sganbold		compatible = "gpio-leds";
287283352Sganbold
288283352Sganbold		sys_led {
289283352Sganbold			gpios = <&gpioao 2>;	/* gpioao_2 sys_led */
290283352Sganbold			label = "sys_led";
291283352Sganbold
292283352Sganbold			default-state = "on";
293283352Sganbold		};
294283352Sganbold	};
295283352Sganbold
296280906Sganbold	chosen {
297280906Sganbold		stdin = "uart0";
298280906Sganbold		stdout = "uart0";
299280906Sganbold	};
300280906Sganbold};
301281415Sganbold
302281415Sganbold&clk81 {
303281415Sganbold	clock-frequency = <0>;
304281415Sganbold};
305281415Sganbold
306281415Sganbold&uart_AO {
307281415Sganbold	status = "okay";
308281415Sganbold	current-speed = <115200>;
309281415Sganbold};
310