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	};
155c246e9d6SNeil Armstrong};
156c246e9d6SNeil Armstrong
157c246e9d6SNeil Armstrong&uart_AO {
158c246e9d6SNeil Armstrong	status = "okay";
159c246e9d6SNeil Armstrong	pinctrl-0 = <&uart_ao_a_pins>;
160c246e9d6SNeil Armstrong	pinctrl-names = "default";
161c246e9d6SNeil Armstrong};
162c246e9d6SNeil Armstrong
163c246e9d6SNeil Armstrong&ethmac {
164c246e9d6SNeil Armstrong	status = "okay";
1653be2d9cfSNeil Armstrong	pinctrl-0 = <&eth_rmii_pins>;
166c246e9d6SNeil Armstrong	pinctrl-names = "default";
16767d49f30SMartin Blumenstingl
16867d49f30SMartin Blumenstingl	phy-handle = <&eth_phy0>;
1693be2d9cfSNeil Armstrong	phy-mode = "rmii";
17067d49f30SMartin Blumenstingl
17167d49f30SMartin Blumenstingl	snps,reset-gpio = <&gpio GPIOZ_14 0>;
17267d49f30SMartin Blumenstingl	snps,reset-delays-us = <0 10000 1000000>;
17367d49f30SMartin Blumenstingl	snps,reset-active-low;
17467d49f30SMartin Blumenstingl
17567d49f30SMartin Blumenstingl	mdio {
17667d49f30SMartin Blumenstingl		compatible = "snps,dwmac-mdio";
17767d49f30SMartin Blumenstingl		#address-cells = <1>;
17867d49f30SMartin Blumenstingl		#size-cells = <0>;
17967d49f30SMartin Blumenstingl
18067d49f30SMartin Blumenstingl		eth_phy0: ethernet-phy@0 {
18167d49f30SMartin Blumenstingl			/* IC Plus IP101GR (0x02430c54) */
18267d49f30SMartin Blumenstingl			reg = <0>;
18367d49f30SMartin Blumenstingl		};
18467d49f30SMartin Blumenstingl	};
185c246e9d6SNeil Armstrong};
186c246e9d6SNeil Armstrong
187c246e9d6SNeil Armstrong&ir {
188c246e9d6SNeil Armstrong	status = "okay";
189c246e9d6SNeil Armstrong	pinctrl-0 = <&remote_input_ao_pins>;
190c246e9d6SNeil Armstrong	pinctrl-names = "default";
191c246e9d6SNeil Armstrong};
192a776e045SNeil Armstrong
193a776e045SNeil Armstrong/* Wireless SDIO Module */
194a776e045SNeil Armstrong&sd_emmc_a {
195a776e045SNeil Armstrong	status = "okay";
196a776e045SNeil Armstrong	pinctrl-0 = <&sdio_pins>;
197a776e045SNeil Armstrong	pinctrl-names = "default";
198a776e045SNeil Armstrong	#address-cells = <1>;
199a776e045SNeil Armstrong	#size-cells = <0>;
200a776e045SNeil Armstrong
201a776e045SNeil Armstrong	bus-width = <4>;
202a776e045SNeil Armstrong	cap-sd-highspeed;
203a776e045SNeil Armstrong	max-frequency = <100000000>;
204a776e045SNeil Armstrong
205a776e045SNeil Armstrong	non-removable;
206a776e045SNeil Armstrong	disable-wp;
207a776e045SNeil Armstrong
208a776e045SNeil Armstrong	mmc-pwrseq = <&sdio_pwrseq>;
209a776e045SNeil Armstrong
210a776e045SNeil Armstrong	vmmc-supply = <&vddao_3v3>;
211a776e045SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
212a776e045SNeil Armstrong};
213a776e045SNeil Armstrong
214a776e045SNeil Armstrong/* SD card */
215a776e045SNeil Armstrong&sd_emmc_b {
216a776e045SNeil Armstrong	status = "okay";
217a776e045SNeil Armstrong	pinctrl-0 = <&sdcard_pins>;
218a776e045SNeil Armstrong	pinctrl-names = "default";
219a776e045SNeil Armstrong
220a776e045SNeil Armstrong	bus-width = <4>;
221a776e045SNeil Armstrong	cap-sd-highspeed;
222a776e045SNeil Armstrong	max-frequency = <100000000>;
223a776e045SNeil Armstrong	disable-wp;
224a776e045SNeil Armstrong
225a776e045SNeil Armstrong	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
226a776e045SNeil Armstrong	cd-inverted;
227a776e045SNeil Armstrong
228a776e045SNeil Armstrong	vmmc-supply = <&vddao_3v3>;
229a776e045SNeil Armstrong	vqmmc-supply = <&vddio_card>;
230a776e045SNeil Armstrong};
231a776e045SNeil Armstrong
232a776e045SNeil Armstrong/* eMMC */
233a776e045SNeil Armstrong&sd_emmc_c {
234a776e045SNeil Armstrong	status = "okay";
235a776e045SNeil Armstrong	pinctrl-0 = <&emmc_pins>;
236a776e045SNeil Armstrong	pinctrl-names = "default";
237a776e045SNeil Armstrong
238a776e045SNeil Armstrong	bus-width = <8>;
239a776e045SNeil Armstrong	cap-sd-highspeed;
240a776e045SNeil Armstrong	cap-mmc-highspeed;
241a776e045SNeil Armstrong	max-frequency = <200000000>;
242a776e045SNeil Armstrong	non-removable;
243a776e045SNeil Armstrong	disable-wp;
244a776e045SNeil Armstrong	mmc-ddr-1_8v;
245a776e045SNeil Armstrong	mmc-hs200-1_8v;
246a776e045SNeil Armstrong
247a776e045SNeil Armstrong	mmc-pwrseq = <&emmc_pwrseq>;
248a776e045SNeil Armstrong	vmmc-supply = <&vcc_3v3>;
249a776e045SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
250a776e045SNeil Armstrong};
251a776e045SNeil Armstrong
252a776e045SNeil Armstrong&pwm_ef {
253a776e045SNeil Armstrong	status = "okay";
254a776e045SNeil Armstrong	pinctrl-0 = <&pwm_e_pins>;
255a776e045SNeil Armstrong	pinctrl-names = "default";
256a776e045SNeil Armstrong	clocks = <&clkc CLKID_FCLK_DIV4>;
257a776e045SNeil Armstrong	clock-names = "clkin0";
258a776e045SNeil Armstrong};
259fafdbdf7SNeil Armstrong
260fafdbdf7SNeil Armstrong&cvbs_vdac_port {
261fafdbdf7SNeil Armstrong	cvbs_vdac_out: endpoint {
262fafdbdf7SNeil Armstrong		remote-endpoint = <&cvbs_connector_in>;
263fafdbdf7SNeil Armstrong	};
264fafdbdf7SNeil Armstrong};
265