1c246e9d6SNeil Armstrong/*
2c246e9d6SNeil Armstrong * Copyright (c) 2016 Andreas Färber
3c246e9d6SNeil Armstrong * Copyright (c) 2016 BayLibre, Inc.
4c246e9d6SNeil Armstrong * Author: Neil Armstrong <narmstrong@kernel.org>
5c246e9d6SNeil Armstrong *
6c246e9d6SNeil Armstrong * This file is dual-licensed: you can use it either under the terms
7c246e9d6SNeil Armstrong * of the GPL or the X11 license, at your option. Note that this dual
8c246e9d6SNeil Armstrong * licensing only applies to this file, and not this project as a
9c246e9d6SNeil Armstrong * whole.
10c246e9d6SNeil Armstrong *
11c246e9d6SNeil Armstrong *  a) This library is free software; you can redistribute it and/or
12c246e9d6SNeil Armstrong *     modify it under the terms of the GNU General Public License as
13c246e9d6SNeil Armstrong *     published by the Free Software Foundation; either version 2 of the
14c246e9d6SNeil Armstrong *     License, or (at your option) any later version.
15c246e9d6SNeil Armstrong *
16c246e9d6SNeil Armstrong *     This library is distributed in the hope that it will be useful,
17c246e9d6SNeil Armstrong *     but WITHOUT ANY WARRANTY; without even the implied warranty of
18c246e9d6SNeil Armstrong *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19c246e9d6SNeil Armstrong *     GNU General Public License for more details.
20c246e9d6SNeil Armstrong *
21c246e9d6SNeil Armstrong * Or, alternatively,
22c246e9d6SNeil Armstrong *
23c246e9d6SNeil Armstrong *  b) Permission is hereby granted, free of charge, to any person
24c246e9d6SNeil Armstrong *     obtaining a copy of this software and associated documentation
25c246e9d6SNeil Armstrong *     files (the "Software"), to deal in the Software without
26c246e9d6SNeil Armstrong *     restriction, including without limitation the rights to use,
27c246e9d6SNeil Armstrong *     copy, modify, merge, publish, distribute, sublicense, and/or
28c246e9d6SNeil Armstrong *     sell copies of the Software, and to permit persons to whom the
29c246e9d6SNeil Armstrong *     Software is furnished to do so, subject to the following
30c246e9d6SNeil Armstrong *     conditions:
31c246e9d6SNeil Armstrong *
32c246e9d6SNeil Armstrong *     The above copyright notice and this permission notice shall be
33c246e9d6SNeil Armstrong *     included in all copies or substantial portions of the Software.
34c246e9d6SNeil Armstrong *
35c246e9d6SNeil Armstrong *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36c246e9d6SNeil Armstrong *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37c246e9d6SNeil Armstrong *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38c246e9d6SNeil Armstrong *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39c246e9d6SNeil Armstrong *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40c246e9d6SNeil Armstrong *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41c246e9d6SNeil Armstrong *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42c246e9d6SNeil Armstrong *     OTHER DEALINGS IN THE SOFTWARE.
43c246e9d6SNeil Armstrong */
44c246e9d6SNeil Armstrong
45c246e9d6SNeil Armstrong/dts-v1/;
46c246e9d6SNeil Armstrong
47c246e9d6SNeil Armstrong#include "meson-gxbb.dtsi"
48c246e9d6SNeil Armstrong#include <dt-bindings/gpio/gpio.h>
49c246e9d6SNeil Armstrong#include <dt-bindings/input/input.h>
50c246e9d6SNeil Armstrong
51c246e9d6SNeil Armstrong/ {
52c246e9d6SNeil Armstrong	compatible = "nexbox,a95x", "amlogic,meson-gxbb";
53c246e9d6SNeil Armstrong	model = "NEXBOX A95X";
54c246e9d6SNeil Armstrong
55c246e9d6SNeil Armstrong	aliases {
56c246e9d6SNeil Armstrong		serial0 = &uart_AO;
57059a58fcSJorge Ramirez-Ortiz		ethernet0 = &ethmac;
58c246e9d6SNeil Armstrong	};
59c246e9d6SNeil Armstrong
60c246e9d6SNeil Armstrong	chosen {
61c246e9d6SNeil Armstrong		stdout-path = "serial0:115200n8";
62c246e9d6SNeil Armstrong	};
63c246e9d6SNeil Armstrong
64c246e9d6SNeil Armstrong	memory@0 {
65c246e9d6SNeil Armstrong		device_type = "memory";
66c246e9d6SNeil Armstrong		reg = <0x0 0x0 0x0 0x40000000>;
67c246e9d6SNeil Armstrong	};
68c246e9d6SNeil Armstrong
69c246e9d6SNeil Armstrong	leds {
70c246e9d6SNeil Armstrong		compatible = "gpio-leds";
71c246e9d6SNeil Armstrong		blue {
72c246e9d6SNeil Armstrong			label = "a95x:system-status";
73c246e9d6SNeil Armstrong			gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
74c246e9d6SNeil Armstrong			linux,default-trigger = "heartbeat";
75c246e9d6SNeil Armstrong			default-state = "off";
76c246e9d6SNeil Armstrong		};
77c246e9d6SNeil Armstrong	};
78c246e9d6SNeil Armstrong
79c246e9d6SNeil Armstrong	gpio-keys-polled {
80c246e9d6SNeil Armstrong		compatible = "gpio-keys-polled";
81c246e9d6SNeil Armstrong		#address-cells = <1>;
82c246e9d6SNeil Armstrong		#size-cells = <0>;
83c246e9d6SNeil Armstrong		poll-interval = <100>;
84c246e9d6SNeil Armstrong
85c246e9d6SNeil Armstrong		button@0 {
86c246e9d6SNeil Armstrong			label = "reset";
87c246e9d6SNeil Armstrong			linux,code = <KEY_RESTART>;
88c246e9d6SNeil Armstrong			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
89c246e9d6SNeil Armstrong		};
90c246e9d6SNeil Armstrong	};
91a776e045SNeil Armstrong
92e2f4d749SPeter Korsgaard	usb_pwr: regulator-usb-pwrs {
93e2f4d749SPeter Korsgaard		compatible = "regulator-fixed";
94e2f4d749SPeter Korsgaard
95e2f4d749SPeter Korsgaard		regulator-name = "USB_PWR";
96e2f4d749SPeter Korsgaard
97e2f4d749SPeter Korsgaard		regulator-min-microvolt = <5000000>;
98e2f4d749SPeter Korsgaard		regulator-max-microvolt = <5000000>;
99e2f4d749SPeter Korsgaard
100e2f4d749SPeter Korsgaard		gpio = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
101e2f4d749SPeter Korsgaard		enable-active-high;
102e2f4d749SPeter Korsgaard	};
103e2f4d749SPeter Korsgaard
104a776e045SNeil Armstrong	vddio_card: gpio-regulator {
105a776e045SNeil Armstrong		compatible = "regulator-gpio";
106a776e045SNeil Armstrong
107a776e045SNeil Armstrong		regulator-name = "VDDIO_CARD";
108a776e045SNeil Armstrong		regulator-min-microvolt = <1800000>;
109a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
110a776e045SNeil Armstrong
111a776e045SNeil Armstrong		gpios = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
112a776e045SNeil Armstrong		gpios-states = <1>;
113a776e045SNeil Armstrong
114a776e045SNeil Armstrong		/* Based on P200 schematics, signal CARD_1.8V/3.3V_CTR */
115a776e045SNeil Armstrong		states = <1800000 0
116a776e045SNeil Armstrong			  3300000 1>;
117a776e045SNeil Armstrong	};
118a776e045SNeil Armstrong
119a776e045SNeil Armstrong	vddio_boot: regulator-vddio_boot {
120a776e045SNeil Armstrong		compatible = "regulator-fixed";
121a776e045SNeil Armstrong		regulator-name = "VDDIO_BOOT";
122a776e045SNeil Armstrong		regulator-min-microvolt = <1800000>;
123a776e045SNeil Armstrong		regulator-max-microvolt = <1800000>;
124a776e045SNeil Armstrong	};
125a776e045SNeil Armstrong
126a776e045SNeil Armstrong	vddao_3v3: regulator-vddao_3v3 {
127a776e045SNeil Armstrong		compatible = "regulator-fixed";
128a776e045SNeil Armstrong		regulator-name = "VDDAO_3V3";
129a776e045SNeil Armstrong		regulator-min-microvolt = <3300000>;
130a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
131a776e045SNeil Armstrong	};
132a776e045SNeil Armstrong
133a776e045SNeil Armstrong	vcc_3v3: regulator-vcc_3v3 {
134a776e045SNeil Armstrong		compatible = "regulator-fixed";
135a776e045SNeil Armstrong		regulator-name = "VCC_3V3";
136a776e045SNeil Armstrong		regulator-min-microvolt = <3300000>;
137a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
138a776e045SNeil Armstrong	};
139a776e045SNeil Armstrong
140a776e045SNeil Armstrong	emmc_pwrseq: emmc-pwrseq {
141a776e045SNeil Armstrong		compatible = "mmc-pwrseq-emmc";
142a776e045SNeil Armstrong		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
143a776e045SNeil Armstrong	};
144a776e045SNeil Armstrong
145a776e045SNeil Armstrong	wifi32k: wifi32k {
146a776e045SNeil Armstrong		compatible = "pwm-clock";
147a776e045SNeil Armstrong		#clock-cells = <0>;
148a776e045SNeil Armstrong		clock-frequency = <32768>;
149a776e045SNeil Armstrong		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
150a776e045SNeil Armstrong	};
151a776e045SNeil Armstrong
152a776e045SNeil Armstrong	sdio_pwrseq: sdio-pwrseq {
153a776e045SNeil Armstrong		compatible = "mmc-pwrseq-simple";
154a776e045SNeil Armstrong		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
155a776e045SNeil Armstrong		clocks = <&wifi32k>;
156a776e045SNeil Armstrong		clock-names = "ext_clock";
157a776e045SNeil Armstrong	};
158fafdbdf7SNeil Armstrong
159fafdbdf7SNeil Armstrong	cvbs-connector {
160fafdbdf7SNeil Armstrong		compatible = "composite-video-connector";
161fafdbdf7SNeil Armstrong
162fafdbdf7SNeil Armstrong		port {
163fafdbdf7SNeil Armstrong			cvbs_connector_in: endpoint {
164fafdbdf7SNeil Armstrong				remote-endpoint = <&cvbs_vdac_out>;
165fafdbdf7SNeil Armstrong			};
166fafdbdf7SNeil Armstrong		};
167fafdbdf7SNeil Armstrong	};
1686939db7eSNeil Armstrong
1696939db7eSNeil Armstrong	hdmi-connector {
1706939db7eSNeil Armstrong		compatible = "hdmi-connector";
1716939db7eSNeil Armstrong		type = "a";
1726939db7eSNeil Armstrong
1736939db7eSNeil Armstrong		port {
1746939db7eSNeil Armstrong			hdmi_connector_in: endpoint {
1756939db7eSNeil Armstrong				remote-endpoint = <&hdmi_tx_tmds_out>;
1766939db7eSNeil Armstrong			};
1776939db7eSNeil Armstrong		};
1786939db7eSNeil Armstrong	};
179c246e9d6SNeil Armstrong};
180c246e9d6SNeil Armstrong
18182f11345SAndreas Färber&cvbs_vdac_port {
18282f11345SAndreas Färber	cvbs_vdac_out: endpoint {
18382f11345SAndreas Färber		remote-endpoint = <&cvbs_connector_in>;
18482f11345SAndreas Färber	};
185c246e9d6SNeil Armstrong};
186c246e9d6SNeil Armstrong
187b16c71c9SNeil Armstrong&cec_AO {
188b16c71c9SNeil Armstrong	status = "okay";
189b16c71c9SNeil Armstrong	pinctrl-0 = <&ao_cec_pins>;
190b16c71c9SNeil Armstrong	pinctrl-names = "default";
191b16c71c9SNeil Armstrong	hdmi-phandle = <&hdmi_tx>;
192b16c71c9SNeil Armstrong};
193b16c71c9SNeil Armstrong
194c246e9d6SNeil Armstrong&ethmac {
195c246e9d6SNeil Armstrong	status = "okay";
1963be2d9cfSNeil Armstrong	pinctrl-0 = <&eth_rmii_pins>;
197c246e9d6SNeil Armstrong	pinctrl-names = "default";
19867d49f30SMartin Blumenstingl
19967d49f30SMartin Blumenstingl	phy-handle = <&eth_phy0>;
2003be2d9cfSNeil Armstrong	phy-mode = "rmii";
20167d49f30SMartin Blumenstingl
20267d49f30SMartin Blumenstingl	snps,reset-gpio = <&gpio GPIOZ_14 0>;
20367d49f30SMartin Blumenstingl	snps,reset-delays-us = <0 10000 1000000>;
20467d49f30SMartin Blumenstingl	snps,reset-active-low;
20567d49f30SMartin Blumenstingl
20667d49f30SMartin Blumenstingl	mdio {
20767d49f30SMartin Blumenstingl		compatible = "snps,dwmac-mdio";
20867d49f30SMartin Blumenstingl		#address-cells = <1>;
20967d49f30SMartin Blumenstingl		#size-cells = <0>;
21067d49f30SMartin Blumenstingl
21167d49f30SMartin Blumenstingl		eth_phy0: ethernet-phy@0 {
21267d49f30SMartin Blumenstingl			/* IC Plus IP101GR (0x02430c54) */
21367d49f30SMartin Blumenstingl			reg = <0>;
21467d49f30SMartin Blumenstingl		};
21567d49f30SMartin Blumenstingl	};
216c246e9d6SNeil Armstrong};
217c246e9d6SNeil Armstrong
21882f11345SAndreas Färber&hdmi_tx {
21982f11345SAndreas Färber	status = "okay";
22082f11345SAndreas Färber	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
22182f11345SAndreas Färber	pinctrl-names = "default";
22282f11345SAndreas Färber};
22382f11345SAndreas Färber
22482f11345SAndreas Färber&hdmi_tx_tmds_port {
22582f11345SAndreas Färber	hdmi_tx_tmds_out: endpoint {
22682f11345SAndreas Färber		remote-endpoint = <&hdmi_connector_in>;
22782f11345SAndreas Färber	};
22882f11345SAndreas Färber};
22982f11345SAndreas Färber
230c246e9d6SNeil Armstrong&ir {
231c246e9d6SNeil Armstrong	status = "okay";
232c246e9d6SNeil Armstrong	pinctrl-0 = <&remote_input_ao_pins>;
233c246e9d6SNeil Armstrong	pinctrl-names = "default";
234c246e9d6SNeil Armstrong};
235a776e045SNeil Armstrong
23682f11345SAndreas Färber&pwm_ef {
23782f11345SAndreas Färber	status = "okay";
23882f11345SAndreas Färber	pinctrl-0 = <&pwm_e_pins>;
23982f11345SAndreas Färber	pinctrl-names = "default";
24082f11345SAndreas Färber	clocks = <&clkc CLKID_FCLK_DIV4>;
24182f11345SAndreas Färber	clock-names = "clkin0";
24282f11345SAndreas Färber};
24382f11345SAndreas Färber
244a776e045SNeil Armstrong/* Wireless SDIO Module */
245a776e045SNeil Armstrong&sd_emmc_a {
246a776e045SNeil Armstrong	status = "okay";
247a776e045SNeil Armstrong	pinctrl-0 = <&sdio_pins>;
24867e7607fSJerome Brunet	pinctrl-1 = <&sdio_clk_gate_pins>;
24967e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
250a776e045SNeil Armstrong	#address-cells = <1>;
251a776e045SNeil Armstrong	#size-cells = <0>;
252a776e045SNeil Armstrong
253a776e045SNeil Armstrong	bus-width = <4>;
254a776e045SNeil Armstrong	cap-sd-highspeed;
255a776e045SNeil Armstrong	max-frequency = <100000000>;
256a776e045SNeil Armstrong
257a776e045SNeil Armstrong	non-removable;
258a776e045SNeil Armstrong	disable-wp;
259a776e045SNeil Armstrong
260a776e045SNeil Armstrong	mmc-pwrseq = <&sdio_pwrseq>;
261a776e045SNeil Armstrong
262a776e045SNeil Armstrong	vmmc-supply = <&vddao_3v3>;
263a776e045SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
264a776e045SNeil Armstrong};
265a776e045SNeil Armstrong
266a776e045SNeil Armstrong/* SD card */
267a776e045SNeil Armstrong&sd_emmc_b {
268a776e045SNeil Armstrong	status = "okay";
269a776e045SNeil Armstrong	pinctrl-0 = <&sdcard_pins>;
27067e7607fSJerome Brunet	pinctrl-1 = <&sdcard_clk_gate_pins>;
27167e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
272a776e045SNeil Armstrong
273a776e045SNeil Armstrong	bus-width = <4>;
274a776e045SNeil Armstrong	cap-sd-highspeed;
275a776e045SNeil Armstrong	max-frequency = <100000000>;
276a776e045SNeil Armstrong	disable-wp;
277a776e045SNeil Armstrong
278a776e045SNeil Armstrong	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
279a776e045SNeil Armstrong	cd-inverted;
280a776e045SNeil Armstrong
281a776e045SNeil Armstrong	vmmc-supply = <&vddao_3v3>;
282a776e045SNeil Armstrong	vqmmc-supply = <&vddio_card>;
283a776e045SNeil Armstrong};
284a776e045SNeil Armstrong
285a776e045SNeil Armstrong/* eMMC */
286a776e045SNeil Armstrong&sd_emmc_c {
287a776e045SNeil Armstrong	status = "okay";
288ab36be66SNeil Armstrong	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
28967e7607fSJerome Brunet	pinctrl-1 = <&emmc_clk_gate_pins>;
29067e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
291a776e045SNeil Armstrong
292a776e045SNeil Armstrong	bus-width = <8>;
293a776e045SNeil Armstrong	cap-mmc-highspeed;
294a776e045SNeil Armstrong	max-frequency = <200000000>;
295a776e045SNeil Armstrong	non-removable;
296a776e045SNeil Armstrong	disable-wp;
297a776e045SNeil Armstrong	mmc-ddr-1_8v;
298a776e045SNeil Armstrong	mmc-hs200-1_8v;
299a776e045SNeil Armstrong
300a776e045SNeil Armstrong	mmc-pwrseq = <&emmc_pwrseq>;
301a776e045SNeil Armstrong	vmmc-supply = <&vcc_3v3>;
302a776e045SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
303a776e045SNeil Armstrong};
304a776e045SNeil Armstrong
30582f11345SAndreas Färber&uart_AO {
306a776e045SNeil Armstrong	status = "okay";
30782f11345SAndreas Färber	pinctrl-0 = <&uart_ao_a_pins>;
308a776e045SNeil Armstrong	pinctrl-names = "default";
3096939db7eSNeil Armstrong};
310e2f4d749SPeter Korsgaard
311e2f4d749SPeter Korsgaard&usb0_phy {
312e2f4d749SPeter Korsgaard	status = "okay";
313e2f4d749SPeter Korsgaard	phy-supply = <&usb_pwr>;
314e2f4d749SPeter Korsgaard};
315e2f4d749SPeter Korsgaard
316e2f4d749SPeter Korsgaard&usb1_phy {
317e2f4d749SPeter Korsgaard	status = "okay";
318e2f4d749SPeter Korsgaard};
319e2f4d749SPeter Korsgaard
320e2f4d749SPeter Korsgaard&usb0 {
321e2f4d749SPeter Korsgaard	status = "okay";
322e2f4d749SPeter Korsgaard};
323e2f4d749SPeter Korsgaard
324e2f4d749SPeter Korsgaard&usb1 {
325e2f4d749SPeter Korsgaard	status = "okay";
326e2f4d749SPeter Korsgaard};
327