1/*
2 * Copyright (c) 2017 BayLibre, SAS.
3 * Author: Neil Armstrong <narmstrong@baylibre.com>
4 * Author: Jerome Brunet <jbrunet@baylibre.com>
5 *
6 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
7 */
8
9/dts-v1/;
10
11#include <dt-bindings/input/input.h>
12
13#include "meson-gxl-s905x.dtsi"
14
15/ {
16	compatible = "libretech,cc", "amlogic,s905x", "amlogic,meson-gxl";
17	model = "Libre Technology CC";
18
19	aliases {
20		serial0 = &uart_AO;
21	};
22
23	chosen {
24		stdout-path = "serial0:115200n8";
25	};
26
27	cvbs-connector {
28		compatible = "composite-video-connector";
29
30		port {
31			cvbs_connector_in: endpoint {
32				remote-endpoint = <&cvbs_vdac_out>;
33			};
34		};
35	};
36
37	emmc_pwrseq: emmc-pwrseq {
38		compatible = "mmc-pwrseq-emmc";
39		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
40	};
41
42	hdmi-connector {
43		compatible = "hdmi-connector";
44		type = "a";
45
46		port {
47			hdmi_connector_in: endpoint {
48				remote-endpoint = <&hdmi_tx_tmds_out>;
49			};
50		};
51	};
52
53	leds {
54		compatible = "gpio-leds";
55
56		system {
57			label = "librecomputer:system-status";
58			gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
59			default-state = "on";
60			panic-indicator;
61		};
62
63		blue {
64			label = "librecomputer:blue";
65			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
66			linux,default-trigger = "heartbeat";
67		};
68	};
69
70	memory@0 {
71		device_type = "memory";
72		reg = <0x0 0x0 0x0 0x80000000>;
73	};
74
75	vcc_3v3: regulator-vcc_3v3 {
76		compatible = "regulator-fixed";
77		regulator-name = "VCC_3V3";
78		regulator-min-microvolt = <3300000>;
79		regulator-max-microvolt = <3300000>;
80	};
81
82	vcc_card: regulator-vcc-card {
83		compatible = "regulator-gpio";
84
85		regulator-name = "VCC_CARD";
86		regulator-min-microvolt = <1800000>;
87		regulator-max-microvolt = <3300000>;
88
89		gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
90		gpios-states = <0>;
91
92		states = <3300000 0>,
93			 <1800000 1>;
94	};
95
96	vddio_boot: regulator-vddio_boot {
97		compatible = "regulator-fixed";
98		regulator-name = "VDDIO_BOOT";
99		regulator-min-microvolt = <3300000>;
100		regulator-max-microvolt = <3300000>;
101	};
102};
103
104&cvbs_vdac_port {
105	cvbs_vdac_out: endpoint {
106		remote-endpoint = <&cvbs_connector_in>;
107	};
108};
109
110&ethmac {
111	status = "okay";
112};
113
114&ir {
115	status = "okay";
116	pinctrl-0 = <&remote_input_ao_pins>;
117	pinctrl-names = "default";
118};
119
120&hdmi_tx {
121	status = "okay";
122	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
123	pinctrl-names = "default";
124};
125
126&hdmi_tx_tmds_port {
127	hdmi_tx_tmds_out: endpoint {
128		remote-endpoint = <&hdmi_connector_in>;
129	};
130};
131
132/* SD card */
133&sd_emmc_b {
134	status = "okay";
135	pinctrl-0 = <&sdcard_pins>;
136	pinctrl-names = "default";
137
138	bus-width = <4>;
139	cap-sd-highspeed;
140	max-frequency = <100000000>;
141	disable-wp;
142
143	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
144	cd-inverted;
145
146	vmmc-supply = <&vcc_3v3>;
147	vqmmc-supply = <&vcc_card>;
148};
149
150/* eMMC */
151&sd_emmc_c {
152	status = "okay";
153	pinctrl-0 = <&emmc_pins>;
154	pinctrl-names = "default";
155
156	bus-width = <8>;
157	cap-mmc-highspeed;
158	max-frequency = <50000000>;
159	non-removable;
160	disable-wp;
161
162	mmc-pwrseq = <&emmc_pwrseq>;
163	vmmc-supply = <&vcc_3v3>;
164	vqmmc-supply = <&vddio_boot>;
165};
166
167&uart_AO {
168	status = "okay";
169	pinctrl-0 = <&uart_ao_a_pins>;
170	pinctrl-names = "default";
171};
172