0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Copyright (c) 2017 BayLibre, SAS.
0004 * Author: Neil Armstrong <narmstrong@baylibre.com>
0005 * Author: Jerome Brunet <jbrunet@baylibre.com>
0006 */
0007
0008 /dts-v1/;
0009
0010 #include <dt-bindings/input/input.h>
0011 #include <dt-bindings/sound/meson-aiu.h>
0012
0013 #include "meson-gxl-s905x.dtsi"
0014
0015 / {
0016 compatible = "libretech,aml-s905x-cc", "amlogic,s905x",
0017 "amlogic,meson-gxl";
0018 model = "Libre Computer AML-S905X-CC";
0019
0020 aliases {
0021 serial0 = &uart_AO;
0022 ethernet0 = ðmac;
0023 };
0024
0025 dio2133: analog-amplifier {
0026 compatible = "simple-audio-amplifier";
0027 sound-name-prefix = "AU2";
0028 VCC-supply = <&hdmi_5v>;
0029 enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
0030 };
0031
0032 chosen {
0033 stdout-path = "serial0:115200n8";
0034 };
0035
0036 cvbs-connector {
0037 compatible = "composite-video-connector";
0038
0039 port {
0040 cvbs_connector_in: endpoint {
0041 remote-endpoint = <&cvbs_vdac_out>;
0042 };
0043 };
0044 };
0045
0046 emmc_pwrseq: emmc-pwrseq {
0047 compatible = "mmc-pwrseq-emmc";
0048 reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
0049 };
0050
0051 hdmi-connector {
0052 compatible = "hdmi-connector";
0053 type = "a";
0054
0055 port {
0056 hdmi_connector_in: endpoint {
0057 remote-endpoint = <&hdmi_tx_tmds_out>;
0058 };
0059 };
0060 };
0061
0062 leds {
0063 compatible = "gpio-leds";
0064
0065 led-system {
0066 label = "librecomputer:system-status";
0067 gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
0068 default-state = "on";
0069 panic-indicator;
0070 };
0071
0072 led-blue {
0073 label = "librecomputer:blue";
0074 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
0075 linux,default-trigger = "heartbeat";
0076 };
0077 };
0078
0079 memory@0 {
0080 device_type = "memory";
0081 reg = <0x0 0x0 0x0 0x80000000>;
0082 };
0083
0084 hdmi_5v: regulator-hdmi-5v {
0085 compatible = "regulator-fixed";
0086
0087 regulator-name = "HDMI_5V";
0088 regulator-min-microvolt = <5000000>;
0089 regulator-max-microvolt = <5000000>;
0090
0091 gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
0092 enable-active-high;
0093 regulator-always-on;
0094 };
0095
0096 vcc_3v3: regulator-vcc_3v3 {
0097 compatible = "regulator-fixed";
0098 regulator-name = "VCC_3V3";
0099 regulator-min-microvolt = <3300000>;
0100 regulator-max-microvolt = <3300000>;
0101 };
0102
0103 vcc_card: regulator-vcc-card {
0104 compatible = "regulator-gpio";
0105
0106 regulator-name = "VCC_CARD";
0107 regulator-min-microvolt = <1800000>;
0108 regulator-max-microvolt = <3300000>;
0109
0110 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
0111 gpios-states = <0>;
0112
0113 states = <3300000 0>,
0114 <1800000 1>;
0115
0116 regulator-settling-time-up-us = <200>;
0117 regulator-settling-time-down-us = <50000>;
0118 };
0119
0120 vddio_ao18: regulator-vddio_ao18 {
0121 compatible = "regulator-fixed";
0122 regulator-name = "VDDIO_AO18";
0123 regulator-min-microvolt = <1800000>;
0124 regulator-max-microvolt = <1800000>;
0125 };
0126
0127 /* This is provided by LDOs on the eMMC daugther card */
0128 vddio_boot: regulator-vddio_boot {
0129 compatible = "regulator-fixed";
0130 regulator-name = "VDDIO_BOOT";
0131 regulator-min-microvolt = <1800000>;
0132 regulator-max-microvolt = <1800000>;
0133 vin-supply = <&vcc_3v3>;
0134 };
0135
0136 sound {
0137 compatible = "amlogic,gx-sound-card";
0138 model = "LIBRETECH-CC";
0139 audio-aux-devs = <&dio2133>;
0140 audio-widgets = "Line", "Lineout";
0141 audio-routing = "AU2 INL", "ACODEC LOLN",
0142 "AU2 INR", "ACODEC LORN",
0143 "Lineout", "AU2 OUTL",
0144 "Lineout", "AU2 OUTR";
0145 assigned-clocks = <&clkc CLKID_MPLL0>,
0146 <&clkc CLKID_MPLL1>,
0147 <&clkc CLKID_MPLL2>;
0148 assigned-clock-parents = <0>, <0>, <0>;
0149 assigned-clock-rates = <294912000>,
0150 <270950400>,
0151 <393216000>;
0152 status = "okay";
0153
0154 dai-link-0 {
0155 sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
0156 };
0157
0158 dai-link-1 {
0159 sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
0160 dai-format = "i2s";
0161 mclk-fs = <256>;
0162
0163 codec-0 {
0164 sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
0165 };
0166
0167 codec-1 {
0168 sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
0169 };
0170 };
0171
0172 dai-link-2 {
0173 sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
0174
0175 codec-0 {
0176 sound-dai = <&hdmi_tx>;
0177 };
0178 };
0179
0180 dai-link-3 {
0181 sound-dai = <&aiu AIU_ACODEC CTRL_OUT>;
0182
0183 codec-0 {
0184 sound-dai = <&acodec>;
0185 };
0186 };
0187 };
0188 };
0189
0190 &acodec {
0191 AVDD-supply = <&vddio_ao18>;
0192 status = "okay";
0193 };
0194
0195 &aiu {
0196 status = "okay";
0197 };
0198
0199 &cec_AO {
0200 status = "okay";
0201 pinctrl-0 = <&ao_cec_pins>;
0202 pinctrl-names = "default";
0203 hdmi-phandle = <&hdmi_tx>;
0204 };
0205
0206 &cvbs_vdac_port {
0207 cvbs_vdac_out: endpoint {
0208 remote-endpoint = <&cvbs_connector_in>;
0209 };
0210 };
0211
0212 ðmac {
0213 status = "okay";
0214 };
0215
0216 &internal_phy {
0217 pinctrl-0 = <ð_link_led_pins>, <ð_act_led_pins>;
0218 pinctrl-names = "default";
0219 };
0220
0221 &ir {
0222 status = "okay";
0223 pinctrl-0 = <&remote_input_ao_pins>;
0224 pinctrl-names = "default";
0225 };
0226
0227 &hdmi_tx {
0228 status = "okay";
0229 pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
0230 pinctrl-names = "default";
0231 hdmi-supply = <&hdmi_5v>;
0232 };
0233
0234 &hdmi_tx_tmds_port {
0235 hdmi_tx_tmds_out: endpoint {
0236 remote-endpoint = <&hdmi_connector_in>;
0237 };
0238 };
0239
0240 &gpio_ao {
0241 gpio-line-names = "UART TX",
0242 "UART RX",
0243 "Blue LED",
0244 "SDCard Voltage Switch",
0245 "7J1 Header Pin5",
0246 "7J1 Header Pin3",
0247 "7J1 Header Pin12",
0248 "IR In",
0249 "9J3 Switch HDMI CEC/7J1 Header Pin11",
0250 "7J1 Header Pin13",
0251 /* GPIO_TEST_N */
0252 "7J1 Header Pin15";
0253 };
0254
0255 &gpio {
0256 gpio-line-names = /* Bank GPIOZ */
0257 "", "", "", "", "", "", "",
0258 "", "", "", "", "", "", "",
0259 "Eth Link LED", "Eth Activity LED",
0260 /* Bank GPIOH */
0261 "HDMI HPD", "HDMI SDA", "HDMI SCL",
0262 "HDMI_5V_EN", "9J1 Header Pin2",
0263 "Analog Audio Mute",
0264 "2J3 Header Pin6",
0265 "2J3 Header Pin5",
0266 "2J3 Header Pin4",
0267 "2J3 Header Pin3",
0268 /* Bank BOOT */
0269 "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3",
0270 "eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7",
0271 "eMMC Clk", "eMMC Reset", "eMMC CMD",
0272 "ALT BOOT MODE", "", "", "", "eMMC Data Strobe",
0273 /* Bank CARD */
0274 "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD",
0275 "SDCard D3", "SDCard D2", "SDCard Det",
0276 /* Bank GPIODV */
0277 "", "", "", "", "", "", "", "", "", "", "", "",
0278 "", "", "", "", "", "", "", "", "", "", "", "",
0279 "Green LED", "VCCK Enable",
0280 "7J1 Header Pin27", "7J1 Header Pin28",
0281 "VCCK Regulator", "VDDEE Regulator",
0282 /* Bank GPIOX */
0283 "7J1 Header Pin22", "7J1 Header Pin26",
0284 "7J1 Header Pin36", "7J1 Header Pin38",
0285 "7J1 Header Pin40", "7J1 Header Pin37",
0286 "7J1 Header Pin33", "7J1 Header Pin35",
0287 "7J1 Header Pin19", "7J1 Header Pin21",
0288 "7J1 Header Pin24", "7J1 Header Pin23",
0289 "7J1 Header Pin8", "7J1 Header Pin10",
0290 "7J1 Header Pin16", "7J1 Header Pin18",
0291 "7J1 Header Pin32", "7J1 Header Pin29",
0292 "7J1 Header Pin31",
0293 /* Bank GPIOCLK */
0294 "7J1 Header Pin7", "";
0295 };
0296
0297 &saradc {
0298 status = "okay";
0299 vref-supply = <&vddio_ao18>;
0300 };
0301
0302 /* SD card */
0303 &sd_emmc_b {
0304 status = "okay";
0305 pinctrl-0 = <&sdcard_pins>;
0306 pinctrl-1 = <&sdcard_clk_gate_pins>;
0307 pinctrl-names = "default", "clk-gate";
0308
0309 bus-width = <4>;
0310 cap-sd-highspeed;
0311 max-frequency = <50000000>;
0312 disable-wp;
0313
0314 cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
0315
0316 vmmc-supply = <&vcc_3v3>;
0317 vqmmc-supply = <&vcc_card>;
0318 };
0319
0320 /* eMMC */
0321 &sd_emmc_c {
0322 status = "okay";
0323 pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
0324 pinctrl-1 = <&emmc_clk_gate_pins>;
0325 pinctrl-names = "default", "clk-gate";
0326
0327 bus-width = <8>;
0328 cap-mmc-highspeed;
0329 mmc-ddr-1_8v;
0330 mmc-hs200-1_8v;
0331 max-frequency = <200000000>;
0332 disable-wp;
0333
0334 mmc-pwrseq = <&emmc_pwrseq>;
0335 vmmc-supply = <&vcc_3v3>;
0336 vqmmc-supply = <&vddio_boot>;
0337 };
0338
0339 &uart_AO {
0340 status = "okay";
0341 pinctrl-0 = <&uart_ao_a_pins>;
0342 pinctrl-names = "default";
0343 };
0344
0345 &usb {
0346 status = "okay";
0347 dr_mode = "host";
0348 };
0349
0350 &usb2_phy0 {
0351 /*
0352 * even though the schematics don't show it:
0353 * HDMI_5V is also used as supply for the USB VBUS.
0354 */
0355 phy-supply = <&hdmi_5v>;
0356 };