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;
57c246e9d6SNeil Armstrong	};
58c246e9d6SNeil Armstrong
59c246e9d6SNeil Armstrong	chosen {
60c246e9d6SNeil Armstrong		stdout-path = "serial0:115200n8";
61c246e9d6SNeil Armstrong	};
62c246e9d6SNeil Armstrong
63c246e9d6SNeil Armstrong	memory@0 {
64c246e9d6SNeil Armstrong		device_type = "memory";
65c246e9d6SNeil Armstrong		reg = <0x0 0x0 0x0 0x40000000>;
66c246e9d6SNeil Armstrong	};
67c246e9d6SNeil Armstrong
68c246e9d6SNeil Armstrong	leds {
69c246e9d6SNeil Armstrong		compatible = "gpio-leds";
70c246e9d6SNeil Armstrong		blue {
71c246e9d6SNeil Armstrong			label = "a95x:system-status";
72c246e9d6SNeil Armstrong			gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
73c246e9d6SNeil Armstrong			linux,default-trigger = "heartbeat";
74c246e9d6SNeil Armstrong			default-state = "off";
75c246e9d6SNeil Armstrong		};
76c246e9d6SNeil Armstrong	};
77c246e9d6SNeil Armstrong
78c246e9d6SNeil Armstrong	gpio-keys-polled {
79c246e9d6SNeil Armstrong		compatible = "gpio-keys-polled";
80c246e9d6SNeil Armstrong		#address-cells = <1>;
81c246e9d6SNeil Armstrong		#size-cells = <0>;
82c246e9d6SNeil Armstrong		poll-interval = <100>;
83c246e9d6SNeil Armstrong
84c246e9d6SNeil Armstrong		button@0 {
85c246e9d6SNeil Armstrong			label = "reset";
86c246e9d6SNeil Armstrong			linux,code = <KEY_RESTART>;
87c246e9d6SNeil Armstrong			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
88c246e9d6SNeil Armstrong		};
89c246e9d6SNeil Armstrong	};
90a776e045SNeil Armstrong
91e2f4d749SPeter Korsgaard	usb_pwr: regulator-usb-pwrs {
92e2f4d749SPeter Korsgaard		compatible = "regulator-fixed";
93e2f4d749SPeter Korsgaard
94e2f4d749SPeter Korsgaard		regulator-name = "USB_PWR";
95e2f4d749SPeter Korsgaard
96e2f4d749SPeter Korsgaard		regulator-min-microvolt = <5000000>;
97e2f4d749SPeter Korsgaard		regulator-max-microvolt = <5000000>;
98e2f4d749SPeter Korsgaard
99e2f4d749SPeter Korsgaard		gpio = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
100e2f4d749SPeter Korsgaard		enable-active-high;
101e2f4d749SPeter Korsgaard	};
102e2f4d749SPeter Korsgaard
103a776e045SNeil Armstrong	vddio_card: gpio-regulator {
104a776e045SNeil Armstrong		compatible = "regulator-gpio";
105a776e045SNeil Armstrong
106a776e045SNeil Armstrong		regulator-name = "VDDIO_CARD";
107a776e045SNeil Armstrong		regulator-min-microvolt = <1800000>;
108a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
109a776e045SNeil Armstrong
110a776e045SNeil Armstrong		gpios = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
111a776e045SNeil Armstrong		gpios-states = <1>;
112a776e045SNeil Armstrong
113a776e045SNeil Armstrong		/* Based on P200 schematics, signal CARD_1.8V/3.3V_CTR */
114a776e045SNeil Armstrong		states = <1800000 0
115a776e045SNeil Armstrong			  3300000 1>;
116a776e045SNeil Armstrong	};
117a776e045SNeil Armstrong
118a776e045SNeil Armstrong	vddio_boot: regulator-vddio_boot {
119a776e045SNeil Armstrong		compatible = "regulator-fixed";
120a776e045SNeil Armstrong		regulator-name = "VDDIO_BOOT";
121a776e045SNeil Armstrong		regulator-min-microvolt = <1800000>;
122a776e045SNeil Armstrong		regulator-max-microvolt = <1800000>;
123a776e045SNeil Armstrong	};
124a776e045SNeil Armstrong
125a776e045SNeil Armstrong	vddao_3v3: regulator-vddao_3v3 {
126a776e045SNeil Armstrong		compatible = "regulator-fixed";
127a776e045SNeil Armstrong		regulator-name = "VDDAO_3V3";
128a776e045SNeil Armstrong		regulator-min-microvolt = <3300000>;
129a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
130a776e045SNeil Armstrong	};
131a776e045SNeil Armstrong
132a776e045SNeil Armstrong	vcc_3v3: regulator-vcc_3v3 {
133a776e045SNeil Armstrong		compatible = "regulator-fixed";
134a776e045SNeil Armstrong		regulator-name = "VCC_3V3";
135a776e045SNeil Armstrong		regulator-min-microvolt = <3300000>;
136a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
137a776e045SNeil Armstrong	};
138a776e045SNeil Armstrong
139a776e045SNeil Armstrong	emmc_pwrseq: emmc-pwrseq {
140a776e045SNeil Armstrong		compatible = "mmc-pwrseq-emmc";
141a776e045SNeil Armstrong		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
142a776e045SNeil Armstrong	};
143a776e045SNeil Armstrong
144a776e045SNeil Armstrong	wifi32k: wifi32k {
145a776e045SNeil Armstrong		compatible = "pwm-clock";
146a776e045SNeil Armstrong		#clock-cells = <0>;
147a776e045SNeil Armstrong		clock-frequency = <32768>;
148a776e045SNeil Armstrong		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
149a776e045SNeil Armstrong	};
150a776e045SNeil Armstrong
151a776e045SNeil Armstrong	sdio_pwrseq: sdio-pwrseq {
152a776e045SNeil Armstrong		compatible = "mmc-pwrseq-simple";
153a776e045SNeil Armstrong		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
154a776e045SNeil Armstrong		clocks = <&wifi32k>;
155a776e045SNeil Armstrong		clock-names = "ext_clock";
156a776e045SNeil Armstrong	};
157fafdbdf7SNeil Armstrong
158fafdbdf7SNeil Armstrong	cvbs-connector {
159fafdbdf7SNeil Armstrong		compatible = "composite-video-connector";
160fafdbdf7SNeil Armstrong
161fafdbdf7SNeil Armstrong		port {
162fafdbdf7SNeil Armstrong			cvbs_connector_in: endpoint {
163fafdbdf7SNeil Armstrong				remote-endpoint = <&cvbs_vdac_out>;
164fafdbdf7SNeil Armstrong			};
165fafdbdf7SNeil Armstrong		};
166fafdbdf7SNeil Armstrong	};
1676939db7eSNeil Armstrong
1686939db7eSNeil Armstrong	hdmi-connector {
1696939db7eSNeil Armstrong		compatible = "hdmi-connector";
1706939db7eSNeil Armstrong		type = "a";
1716939db7eSNeil Armstrong
1726939db7eSNeil Armstrong		port {
1736939db7eSNeil Armstrong			hdmi_connector_in: endpoint {
1746939db7eSNeil Armstrong				remote-endpoint = <&hdmi_tx_tmds_out>;
1756939db7eSNeil Armstrong			};
1766939db7eSNeil Armstrong		};
1776939db7eSNeil Armstrong	};
178c246e9d6SNeil Armstrong};
179c246e9d6SNeil Armstrong
18082f11345SAndreas Färber&cvbs_vdac_port {
18182f11345SAndreas Färber	cvbs_vdac_out: endpoint {
18282f11345SAndreas Färber		remote-endpoint = <&cvbs_connector_in>;
18382f11345SAndreas Färber	};
184c246e9d6SNeil Armstrong};
185c246e9d6SNeil Armstrong
186b16c71c9SNeil Armstrong&cec_AO {
187b16c71c9SNeil Armstrong	status = "okay";
188b16c71c9SNeil Armstrong	pinctrl-0 = <&ao_cec_pins>;
189b16c71c9SNeil Armstrong	pinctrl-names = "default";
190b16c71c9SNeil Armstrong	hdmi-phandle = <&hdmi_tx>;
191b16c71c9SNeil Armstrong};
192b16c71c9SNeil Armstrong
193c246e9d6SNeil Armstrong&ethmac {
194c246e9d6SNeil Armstrong	status = "okay";
1953be2d9cfSNeil Armstrong	pinctrl-0 = <&eth_rmii_pins>;
196c246e9d6SNeil Armstrong	pinctrl-names = "default";
19767d49f30SMartin Blumenstingl
19867d49f30SMartin Blumenstingl	phy-handle = <&eth_phy0>;
1993be2d9cfSNeil Armstrong	phy-mode = "rmii";
20067d49f30SMartin Blumenstingl
20167d49f30SMartin Blumenstingl	snps,reset-gpio = <&gpio GPIOZ_14 0>;
20267d49f30SMartin Blumenstingl	snps,reset-delays-us = <0 10000 1000000>;
20367d49f30SMartin Blumenstingl	snps,reset-active-low;
20467d49f30SMartin Blumenstingl
20567d49f30SMartin Blumenstingl	mdio {
20667d49f30SMartin Blumenstingl		compatible = "snps,dwmac-mdio";
20767d49f30SMartin Blumenstingl		#address-cells = <1>;
20867d49f30SMartin Blumenstingl		#size-cells = <0>;
20967d49f30SMartin Blumenstingl
21067d49f30SMartin Blumenstingl		eth_phy0: ethernet-phy@0 {
21167d49f30SMartin Blumenstingl			/* IC Plus IP101GR (0x02430c54) */
21267d49f30SMartin Blumenstingl			reg = <0>;
21367d49f30SMartin Blumenstingl		};
21467d49f30SMartin Blumenstingl	};
215c246e9d6SNeil Armstrong};
216c246e9d6SNeil Armstrong
21782f11345SAndreas Färber&hdmi_tx {
21882f11345SAndreas Färber	status = "okay";
21982f11345SAndreas Färber	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
22082f11345SAndreas Färber	pinctrl-names = "default";
22182f11345SAndreas Färber};
22282f11345SAndreas Färber
22382f11345SAndreas Färber&hdmi_tx_tmds_port {
22482f11345SAndreas Färber	hdmi_tx_tmds_out: endpoint {
22582f11345SAndreas Färber		remote-endpoint = <&hdmi_connector_in>;
22682f11345SAndreas Färber	};
22782f11345SAndreas Färber};
22882f11345SAndreas Färber
229c246e9d6SNeil Armstrong&ir {
230c246e9d6SNeil Armstrong	status = "okay";
231c246e9d6SNeil Armstrong	pinctrl-0 = <&remote_input_ao_pins>;
232c246e9d6SNeil Armstrong	pinctrl-names = "default";
233c246e9d6SNeil Armstrong};
234a776e045SNeil Armstrong
23582f11345SAndreas Färber&pwm_ef {
23682f11345SAndreas Färber	status = "okay";
23782f11345SAndreas Färber	pinctrl-0 = <&pwm_e_pins>;
23882f11345SAndreas Färber	pinctrl-names = "default";
23982f11345SAndreas Färber	clocks = <&clkc CLKID_FCLK_DIV4>;
24082f11345SAndreas Färber	clock-names = "clkin0";
24182f11345SAndreas Färber};
24282f11345SAndreas Färber
243a776e045SNeil Armstrong/* Wireless SDIO Module */
244a776e045SNeil Armstrong&sd_emmc_a {
245a776e045SNeil Armstrong	status = "okay";
246a776e045SNeil Armstrong	pinctrl-0 = <&sdio_pins>;
24767e7607fSJerome Brunet	pinctrl-1 = <&sdio_clk_gate_pins>;
24867e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
249a776e045SNeil Armstrong	#address-cells = <1>;
250a776e045SNeil Armstrong	#size-cells = <0>;
251a776e045SNeil Armstrong
252a776e045SNeil Armstrong	bus-width = <4>;
253a776e045SNeil Armstrong	cap-sd-highspeed;
254a776e045SNeil Armstrong	max-frequency = <100000000>;
255a776e045SNeil Armstrong
256a776e045SNeil Armstrong	non-removable;
257a776e045SNeil Armstrong	disable-wp;
258a776e045SNeil Armstrong
259a776e045SNeil Armstrong	mmc-pwrseq = <&sdio_pwrseq>;
260a776e045SNeil Armstrong
261a776e045SNeil Armstrong	vmmc-supply = <&vddao_3v3>;
262a776e045SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
263a776e045SNeil Armstrong};
264a776e045SNeil Armstrong
265a776e045SNeil Armstrong/* SD card */
266a776e045SNeil Armstrong&sd_emmc_b {
267a776e045SNeil Armstrong	status = "okay";
268a776e045SNeil Armstrong	pinctrl-0 = <&sdcard_pins>;
26967e7607fSJerome Brunet	pinctrl-1 = <&sdcard_clk_gate_pins>;
27067e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
271a776e045SNeil Armstrong
272a776e045SNeil Armstrong	bus-width = <4>;
273a776e045SNeil Armstrong	cap-sd-highspeed;
274a776e045SNeil Armstrong	max-frequency = <100000000>;
275a776e045SNeil Armstrong	disable-wp;
276a776e045SNeil Armstrong
277a776e045SNeil Armstrong	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
278a776e045SNeil Armstrong	cd-inverted;
279a776e045SNeil Armstrong
280a776e045SNeil Armstrong	vmmc-supply = <&vddao_3v3>;
281a776e045SNeil Armstrong	vqmmc-supply = <&vddio_card>;
282a776e045SNeil Armstrong};
283a776e045SNeil Armstrong
284a776e045SNeil Armstrong/* eMMC */
285a776e045SNeil Armstrong&sd_emmc_c {
286a776e045SNeil Armstrong	status = "okay";
287ab36be66SNeil Armstrong	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
28867e7607fSJerome Brunet	pinctrl-1 = <&emmc_clk_gate_pins>;
28967e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
290a776e045SNeil Armstrong
291a776e045SNeil Armstrong	bus-width = <8>;
292a776e045SNeil Armstrong	cap-mmc-highspeed;
293a776e045SNeil Armstrong	max-frequency = <200000000>;
294a776e045SNeil Armstrong	non-removable;
295a776e045SNeil Armstrong	disable-wp;
296a776e045SNeil Armstrong	mmc-ddr-1_8v;
297a776e045SNeil Armstrong	mmc-hs200-1_8v;
298a776e045SNeil Armstrong
299a776e045SNeil Armstrong	mmc-pwrseq = <&emmc_pwrseq>;
300a776e045SNeil Armstrong	vmmc-supply = <&vcc_3v3>;
301a776e045SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
302a776e045SNeil Armstrong};
303a776e045SNeil Armstrong
30482f11345SAndreas Färber&uart_AO {
305a776e045SNeil Armstrong	status = "okay";
30682f11345SAndreas Färber	pinctrl-0 = <&uart_ao_a_pins>;
307a776e045SNeil Armstrong	pinctrl-names = "default";
3086939db7eSNeil Armstrong};
309e2f4d749SPeter Korsgaard
310e2f4d749SPeter Korsgaard&usb0_phy {
311e2f4d749SPeter Korsgaard	status = "okay";
312e2f4d749SPeter Korsgaard	phy-supply = <&usb_pwr>;
313e2f4d749SPeter Korsgaard};
314e2f4d749SPeter Korsgaard
315e2f4d749SPeter Korsgaard&usb1_phy {
316e2f4d749SPeter Korsgaard	status = "okay";
317e2f4d749SPeter Korsgaard};
318e2f4d749SPeter Korsgaard
319e2f4d749SPeter Korsgaard&usb0 {
320e2f4d749SPeter Korsgaard	status = "okay";
321e2f4d749SPeter Korsgaard};
322e2f4d749SPeter Korsgaard
323e2f4d749SPeter Korsgaard&usb1 {
324e2f4d749SPeter Korsgaard	status = "okay";
325e2f4d749SPeter Korsgaard};
326