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
91a776e045SNeil Armstrong	vddio_card: gpio-regulator {
92a776e045SNeil Armstrong		compatible = "regulator-gpio";
93a776e045SNeil Armstrong
94a776e045SNeil Armstrong		regulator-name = "VDDIO_CARD";
95a776e045SNeil Armstrong		regulator-min-microvolt = <1800000>;
96a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
97a776e045SNeil Armstrong
98a776e045SNeil Armstrong		gpios = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
99a776e045SNeil Armstrong		gpios-states = <1>;
100a776e045SNeil Armstrong
101a776e045SNeil Armstrong		/* Based on P200 schematics, signal CARD_1.8V/3.3V_CTR */
102a776e045SNeil Armstrong		states = <1800000 0
103a776e045SNeil Armstrong			  3300000 1>;
104a776e045SNeil Armstrong	};
105a776e045SNeil Armstrong
106a776e045SNeil Armstrong	vddio_boot: regulator-vddio_boot {
107a776e045SNeil Armstrong		compatible = "regulator-fixed";
108a776e045SNeil Armstrong		regulator-name = "VDDIO_BOOT";
109a776e045SNeil Armstrong		regulator-min-microvolt = <1800000>;
110a776e045SNeil Armstrong		regulator-max-microvolt = <1800000>;
111a776e045SNeil Armstrong	};
112a776e045SNeil Armstrong
113a776e045SNeil Armstrong	vddao_3v3: regulator-vddao_3v3 {
114a776e045SNeil Armstrong		compatible = "regulator-fixed";
115a776e045SNeil Armstrong		regulator-name = "VDDAO_3V3";
116a776e045SNeil Armstrong		regulator-min-microvolt = <3300000>;
117a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
118a776e045SNeil Armstrong	};
119a776e045SNeil Armstrong
120a776e045SNeil Armstrong	vcc_3v3: regulator-vcc_3v3 {
121a776e045SNeil Armstrong		compatible = "regulator-fixed";
122a776e045SNeil Armstrong		regulator-name = "VCC_3V3";
123a776e045SNeil Armstrong		regulator-min-microvolt = <3300000>;
124a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
125a776e045SNeil Armstrong	};
126a776e045SNeil Armstrong
127a776e045SNeil Armstrong	emmc_pwrseq: emmc-pwrseq {
128a776e045SNeil Armstrong		compatible = "mmc-pwrseq-emmc";
129a776e045SNeil Armstrong		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
130a776e045SNeil Armstrong	};
131a776e045SNeil Armstrong
132a776e045SNeil Armstrong	wifi32k: wifi32k {
133a776e045SNeil Armstrong		compatible = "pwm-clock";
134a776e045SNeil Armstrong		#clock-cells = <0>;
135a776e045SNeil Armstrong		clock-frequency = <32768>;
136a776e045SNeil Armstrong		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
137a776e045SNeil Armstrong	};
138a776e045SNeil Armstrong
139a776e045SNeil Armstrong	sdio_pwrseq: sdio-pwrseq {
140a776e045SNeil Armstrong		compatible = "mmc-pwrseq-simple";
141a776e045SNeil Armstrong		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
142a776e045SNeil Armstrong		clocks = <&wifi32k>;
143a776e045SNeil Armstrong		clock-names = "ext_clock";
144a776e045SNeil Armstrong	};
145fafdbdf7SNeil Armstrong
146fafdbdf7SNeil Armstrong	cvbs-connector {
147fafdbdf7SNeil Armstrong		compatible = "composite-video-connector";
148fafdbdf7SNeil Armstrong
149fafdbdf7SNeil Armstrong		port {
150fafdbdf7SNeil Armstrong			cvbs_connector_in: endpoint {
151fafdbdf7SNeil Armstrong				remote-endpoint = <&cvbs_vdac_out>;
152fafdbdf7SNeil Armstrong			};
153fafdbdf7SNeil Armstrong		};
154fafdbdf7SNeil Armstrong	};
1556939db7eSNeil Armstrong
1566939db7eSNeil Armstrong	hdmi-connector {
1576939db7eSNeil Armstrong		compatible = "hdmi-connector";
1586939db7eSNeil Armstrong		type = "a";
1596939db7eSNeil Armstrong
1606939db7eSNeil Armstrong		port {
1616939db7eSNeil Armstrong			hdmi_connector_in: endpoint {
1626939db7eSNeil Armstrong				remote-endpoint = <&hdmi_tx_tmds_out>;
1636939db7eSNeil Armstrong			};
1646939db7eSNeil Armstrong		};
1656939db7eSNeil Armstrong	};
166c246e9d6SNeil Armstrong};
167c246e9d6SNeil Armstrong
16882f11345SAndreas Färber&cvbs_vdac_port {
16982f11345SAndreas Färber	cvbs_vdac_out: endpoint {
17082f11345SAndreas Färber		remote-endpoint = <&cvbs_connector_in>;
17182f11345SAndreas Färber	};
172c246e9d6SNeil Armstrong};
173c246e9d6SNeil Armstrong
174b16c71c9SNeil Armstrong&cec_AO {
175b16c71c9SNeil Armstrong	status = "okay";
176b16c71c9SNeil Armstrong	pinctrl-0 = <&ao_cec_pins>;
177b16c71c9SNeil Armstrong	pinctrl-names = "default";
178b16c71c9SNeil Armstrong	hdmi-phandle = <&hdmi_tx>;
179b16c71c9SNeil Armstrong};
180b16c71c9SNeil Armstrong
181c246e9d6SNeil Armstrong&ethmac {
182c246e9d6SNeil Armstrong	status = "okay";
1833be2d9cfSNeil Armstrong	pinctrl-0 = <&eth_rmii_pins>;
184c246e9d6SNeil Armstrong	pinctrl-names = "default";
18567d49f30SMartin Blumenstingl
18667d49f30SMartin Blumenstingl	phy-handle = <&eth_phy0>;
1873be2d9cfSNeil Armstrong	phy-mode = "rmii";
18867d49f30SMartin Blumenstingl
18967d49f30SMartin Blumenstingl	snps,reset-gpio = <&gpio GPIOZ_14 0>;
19067d49f30SMartin Blumenstingl	snps,reset-delays-us = <0 10000 1000000>;
19167d49f30SMartin Blumenstingl	snps,reset-active-low;
19267d49f30SMartin Blumenstingl
19367d49f30SMartin Blumenstingl	mdio {
19467d49f30SMartin Blumenstingl		compatible = "snps,dwmac-mdio";
19567d49f30SMartin Blumenstingl		#address-cells = <1>;
19667d49f30SMartin Blumenstingl		#size-cells = <0>;
19767d49f30SMartin Blumenstingl
19867d49f30SMartin Blumenstingl		eth_phy0: ethernet-phy@0 {
19967d49f30SMartin Blumenstingl			/* IC Plus IP101GR (0x02430c54) */
20067d49f30SMartin Blumenstingl			reg = <0>;
20167d49f30SMartin Blumenstingl		};
20267d49f30SMartin Blumenstingl	};
203c246e9d6SNeil Armstrong};
204c246e9d6SNeil Armstrong
20582f11345SAndreas Färber&hdmi_tx {
20682f11345SAndreas Färber	status = "okay";
20782f11345SAndreas Färber	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
20882f11345SAndreas Färber	pinctrl-names = "default";
20982f11345SAndreas Färber};
21082f11345SAndreas Färber
21182f11345SAndreas Färber&hdmi_tx_tmds_port {
21282f11345SAndreas Färber	hdmi_tx_tmds_out: endpoint {
21382f11345SAndreas Färber		remote-endpoint = <&hdmi_connector_in>;
21482f11345SAndreas Färber	};
21582f11345SAndreas Färber};
21682f11345SAndreas Färber
217c246e9d6SNeil Armstrong&ir {
218c246e9d6SNeil Armstrong	status = "okay";
219c246e9d6SNeil Armstrong	pinctrl-0 = <&remote_input_ao_pins>;
220c246e9d6SNeil Armstrong	pinctrl-names = "default";
221c246e9d6SNeil Armstrong};
222a776e045SNeil Armstrong
22382f11345SAndreas Färber&pwm_ef {
22482f11345SAndreas Färber	status = "okay";
22582f11345SAndreas Färber	pinctrl-0 = <&pwm_e_pins>;
22682f11345SAndreas Färber	pinctrl-names = "default";
22782f11345SAndreas Färber	clocks = <&clkc CLKID_FCLK_DIV4>;
22882f11345SAndreas Färber	clock-names = "clkin0";
22982f11345SAndreas Färber};
23082f11345SAndreas Färber
231a776e045SNeil Armstrong/* Wireless SDIO Module */
232a776e045SNeil Armstrong&sd_emmc_a {
233a776e045SNeil Armstrong	status = "okay";
234a776e045SNeil Armstrong	pinctrl-0 = <&sdio_pins>;
235a776e045SNeil Armstrong	pinctrl-names = "default";
236a776e045SNeil Armstrong	#address-cells = <1>;
237a776e045SNeil Armstrong	#size-cells = <0>;
238a776e045SNeil Armstrong
239a776e045SNeil Armstrong	bus-width = <4>;
240a776e045SNeil Armstrong	cap-sd-highspeed;
241a776e045SNeil Armstrong	max-frequency = <100000000>;
242a776e045SNeil Armstrong
243a776e045SNeil Armstrong	non-removable;
244a776e045SNeil Armstrong	disable-wp;
245a776e045SNeil Armstrong
246a776e045SNeil Armstrong	mmc-pwrseq = <&sdio_pwrseq>;
247a776e045SNeil Armstrong
248a776e045SNeil Armstrong	vmmc-supply = <&vddao_3v3>;
249a776e045SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
250a776e045SNeil Armstrong};
251a776e045SNeil Armstrong
252a776e045SNeil Armstrong/* SD card */
253a776e045SNeil Armstrong&sd_emmc_b {
254a776e045SNeil Armstrong	status = "okay";
255a776e045SNeil Armstrong	pinctrl-0 = <&sdcard_pins>;
256a776e045SNeil Armstrong	pinctrl-names = "default";
257a776e045SNeil Armstrong
258a776e045SNeil Armstrong	bus-width = <4>;
259a776e045SNeil Armstrong	cap-sd-highspeed;
260a776e045SNeil Armstrong	max-frequency = <100000000>;
261a776e045SNeil Armstrong	disable-wp;
262a776e045SNeil Armstrong
263a776e045SNeil Armstrong	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
264a776e045SNeil Armstrong	cd-inverted;
265a776e045SNeil Armstrong
266a776e045SNeil Armstrong	vmmc-supply = <&vddao_3v3>;
267a776e045SNeil Armstrong	vqmmc-supply = <&vddio_card>;
268a776e045SNeil Armstrong};
269a776e045SNeil Armstrong
270a776e045SNeil Armstrong/* eMMC */
271a776e045SNeil Armstrong&sd_emmc_c {
272a776e045SNeil Armstrong	status = "okay";
273a776e045SNeil Armstrong	pinctrl-0 = <&emmc_pins>;
274a776e045SNeil Armstrong	pinctrl-names = "default";
275a776e045SNeil Armstrong
276a776e045SNeil Armstrong	bus-width = <8>;
277a776e045SNeil Armstrong	cap-sd-highspeed;
278a776e045SNeil Armstrong	cap-mmc-highspeed;
279a776e045SNeil Armstrong	max-frequency = <200000000>;
280a776e045SNeil Armstrong	non-removable;
281a776e045SNeil Armstrong	disable-wp;
282a776e045SNeil Armstrong	mmc-ddr-1_8v;
283a776e045SNeil Armstrong	mmc-hs200-1_8v;
284a776e045SNeil Armstrong
285a776e045SNeil Armstrong	mmc-pwrseq = <&emmc_pwrseq>;
286a776e045SNeil Armstrong	vmmc-supply = <&vcc_3v3>;
287a776e045SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
288a776e045SNeil Armstrong};
289a776e045SNeil Armstrong
29082f11345SAndreas Färber&uart_AO {
291a776e045SNeil Armstrong	status = "okay";
29282f11345SAndreas Färber	pinctrl-0 = <&uart_ao_a_pins>;
293a776e045SNeil Armstrong	pinctrl-names = "default";
2946939db7eSNeil Armstrong};
295