1/*
2 * Copyright (c) 2016 BayLibre, SAS.
3 * Author: Neil Armstrong <narmstrong@baylibre.com>
4 *
5 * Copyright (c) 2016 Endless Computers, Inc.
6 * Author: Carlo Caione <carlo@endlessm.com>
7 *
8 * This file is dual-licensed: you can use it either under the terms
9 * of the GPL or the X11 license, at your option. Note that this dual
10 * licensing only applies to this file, and not this project as a
11 * whole.
12 *
13 *  a) This library is free software; you can redistribute it and/or
14 *     modify it under the terms of the GNU General Public License as
15 *     published by the Free Software Foundation; either version 2 of the
16 *     License, or (at your option) any later version.
17 *
18 *     This library is distributed in the hope that it will be useful,
19 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
20 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 *     GNU General Public License for more details.
22 *
23 * Or, alternatively,
24 *
25 *  b) Permission is hereby granted, free of charge, to any person
26 *     obtaining a copy of this software and associated documentation
27 *     files (the "Software"), to deal in the Software without
28 *     restriction, including without limitation the rights to use,
29 *     copy, modify, merge, publish, distribute, sublicense, and/or
30 *     sell copies of the Software, and to permit persons to whom the
31 *     Software is furnished to do so, subject to the following
32 *     conditions:
33 *
34 *     The above copyright notice and this permission notice shall be
35 *     included in all copies or substantial portions of the Software.
36 *
37 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
38 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
39 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
40 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
41 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
42 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
44 *     OTHER DEALINGS IN THE SOFTWARE.
45 */
46
47/dts-v1/;
48
49#include "meson-gxm.dtsi"
50
51/ {
52	compatible = "nexbox,a1", "amlogic,s912", "amlogic,meson-gxm";
53	model = "NEXBOX A1";
54
55	aliases {
56		serial0 = &uart_AO;
57		ethernet0 = &ethmac;
58	};
59
60	chosen {
61		stdout-path = "serial0:115200n8";
62	};
63
64	memory@0 {
65		device_type = "memory";
66		reg = <0x0 0x0 0x0 0x80000000>;
67	};
68
69	vddio_boot: regulator-vddio-boot {
70		compatible = "regulator-fixed";
71		regulator-name = "VDDIO_BOOT";
72		regulator-min-microvolt = <1800000>;
73		regulator-max-microvolt = <1800000>;
74	};
75
76	vddao_3v3: regulator-vddao-3v3 {
77		compatible = "regulator-fixed";
78		regulator-name = "VDDAO_3V3";
79		regulator-min-microvolt = <3300000>;
80		regulator-max-microvolt = <3300000>;
81	};
82
83	vcc_3v3: regulator-vcc-3v3 {
84		compatible = "regulator-fixed";
85		regulator-name = "VCC_3V3";
86		regulator-min-microvolt = <3300000>;
87		regulator-max-microvolt = <3300000>;
88	};
89
90	emmc_pwrseq: emmc-pwrseq {
91		compatible = "mmc-pwrseq-emmc";
92		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
93	};
94
95	cvbs-connector {
96		compatible = "composite-video-connector";
97
98		port {
99			cvbs_connector_in: endpoint {
100				remote-endpoint = <&cvbs_vdac_out>;
101			};
102		};
103	};
104
105	hdmi-connector {
106		compatible = "hdmi-connector";
107		type = "a";
108
109		port {
110			hdmi_connector_in: endpoint {
111				remote-endpoint = <&hdmi_tx_tmds_out>;
112			};
113		};
114	};
115};
116
117&cec_AO {
118	status = "okay";
119	pinctrl-0 = <&ao_cec_pins>;
120	pinctrl-names = "default";
121	hdmi-phandle = <&hdmi_tx>;
122};
123
124&cvbs_vdac_port {
125	cvbs_vdac_out: endpoint {
126		remote-endpoint = <&cvbs_connector_in>;
127	};
128};
129
130&ethmac {
131	status = "okay";
132
133	pinctrl-0 = <&eth_pins>;
134	pinctrl-names = "default";
135
136	/* Select external PHY by default */
137	phy-handle = <&external_phy>;
138
139	amlogic,tx-delay-ns = <2>;
140
141	snps,reset-gpio = <&gpio GPIOZ_14 0>;
142	snps,reset-delays-us = <0 10000 1000000>;
143	snps,reset-active-low;
144
145	/* External PHY is in RGMII */
146	phy-mode = "rgmii";
147};
148
149&external_mdio {
150	external_phy: ethernet-phy@0 {
151		compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22";
152		reg = <0>;
153		max-speed = <1000>;
154	};
155};
156
157&hdmi_tx {
158	status = "okay";
159	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
160	pinctrl-names = "default";
161};
162
163&hdmi_tx_tmds_port {
164	hdmi_tx_tmds_out: endpoint {
165		remote-endpoint = <&hdmi_connector_in>;
166	};
167};
168
169&ir {
170	status = "okay";
171	pinctrl-0 = <&remote_input_ao_pins>;
172	pinctrl-names = "default";
173};
174
175/* SD card */
176&sd_emmc_b {
177	status = "okay";
178	pinctrl-0 = <&sdcard_pins>;
179	pinctrl-1 = <&sdcard_clk_gate_pins>;
180	pinctrl-names = "default", "clk-gate";
181
182	bus-width = <4>;
183	cap-sd-highspeed;
184	max-frequency = <100000000>;
185	disable-wp;
186
187	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
188	cd-inverted;
189
190	vmmc-supply = <&vddao_3v3>;
191	vqmmc-supply = <&vddio_boot>;
192};
193
194/* eMMC */
195&sd_emmc_c {
196	status = "okay";
197	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
198	pinctrl-1 = <&emmc_clk_gate_pins>;
199	pinctrl-names = "default", "clk-gate";
200
201	bus-width = <8>;
202	cap-mmc-highspeed;
203	max-frequency = <200000000>;
204	non-removable;
205	disable-wp;
206	mmc-ddr-1_8v;
207	mmc-hs200-1_8v;
208
209	mmc-pwrseq = <&emmc_pwrseq>;
210	vmmc-supply = <&vcc_3v3>;
211	vqmmc-supply = <&vddio_boot>;
212};
213
214&uart_AO {
215	status = "okay";
216	pinctrl-0 = <&uart_ao_a_pins>;
217	pinctrl-names = "default";
218};
219