10449b8e3SNeil Armstrong// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
20449b8e3SNeil Armstrong/*
30449b8e3SNeil Armstrong * Copyright (c) 2018 BayLibre, SAS.
40449b8e3SNeil Armstrong * Author: Neil Armstrong <narmstrong@baylibre.com>
50449b8e3SNeil Armstrong * Author: Jerome Brunet <jbrunet@baylibre.com>
60449b8e3SNeil Armstrong */
70449b8e3SNeil Armstrong
80449b8e3SNeil Armstrong/dts-v1/;
90449b8e3SNeil Armstrong
100449b8e3SNeil Armstrong#include <dt-bindings/input/input.h>
11c755c791SJerome Brunet#include <dt-bindings/sound/meson-aiu.h>
120449b8e3SNeil Armstrong
130449b8e3SNeil Armstrong#include "meson-gxl-s905x.dtsi"
140449b8e3SNeil Armstrong
150449b8e3SNeil Armstrong/ {
160449b8e3SNeil Armstrong	compatible = "libretech,aml-s805x-ac", "amlogic,s805x",
170449b8e3SNeil Armstrong		     "amlogic,meson-gxl";
18b1ae8ca5SChristian Hewitt	model = "Libre Computer AML-S805X-AC";
190449b8e3SNeil Armstrong
200449b8e3SNeil Armstrong	aliases {
210449b8e3SNeil Armstrong		serial0 = &uart_AO;
220449b8e3SNeil Armstrong		ethernet0 = &ethmac;
230449b8e3SNeil Armstrong		spi0 = &spifc;
240449b8e3SNeil Armstrong	};
250449b8e3SNeil Armstrong
260449b8e3SNeil Armstrong	chosen {
270449b8e3SNeil Armstrong		stdout-path = "serial0:115200n8";
280449b8e3SNeil Armstrong	};
290449b8e3SNeil Armstrong
300449b8e3SNeil Armstrong	cvbs-connector {
310449b8e3SNeil Armstrong		/*
320449b8e3SNeil Armstrong		 * The pads are present but no connector is soldered on
330449b8e3SNeil Armstrong		 * 2J2, so keep this off by default.
340449b8e3SNeil Armstrong		 */
350449b8e3SNeil Armstrong		status = "disabled";
360449b8e3SNeil Armstrong		compatible = "composite-video-connector";
370449b8e3SNeil Armstrong
380449b8e3SNeil Armstrong		port {
390449b8e3SNeil Armstrong			cvbs_connector_in: endpoint {
400449b8e3SNeil Armstrong				remote-endpoint = <&cvbs_vdac_out>;
410449b8e3SNeil Armstrong			};
420449b8e3SNeil Armstrong		};
430449b8e3SNeil Armstrong	};
440449b8e3SNeil Armstrong
450449b8e3SNeil Armstrong	dc_5v: regulator-dc_5v {
460449b8e3SNeil Armstrong		compatible = "regulator-fixed";
470449b8e3SNeil Armstrong		regulator-name = "DC_5V";
480449b8e3SNeil Armstrong		regulator-min-microvolt = <5000000>;
490449b8e3SNeil Armstrong		regulator-max-microvolt = <5000000>;
500449b8e3SNeil Armstrong		regulator-always-on;
510449b8e3SNeil Armstrong	};
520449b8e3SNeil Armstrong
530449b8e3SNeil Armstrong	emmc_pwrseq: emmc-pwrseq {
540449b8e3SNeil Armstrong		compatible = "mmc-pwrseq-emmc";
550449b8e3SNeil Armstrong		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
560449b8e3SNeil Armstrong	};
570449b8e3SNeil Armstrong
580449b8e3SNeil Armstrong	hdmi-connector {
590449b8e3SNeil Armstrong		compatible = "hdmi-connector";
600449b8e3SNeil Armstrong		type = "a";
610449b8e3SNeil Armstrong
620449b8e3SNeil Armstrong		port {
630449b8e3SNeil Armstrong			hdmi_connector_in: endpoint {
640449b8e3SNeil Armstrong				remote-endpoint = <&hdmi_tx_tmds_out>;
650449b8e3SNeil Armstrong			};
660449b8e3SNeil Armstrong		};
670449b8e3SNeil Armstrong	};
680449b8e3SNeil Armstrong
690449b8e3SNeil Armstrong	memory@0 {
700449b8e3SNeil Armstrong		device_type = "memory";
710449b8e3SNeil Armstrong		reg = <0x0 0x0 0x0 0x20000000>;
720449b8e3SNeil Armstrong	};
730449b8e3SNeil Armstrong
740449b8e3SNeil Armstrong	vcck: regulator-vcck {
750449b8e3SNeil Armstrong		compatible = "regulator-fixed";
760449b8e3SNeil Armstrong		regulator-name = "VCCK";
770449b8e3SNeil Armstrong		regulator-min-microvolt = <3300000>;
780449b8e3SNeil Armstrong		regulator-max-microvolt = <3300000>;
790449b8e3SNeil Armstrong		vin-supply = <&dc_5v>;
800449b8e3SNeil Armstrong
810449b8e3SNeil Armstrong		/*
820449b8e3SNeil Armstrong		 * This is controlled by GPIOAO_9 we reserve this but
830449b8e3SNeil Armstrong		 * claiming it as done below reset the board anyway
840449b8e3SNeil Armstrong		 * Need to investigate this
850449b8e3SNeil Armstrong		 *
860449b8e3SNeil Armstrong		 * gpio = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
870449b8e3SNeil Armstrong		 * enable-active-high;
880449b8e3SNeil Armstrong		 */
890449b8e3SNeil Armstrong		regulator-always-on;
900449b8e3SNeil Armstrong	};
910449b8e3SNeil Armstrong
920449b8e3SNeil Armstrong	vcc_3v3: regulator-vcc_3v3 {
930449b8e3SNeil Armstrong		compatible = "regulator-fixed";
940449b8e3SNeil Armstrong		regulator-name = "VCC_3V3";
950449b8e3SNeil Armstrong		regulator-min-microvolt = <3300000>;
960449b8e3SNeil Armstrong		regulator-max-microvolt = <3300000>;
970449b8e3SNeil Armstrong		vin-supply = <&dc_5v>;
980449b8e3SNeil Armstrong		regulator-always-on;
990449b8e3SNeil Armstrong	};
1000449b8e3SNeil Armstrong
1010449b8e3SNeil Armstrong	vddio_boot: regulator-vddio_boot {
1020449b8e3SNeil Armstrong		compatible = "regulator-fixed";
1030449b8e3SNeil Armstrong		regulator-name = "VDDIO_BOOT";
1040449b8e3SNeil Armstrong		regulator-min-microvolt = <1800000>;
1050449b8e3SNeil Armstrong		regulator-max-microvolt = <1800000>;
1060449b8e3SNeil Armstrong		vin-supply = <&vcc_3v3>;
1070449b8e3SNeil Armstrong		regulator-always-on;
1080449b8e3SNeil Armstrong	};
109c755c791SJerome Brunet
110c755c791SJerome Brunet	sound {
111c755c791SJerome Brunet		compatible = "amlogic,gx-sound-card";
112c755c791SJerome Brunet		model = "GXL-LIBRETECH-S805X-AC";
113c755c791SJerome Brunet		assigned-clocks = <&clkc CLKID_MPLL0>,
114c755c791SJerome Brunet				  <&clkc CLKID_MPLL1>,
115c755c791SJerome Brunet				  <&clkc CLKID_MPLL2>;
116c755c791SJerome Brunet		assigned-clock-parents = <0>, <0>, <0>;
117c755c791SJerome Brunet		assigned-clock-rates = <294912000>,
118c755c791SJerome Brunet				       <270950400>,
119c755c791SJerome Brunet				       <393216000>;
120c755c791SJerome Brunet		status = "okay";
121c755c791SJerome Brunet
122c755c791SJerome Brunet		dai-link-0 {
123c755c791SJerome Brunet			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
124c755c791SJerome Brunet		};
125c755c791SJerome Brunet
126c755c791SJerome Brunet		dai-link-1 {
127c755c791SJerome Brunet			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
128c755c791SJerome Brunet			dai-format = "i2s";
129c755c791SJerome Brunet			mclk-fs = <256>;
130c755c791SJerome Brunet
131c755c791SJerome Brunet			codec-0 {
132c755c791SJerome Brunet				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
133c755c791SJerome Brunet			};
134c755c791SJerome Brunet		};
135c755c791SJerome Brunet
136c755c791SJerome Brunet		dai-link-2 {
137c755c791SJerome Brunet			sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
138c755c791SJerome Brunet
139c755c791SJerome Brunet			codec-0 {
140c755c791SJerome Brunet				sound-dai = <&hdmi_tx>;
141c755c791SJerome Brunet			};
142c755c791SJerome Brunet		};
143c755c791SJerome Brunet	};
144c755c791SJerome Brunet};
145c755c791SJerome Brunet
146c755c791SJerome Brunet&aiu {
147c755c791SJerome Brunet	status = "okay";
1480449b8e3SNeil Armstrong};
1490449b8e3SNeil Armstrong
1500449b8e3SNeil Armstrong&cec_AO {
1510449b8e3SNeil Armstrong	status = "okay";
1520449b8e3SNeil Armstrong	pinctrl-0 = <&ao_cec_pins>;
1530449b8e3SNeil Armstrong	pinctrl-names = "default";
1540449b8e3SNeil Armstrong	hdmi-phandle = <&hdmi_tx>;
1550449b8e3SNeil Armstrong};
1560449b8e3SNeil Armstrong
1570449b8e3SNeil Armstrong&cvbs_vdac_port {
1580449b8e3SNeil Armstrong	cvbs_vdac_out: endpoint {
1590449b8e3SNeil Armstrong		remote-endpoint = <&cvbs_connector_in>;
1600449b8e3SNeil Armstrong	};
1610449b8e3SNeil Armstrong};
1620449b8e3SNeil Armstrong
1630449b8e3SNeil Armstrong&ethmac {
1640449b8e3SNeil Armstrong	status = "okay";
1650449b8e3SNeil Armstrong};
1660449b8e3SNeil Armstrong
1670449b8e3SNeil Armstrong&internal_phy {
1680449b8e3SNeil Armstrong	pinctrl-0 = <&eth_link_led_pins>, <&eth_act_led_pins>;
1690449b8e3SNeil Armstrong	pinctrl-names = "default";
1700449b8e3SNeil Armstrong};
1710449b8e3SNeil Armstrong
1720449b8e3SNeil Armstrong&ir {
1730449b8e3SNeil Armstrong	status = "okay";
1740449b8e3SNeil Armstrong	pinctrl-0 = <&remote_input_ao_pins>;
1750449b8e3SNeil Armstrong	pinctrl-names = "default";
1760449b8e3SNeil Armstrong};
1770449b8e3SNeil Armstrong
1780449b8e3SNeil Armstrong&hdmi_tx {
1790449b8e3SNeil Armstrong	status = "okay";
1800449b8e3SNeil Armstrong	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
1810449b8e3SNeil Armstrong	pinctrl-names = "default";
1820449b8e3SNeil Armstrong};
1830449b8e3SNeil Armstrong
1840449b8e3SNeil Armstrong&hdmi_tx_tmds_port {
1850449b8e3SNeil Armstrong	hdmi_tx_tmds_out: endpoint {
1860449b8e3SNeil Armstrong		remote-endpoint = <&hdmi_connector_in>;
1870449b8e3SNeil Armstrong	};
1880449b8e3SNeil Armstrong};
1890449b8e3SNeil Armstrong
1900449b8e3SNeil Armstrong&gpio_ao {
1910449b8e3SNeil Armstrong	gpio-line-names = "UART TX",
1920449b8e3SNeil Armstrong			  "UART RX",
1930449b8e3SNeil Armstrong			  "7J1 Header Pin31",
1940449b8e3SNeil Armstrong			  "", "", "", "",
1950449b8e3SNeil Armstrong			  "IR In",
1960449b8e3SNeil Armstrong			  "HDMI CEC",
1970449b8e3SNeil Armstrong			  "5V VCCK Regulator",
1980449b8e3SNeil Armstrong			  /* GPIO_TEST_N */
1990449b8e3SNeil Armstrong			  "";
2000449b8e3SNeil Armstrong};
2010449b8e3SNeil Armstrong
2020449b8e3SNeil Armstrong&gpio {
2030449b8e3SNeil Armstrong	gpio-line-names = /* Bank GPIOZ */
2040449b8e3SNeil Armstrong			  "", "", "", "", "", "", "",
2050449b8e3SNeil Armstrong			  "", "", "", "", "", "", "",
2060449b8e3SNeil Armstrong			  "Eth Link LED", "Eth Activity LED",
2070449b8e3SNeil Armstrong			  /* Bank GPIOH */
2080449b8e3SNeil Armstrong			  "HDMI HPD", "HDMI SDA", "HDMI SCL",
2090449b8e3SNeil Armstrong			  "", "7J1 Header Pin13",
2100449b8e3SNeil Armstrong			  "7J1 Header Pin15",
2110449b8e3SNeil Armstrong			  "7J1 Header Pin7",
2120449b8e3SNeil Armstrong			  "7J1 Header Pin12",
2130449b8e3SNeil Armstrong			  "7J1 Header Pin16",
2140449b8e3SNeil Armstrong			  "7J1 Header Pin18",
2150449b8e3SNeil Armstrong			  /* Bank BOOT */
2160449b8e3SNeil Armstrong			  "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3",
2170449b8e3SNeil Armstrong			  "eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7",
2180449b8e3SNeil Armstrong			  "eMMC Clk", "eMMC Reset", "eMMC CMD",
2190449b8e3SNeil Armstrong			  "SPI NOR MOSI", "SPI NOR MISO", "SPI NOR Clk",
2200449b8e3SNeil Armstrong			  "", "SPI NOR Chip Select",
2210449b8e3SNeil Armstrong			  /* Bank CARD */
2220449b8e3SNeil Armstrong			  "", "", "", "", "", "", "",
2230449b8e3SNeil Armstrong			  /* Bank GPIODV */
2240449b8e3SNeil Armstrong			  "", "", "", "", "", "", "", "", "", "", "", "",
2250449b8e3SNeil Armstrong			  "", "", "", "", "", "", "", "", "", "", "", "",
2260449b8e3SNeil Armstrong			  "7J1 Header Pin27", "7J1 Header Pin28", "",
2270449b8e3SNeil Armstrong			  "7J1 Header Pin29",
2280449b8e3SNeil Armstrong			  "VCCK Regulator", "VDDEE Regulator",
2290449b8e3SNeil Armstrong			  /* Bank GPIOX */
2300449b8e3SNeil Armstrong			  "7J1 Header Pin22", "7J1 Header Pin26",
2310449b8e3SNeil Armstrong			  "7J1 Header Pin36", "7J1 Header Pin38",
2320449b8e3SNeil Armstrong			  "7J1 Header Pin40", "7J1 Header Pin37",
2330449b8e3SNeil Armstrong			  "7J1 Header Pin33", "7J1 Header Pin35",
2340449b8e3SNeil Armstrong			  "7J1 Header Pin19", "7J1 Header Pin21",
2350449b8e3SNeil Armstrong			  "7J1 Header Pin24", "7J1 Header Pin23",
2360449b8e3SNeil Armstrong			  "7J1 Header Pin8", "7J1 Header Pin10",
2370449b8e3SNeil Armstrong			  "", "", "7J1 Header Pin32", "", "",
2380449b8e3SNeil Armstrong			  /* Bank GPIOCLK */
2390449b8e3SNeil Armstrong			  "", "";
2400449b8e3SNeil Armstrong};
2410449b8e3SNeil Armstrong
2420449b8e3SNeil Armstrong&saradc {
2430449b8e3SNeil Armstrong	status = "okay";
2440449b8e3SNeil Armstrong	vref-supply = <&vddio_boot>;
2450449b8e3SNeil Armstrong};
2460449b8e3SNeil Armstrong
2470449b8e3SNeil Armstrong/* eMMC */
2480449b8e3SNeil Armstrong&sd_emmc_c {
2490449b8e3SNeil Armstrong	status = "okay";
2500449b8e3SNeil Armstrong	pinctrl-0 = <&emmc_pins>;
2510449b8e3SNeil Armstrong	pinctrl-1 = <&emmc_clk_gate_pins>;
2520449b8e3SNeil Armstrong	pinctrl-names = "default", "clk-gate";
2530449b8e3SNeil Armstrong
2540449b8e3SNeil Armstrong	bus-width = <8>;
2550449b8e3SNeil Armstrong	cap-mmc-highspeed;
2560449b8e3SNeil Armstrong	mmc-ddr-1_8v;
2570449b8e3SNeil Armstrong	mmc-hs200-1_8v;
2580449b8e3SNeil Armstrong	max-frequency = <200000000>;
2590449b8e3SNeil Armstrong	disable-wp;
2600449b8e3SNeil Armstrong
2610449b8e3SNeil Armstrong	mmc-pwrseq = <&emmc_pwrseq>;
2620449b8e3SNeil Armstrong	vmmc-supply = <&vcc_3v3>;
2630449b8e3SNeil Armstrong	vqmmc-supply = <&vddio_boot>;
2640449b8e3SNeil Armstrong};
2650449b8e3SNeil Armstrong
2660449b8e3SNeil Armstrong&spifc {
2670449b8e3SNeil Armstrong	status = "okay";
2680449b8e3SNeil Armstrong	pinctrl-0 = <&nor_pins>;
2690449b8e3SNeil Armstrong	pinctrl-names = "default";
2700449b8e3SNeil Armstrong
2710449b8e3SNeil Armstrong	w25q32: spi-flash@0 {
2720449b8e3SNeil Armstrong		#address-cells = <1>;
2730449b8e3SNeil Armstrong		#size-cells = <1>;
2740449b8e3SNeil Armstrong		compatible = "jedec,spi-nor";
2750449b8e3SNeil Armstrong		reg = <0>;
2760449b8e3SNeil Armstrong		spi-max-frequency = <3000000>;
2770449b8e3SNeil Armstrong	};
2780449b8e3SNeil Armstrong};
2790449b8e3SNeil Armstrong
2800449b8e3SNeil Armstrong&uart_AO {
2810449b8e3SNeil Armstrong	status = "okay";
2820449b8e3SNeil Armstrong	pinctrl-0 = <&uart_ao_a_pins>;
2830449b8e3SNeil Armstrong	pinctrl-names = "default";
2840449b8e3SNeil Armstrong};
2850449b8e3SNeil Armstrong
2862f9139c2SMartin Blumenstingl&usb {
2870449b8e3SNeil Armstrong	status = "okay";
2882f9139c2SMartin Blumenstingl	dr_mode = "host";
2890449b8e3SNeil Armstrong};
290