1114abfe1SNeil Armstrong// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2c246e9d6SNeil Armstrong/*
3c246e9d6SNeil Armstrong * Copyright (c) 2016 Andreas Färber
4c246e9d6SNeil Armstrong * Copyright (c) 2016 BayLibre, Inc.
5c246e9d6SNeil Armstrong * Author: Neil Armstrong <narmstrong@kernel.org>
6c246e9d6SNeil Armstrong */
7c246e9d6SNeil Armstrong
8c246e9d6SNeil Armstrong/dts-v1/;
9c246e9d6SNeil Armstrong
10c246e9d6SNeil Armstrong#include "meson-gxbb.dtsi"
11c246e9d6SNeil Armstrong#include <dt-bindings/gpio/gpio.h>
12c246e9d6SNeil Armstrong#include <dt-bindings/input/input.h>
13ec78dc89SChristian Hewitt#include <dt-bindings/sound/meson-aiu.h>
14c246e9d6SNeil Armstrong
15c246e9d6SNeil Armstrong/ {
16c246e9d6SNeil Armstrong	compatible = "nexbox,a95x", "amlogic,meson-gxbb";
17c246e9d6SNeil Armstrong	model = "NEXBOX A95X";
18c246e9d6SNeil Armstrong
19c246e9d6SNeil Armstrong	aliases {
20c246e9d6SNeil Armstrong		serial0 = &uart_AO;
21059a58fcSJorge Ramirez-Ortiz		ethernet0 = &ethmac;
22c246e9d6SNeil Armstrong	};
23c246e9d6SNeil Armstrong
24c246e9d6SNeil Armstrong	chosen {
25c246e9d6SNeil Armstrong		stdout-path = "serial0:115200n8";
26c246e9d6SNeil Armstrong	};
27c246e9d6SNeil Armstrong
28c246e9d6SNeil Armstrong	memory@0 {
29c246e9d6SNeil Armstrong		device_type = "memory";
30c246e9d6SNeil Armstrong		reg = <0x0 0x0 0x0 0x40000000>;
31c246e9d6SNeil Armstrong	};
32c246e9d6SNeil Armstrong
33c246e9d6SNeil Armstrong	leds {
34c246e9d6SNeil Armstrong		compatible = "gpio-leds";
3508dc0e5dSNeil Armstrong		led-blue {
36c246e9d6SNeil Armstrong			label = "a95x:system-status";
37c246e9d6SNeil Armstrong			gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
38c246e9d6SNeil Armstrong			linux,default-trigger = "heartbeat";
39c246e9d6SNeil Armstrong			default-state = "off";
40c246e9d6SNeil Armstrong		};
41c246e9d6SNeil Armstrong	};
42c246e9d6SNeil Armstrong
43c246e9d6SNeil Armstrong	gpio-keys-polled {
44c246e9d6SNeil Armstrong		compatible = "gpio-keys-polled";
45c246e9d6SNeil Armstrong		poll-interval = <100>;
46c246e9d6SNeil Armstrong
47*4956be99SKrzysztof Kozlowski		button {
48c246e9d6SNeil Armstrong			label = "reset";
49c246e9d6SNeil Armstrong			linux,code = <KEY_RESTART>;
50c246e9d6SNeil Armstrong			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
51c246e9d6SNeil Armstrong		};
52c246e9d6SNeil Armstrong	};
53a776e045SNeil Armstrong
54e2f4d749SPeter Korsgaard	usb_pwr: regulator-usb-pwrs {
55e2f4d749SPeter Korsgaard		compatible = "regulator-fixed";
56e2f4d749SPeter Korsgaard
57e2f4d749SPeter Korsgaard		regulator-name = "USB_PWR";
58e2f4d749SPeter Korsgaard
59e2f4d749SPeter Korsgaard		regulator-min-microvolt = <5000000>;
60e2f4d749SPeter Korsgaard		regulator-max-microvolt = <5000000>;
61e2f4d749SPeter Korsgaard
62e2f4d749SPeter Korsgaard		gpio = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
63e2f4d749SPeter Korsgaard		enable-active-high;
64e2f4d749SPeter Korsgaard	};
65e2f4d749SPeter Korsgaard
66a776e045SNeil Armstrong	vddio_card: gpio-regulator {
67a776e045SNeil Armstrong		compatible = "regulator-gpio";
68a776e045SNeil Armstrong
69a776e045SNeil Armstrong		regulator-name = "VDDIO_CARD";
70a776e045SNeil Armstrong		regulator-min-microvolt = <1800000>;
71a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
72a776e045SNeil Armstrong
73a776e045SNeil Armstrong		gpios = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
74a776e045SNeil Armstrong		gpios-states = <1>;
75a776e045SNeil Armstrong
76a776e045SNeil Armstrong		/* Based on P200 schematics, signal CARD_1.8V/3.3V_CTR */
77f9717178SNeil Armstrong		states = <1800000 0>,
78f9717178SNeil Armstrong			 <3300000 1>;
79a776e045SNeil Armstrong	};
80a776e045SNeil Armstrong
81a776e045SNeil Armstrong	vddio_boot: regulator-vddio_boot {
82a776e045SNeil Armstrong		compatible = "regulator-fixed";
83a776e045SNeil Armstrong		regulator-name = "VDDIO_BOOT";
84a776e045SNeil Armstrong		regulator-min-microvolt = <1800000>;
85a776e045SNeil Armstrong		regulator-max-microvolt = <1800000>;
86a776e045SNeil Armstrong	};
87a776e045SNeil Armstrong
88a776e045SNeil Armstrong	vddao_3v3: regulator-vddao_3v3 {
89a776e045SNeil Armstrong		compatible = "regulator-fixed";
90a776e045SNeil Armstrong		regulator-name = "VDDAO_3V3";
91a776e045SNeil Armstrong		regulator-min-microvolt = <3300000>;
92a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
93a776e045SNeil Armstrong	};
94a776e045SNeil Armstrong
95a776e045SNeil Armstrong	vcc_3v3: regulator-vcc_3v3 {
96a776e045SNeil Armstrong		compatible = "regulator-fixed";
97a776e045SNeil Armstrong		regulator-name = "VCC_3V3";
98a776e045SNeil Armstrong		regulator-min-microvolt = <3300000>;
99a776e045SNeil Armstrong		regulator-max-microvolt = <3300000>;
100a776e045SNeil Armstrong	};
101a776e045SNeil Armstrong
102a776e045SNeil Armstrong	emmc_pwrseq: emmc-pwrseq {
103a776e045SNeil Armstrong		compatible = "mmc-pwrseq-emmc";
104a776e045SNeil Armstrong		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
105a776e045SNeil Armstrong	};
106a776e045SNeil Armstrong
107a776e045SNeil Armstrong	wifi32k: wifi32k {
108a776e045SNeil Armstrong		compatible = "pwm-clock";
109a776e045SNeil Armstrong		#clock-cells = <0>;
110a776e045SNeil Armstrong		clock-frequency = <32768>;
111a776e045SNeil Armstrong		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
112a776e045SNeil Armstrong	};
113a776e045SNeil Armstrong
114a776e045SNeil Armstrong	sdio_pwrseq: sdio-pwrseq {
115a776e045SNeil Armstrong		compatible = "mmc-pwrseq-simple";
116a776e045SNeil Armstrong		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
117a776e045SNeil Armstrong		clocks = <&wifi32k>;
118a776e045SNeil Armstrong		clock-names = "ext_clock";
119a776e045SNeil Armstrong	};
120fafdbdf7SNeil Armstrong
121fafdbdf7SNeil Armstrong	cvbs-connector {
122fafdbdf7SNeil Armstrong		compatible = "composite-video-connector";
123fafdbdf7SNeil Armstrong
124fafdbdf7SNeil Armstrong		port {
125fafdbdf7SNeil Armstrong			cvbs_connector_in: endpoint {
126fafdbdf7SNeil Armstrong				remote-endpoint = <&cvbs_vdac_out>;
127fafdbdf7SNeil Armstrong			};
128fafdbdf7SNeil Armstrong		};
129fafdbdf7SNeil Armstrong	};
1306939db7eSNeil Armstrong
1316939db7eSNeil Armstrong	hdmi-connector {
1326939db7eSNeil Armstrong		compatible = "hdmi-connector";
1336939db7eSNeil Armstrong		type = "a";
1346939db7eSNeil Armstrong
1356939db7eSNeil Armstrong		port {
1366939db7eSNeil Armstrong			hdmi_connector_in: endpoint {
1376939db7eSNeil Armstrong				remote-endpoint = <&hdmi_tx_tmds_out>;
1386939db7eSNeil Armstrong			};
1396939db7eSNeil Armstrong		};
1406939db7eSNeil Armstrong	};
141ec78dc89SChristian Hewitt
142ec78dc89SChristian Hewitt	sound {
143ec78dc89SChristian Hewitt		compatible = "amlogic,gx-sound-card";
144933b80edSChristian Hewitt		model = "NEXBOX-A95X";
145ec78dc89SChristian Hewitt		assigned-clocks = <&clkc CLKID_MPLL0>,
146ec78dc89SChristian Hewitt				  <&clkc CLKID_MPLL1>,
147ec78dc89SChristian Hewitt				  <&clkc CLKID_MPLL2>;
148ec78dc89SChristian Hewitt		assigned-clock-parents = <0>, <0>, <0>;
149ec78dc89SChristian Hewitt		assigned-clock-rates = <294912000>,
150ec78dc89SChristian Hewitt				       <270950400>,
151ec78dc89SChristian Hewitt				       <393216000>;
152ec78dc89SChristian Hewitt		status = "okay";
153ec78dc89SChristian Hewitt
154ec78dc89SChristian Hewitt		dai-link-0 {
155ec78dc89SChristian Hewitt			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
156ec78dc89SChristian Hewitt		};
157ec78dc89SChristian Hewitt
158ec78dc89SChristian Hewitt		dai-link-1 {
159ec78dc89SChristian Hewitt			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
160ec78dc89SChristian Hewitt			dai-format = "i2s";
161ec78dc89SChristian Hewitt			mclk-fs = <256>;
162ec78dc89SChristian Hewitt
163ec78dc89SChristian Hewitt			codec-0 {
164ec78dc89SChristian Hewitt				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
165ec78dc89SChristian Hewitt			};
166ec78dc89SChristian Hewitt		};
167ec78dc89SChristian Hewitt
168ec78dc89SChristian Hewitt		dai-link-2 {
169ec78dc89SChristian Hewitt			sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
170ec78dc89SChristian Hewitt
171ec78dc89SChristian Hewitt			codec-0 {
172ec78dc89SChristian Hewitt				sound-dai = <&hdmi_tx>;
173ec78dc89SChristian Hewitt			};
174ec78dc89SChristian Hewitt		};
175ec78dc89SChristian Hewitt	};
176ec78dc89SChristian Hewitt};
177ec78dc89SChristian Hewitt
178ec78dc89SChristian Hewitt&aiu {
179ec78dc89SChristian Hewitt	status = "okay";
180c246e9d6SNeil Armstrong};
181c246e9d6SNeil Armstrong
18282f11345SAndreas Färber&cvbs_vdac_port {
18382f11345SAndreas Färber	cvbs_vdac_out: endpoint {
18482f11345SAndreas Färber		remote-endpoint = <&cvbs_connector_in>;
18582f11345SAndreas Färber	};
186c246e9d6SNeil Armstrong};
187c246e9d6SNeil Armstrong
188b16c71c9SNeil Armstrong&cec_AO {
189b16c71c9SNeil Armstrong	status = "okay";
190b16c71c9SNeil Armstrong	pinctrl-0 = <&ao_cec_pins>;
191b16c71c9SNeil Armstrong	pinctrl-names = "default";
192b16c71c9SNeil Armstrong	hdmi-phandle = <&hdmi_tx>;
193b16c71c9SNeil Armstrong};
194b16c71c9SNeil Armstrong
195c246e9d6SNeil Armstrong&ethmac {
196c246e9d6SNeil Armstrong	status = "okay";
1973be2d9cfSNeil Armstrong	pinctrl-0 = <&eth_rmii_pins>;
198c246e9d6SNeil Armstrong	pinctrl-names = "default";
19967d49f30SMartin Blumenstingl
20067d49f30SMartin Blumenstingl	phy-handle = <&eth_phy0>;
2013be2d9cfSNeil Armstrong	phy-mode = "rmii";
20267d49f30SMartin Blumenstingl
20367d49f30SMartin Blumenstingl	mdio {
20467d49f30SMartin Blumenstingl		compatible = "snps,dwmac-mdio";
20567d49f30SMartin Blumenstingl		#address-cells = <1>;
20667d49f30SMartin Blumenstingl		#size-cells = <0>;
20767d49f30SMartin Blumenstingl
20867d49f30SMartin Blumenstingl		eth_phy0: ethernet-phy@0 {
20967d49f30SMartin Blumenstingl			/* IC Plus IP101GR (0x02430c54) */
21067d49f30SMartin Blumenstingl			reg = <0>;
211f29cabf2SMartin Blumenstingl
212f29cabf2SMartin Blumenstingl			reset-assert-us = <10000>;
213f29cabf2SMartin Blumenstingl			reset-deassert-us = <10000>;
214f29cabf2SMartin Blumenstingl			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
21567d49f30SMartin Blumenstingl		};
21667d49f30SMartin Blumenstingl	};
217c246e9d6SNeil Armstrong};
218c246e9d6SNeil Armstrong
21982f11345SAndreas Färber&hdmi_tx {
22082f11345SAndreas Färber	status = "okay";
22182f11345SAndreas Färber	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
22282f11345SAndreas Färber	pinctrl-names = "default";
22382f11345SAndreas Färber};
22482f11345SAndreas Färber
22582f11345SAndreas Färber&hdmi_tx_tmds_port {
22682f11345SAndreas Färber	hdmi_tx_tmds_out: endpoint {
22782f11345SAndreas Färber		remote-endpoint = <&hdmi_connector_in>;
22882f11345SAndreas Färber	};
22982f11345SAndreas Färber};
23082f11345SAndreas Färber
231c246e9d6SNeil Armstrong&ir {
232c246e9d6SNeil Armstrong	status = "okay";
233c246e9d6SNeil Armstrong	pinctrl-0 = <&remote_input_ao_pins>;
234c246e9d6SNeil Armstrong	pinctrl-names = "default";
235c246e9d6SNeil Armstrong};
236a776e045SNeil Armstrong
23782f11345SAndreas Färber&pwm_ef {
23882f11345SAndreas Färber	status = "okay";
23982f11345SAndreas Färber	pinctrl-0 = <&pwm_e_pins>;
24082f11345SAndreas Färber	pinctrl-names = "default";
24182f11345SAndreas Färber	clocks = <&clkc CLKID_FCLK_DIV4>;
24282f11345SAndreas Färber	clock-names = "clkin0";
24382f11345SAndreas Färber};
24482f11345SAndreas Färber
245a776e045SNeil Armstrong/* Wireless SDIO Module */
246a776e045SNeil Armstrong&sd_emmc_a {
247a776e045SNeil Armstrong	status = "okay";
248a776e045SNeil Armstrong	pinctrl-0 = <&sdio_pins>;
24967e7607fSJerome Brunet	pinctrl-1 = <&sdio_clk_gate_pins>;
25067e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
251a776e045SNeil Armstrong	#address-cells = <1>;
252a776e045SNeil Armstrong	#size-cells = <0>;
253a776e045SNeil Armstrong
254a776e045SNeil Armstrong	bus-width = <4>;
255a776e045SNeil Armstrong	cap-sd-highspeed;
256a776e045SNeil Armstrong	max-frequency = <100000000>;
257a776e045SNeil Armstrong
258a776e045SNeil Armstrong	non-removable;
259a776e045SNeil Armstrong	disable-wp;
260a776e045SNeil Armstrong
26142d7815cSNeil Armstrong	/* WiFi firmware requires power to be kept while in suspend */
26242d7815cSNeil Armstrong	keep-power-in-suspend;
26342d7815cSNeil Armstrong
264a776e045SNeil Armstrong	mmc-pwrseq = <&sdio_pwrseq>;
265a776e045SNeil Armstrong
266a776e045SNeil Armstrong	vmmc-supply = <&vddao_3v3>;
267a776e045SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
268a776e045SNeil Armstrong};
269a776e045SNeil Armstrong
270a776e045SNeil Armstrong/* SD card */
271a776e045SNeil Armstrong&sd_emmc_b {
272a776e045SNeil Armstrong	status = "okay";
273a776e045SNeil Armstrong	pinctrl-0 = <&sdcard_pins>;
27467e7607fSJerome Brunet	pinctrl-1 = <&sdcard_clk_gate_pins>;
27567e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
276a776e045SNeil Armstrong
277a776e045SNeil Armstrong	bus-width = <4>;
278a776e045SNeil Armstrong	cap-sd-highspeed;
279adc52bf7SJerome Brunet	max-frequency = <50000000>;
280a776e045SNeil Armstrong	disable-wp;
281a776e045SNeil Armstrong
282f29200c8SLoys Ollivier	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
283a776e045SNeil Armstrong
284a776e045SNeil Armstrong	vmmc-supply = <&vddao_3v3>;
285a776e045SNeil Armstrong	vqmmc-supply = <&vddio_card>;
286a776e045SNeil Armstrong};
287a776e045SNeil Armstrong
288a776e045SNeil Armstrong/* eMMC */
289a776e045SNeil Armstrong&sd_emmc_c {
290a776e045SNeil Armstrong	status = "okay";
291ab36be66SNeil Armstrong	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
29267e7607fSJerome Brunet	pinctrl-1 = <&emmc_clk_gate_pins>;
29367e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
294a776e045SNeil Armstrong
295a776e045SNeil Armstrong	bus-width = <8>;
296a776e045SNeil Armstrong	cap-mmc-highspeed;
297a776e045SNeil Armstrong	max-frequency = <200000000>;
298a776e045SNeil Armstrong	non-removable;
299a776e045SNeil Armstrong	disable-wp;
300a776e045SNeil Armstrong	mmc-ddr-1_8v;
301a776e045SNeil Armstrong	mmc-hs200-1_8v;
302a776e045SNeil Armstrong
303a776e045SNeil Armstrong	mmc-pwrseq = <&emmc_pwrseq>;
304a776e045SNeil Armstrong	vmmc-supply = <&vcc_3v3>;
305a776e045SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
306a776e045SNeil Armstrong};
307a776e045SNeil Armstrong
30882f11345SAndreas Färber&uart_AO {
309a776e045SNeil Armstrong	status = "okay";
31082f11345SAndreas Färber	pinctrl-0 = <&uart_ao_a_pins>;
311a776e045SNeil Armstrong	pinctrl-names = "default";
3126939db7eSNeil Armstrong};
313e2f4d749SPeter Korsgaard
314e2f4d749SPeter Korsgaard&usb0_phy {
315e2f4d749SPeter Korsgaard	status = "okay";
316e2f4d749SPeter Korsgaard	phy-supply = <&usb_pwr>;
317e2f4d749SPeter Korsgaard};
318e2f4d749SPeter Korsgaard
319e2f4d749SPeter Korsgaard&usb1_phy {
320e2f4d749SPeter Korsgaard	status = "okay";
321e2f4d749SPeter Korsgaard};
322e2f4d749SPeter Korsgaard
323e2f4d749SPeter Korsgaard&usb0 {
324e2f4d749SPeter Korsgaard	status = "okay";
325e2f4d749SPeter Korsgaard};
326e2f4d749SPeter Korsgaard
327e2f4d749SPeter Korsgaard&usb1 {
328e2f4d749SPeter Korsgaard	status = "okay";
329e2f4d749SPeter Korsgaard};
330