Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (c) 2016 Endless Computers, Inc.
0004  * Author: Carlo Caione <carlo@endlessm.com>
0005  */
0006 
0007 /* Common DTSI for same Amlogic Q200/Q201 and P230/P231 boards using either
0008  * the pin-compatible S912 (GXM) or S905D (GXL) SoCs.
0009  */
0010 
0011 #include <dt-bindings/sound/meson-aiu.h>
0012 
0013 / {
0014         aliases {
0015                 serial0 = &uart_AO;
0016                 ethernet0 = &ethmac;
0017         };
0018 
0019         dio2133: analog-amplifier {
0020                 compatible = "simple-audio-amplifier";
0021                 sound-name-prefix = "AU2";
0022                 VCC-supply = <&hdmi_5v>;
0023                 enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
0024         };
0025 
0026         spdif_dit: audio-codec-0 {
0027                 #sound-dai-cells = <0>;
0028                 compatible = "linux,spdif-dit";
0029                 status = "okay";
0030                 sound-name-prefix = "DIT";
0031         };
0032 
0033         chosen {
0034                 stdout-path = "serial0:115200n8";
0035         };
0036 
0037         memory@0 {
0038                 device_type = "memory";
0039                 reg = <0x0 0x0 0x0 0x80000000>;
0040         };
0041 
0042         hdmi_5v: regulator-hdmi-5v {
0043                 compatible = "regulator-fixed";
0044 
0045                 regulator-name = "HDMI_5V";
0046                 regulator-min-microvolt = <5000000>;
0047                 regulator-max-microvolt = <5000000>;
0048 
0049                 gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
0050                 enable-active-high;
0051                 regulator-always-on;
0052         };
0053 
0054         vddio_ao18: regulator-vddio_ao18 {
0055                 compatible = "regulator-fixed";
0056                 regulator-name = "VDDIO_AO18";
0057                 regulator-min-microvolt = <1800000>;
0058                 regulator-max-microvolt = <1800000>;
0059         };
0060 
0061         vddio_boot: regulator-vddio_boot {
0062                 compatible = "regulator-fixed";
0063                 regulator-name = "VDDIO_BOOT";
0064                 regulator-min-microvolt = <1800000>;
0065                 regulator-max-microvolt = <1800000>;
0066         };
0067 
0068         vddao_3v3: regulator-vddao_3v3 {
0069                 compatible = "regulator-fixed";
0070                 regulator-name = "VDDAO_3V3";
0071                 regulator-min-microvolt = <3300000>;
0072                 regulator-max-microvolt = <3300000>;
0073         };
0074 
0075         vcc_3v3: regulator-vcc_3v3 {
0076                 compatible = "regulator-fixed";
0077                 regulator-name = "VCC_3V3";
0078                 regulator-min-microvolt = <3300000>;
0079                 regulator-max-microvolt = <3300000>;
0080         };
0081 
0082         emmc_pwrseq: emmc-pwrseq {
0083                 compatible = "mmc-pwrseq-emmc";
0084                 reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
0085         };
0086 
0087         wifi32k: wifi32k {
0088                 compatible = "pwm-clock";
0089                 #clock-cells = <0>;
0090                 clock-frequency = <32768>;
0091                 pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
0092         };
0093 
0094         sdio_pwrseq: sdio-pwrseq {
0095                 compatible = "mmc-pwrseq-simple";
0096                 reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
0097                 clocks = <&wifi32k>;
0098                 clock-names = "ext_clock";
0099         };
0100 
0101         cvbs-connector {
0102                 compatible = "composite-video-connector";
0103 
0104                 port {
0105                         cvbs_connector_in: endpoint {
0106                                 remote-endpoint = <&cvbs_vdac_out>;
0107                         };
0108                 };
0109         };
0110 
0111         hdmi-connector {
0112                 compatible = "hdmi-connector";
0113                 type = "a";
0114 
0115                 port {
0116                         hdmi_connector_in: endpoint {
0117                                 remote-endpoint = <&hdmi_tx_tmds_out>;
0118                         };
0119                 };
0120         };
0121 
0122         sound {
0123                 compatible = "amlogic,gx-sound-card";
0124                 model = "P230-Q200";
0125                 audio-aux-devs = <&dio2133>;
0126                 audio-widgets = "Line", "Lineout";
0127                 audio-routing = "AU2 INL", "ACODEC LOLP",
0128                                 "AU2 INR", "ACODEC LORP",
0129                                 "AU2 INL", "ACODEC LOLN",
0130                                 "AU2 INR", "ACODEC LORN",
0131                                 "Lineout", "AU2 OUTL",
0132                                 "Lineout", "AU2 OUTR";
0133                 assigned-clocks = <&clkc CLKID_MPLL0>,
0134                                   <&clkc CLKID_MPLL1>,
0135                                   <&clkc CLKID_MPLL2>;
0136                 assigned-clock-parents = <0>, <0>, <0>;
0137                 assigned-clock-rates = <294912000>,
0138                                        <270950400>,
0139                                        <393216000>;
0140                 status = "okay";
0141 
0142                 dai-link-0 {
0143                         sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
0144                 };
0145 
0146                 dai-link-1 {
0147                         sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>;
0148                 };
0149 
0150                 dai-link-2 {
0151                         sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
0152                         dai-format = "i2s";
0153                         mclk-fs = <256>;
0154 
0155                         codec-0 {
0156                                 sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
0157                         };
0158 
0159                         codec-1 {
0160                                 sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
0161                         };
0162                 };
0163 
0164                 dai-link-3 {
0165                         sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>;
0166 
0167                         codec-0 {
0168                                 sound-dai = <&spdif_dit>;
0169                         };
0170                 };
0171 
0172                 dai-link-4 {
0173                         sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
0174 
0175                         codec-0 {
0176                                 sound-dai = <&hdmi_tx>;
0177                         };
0178                 };
0179 
0180                 dai-link-5 {
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         pinctrl-0 = <&spdif_out_h_pins>;
0198         pinctrl-names = "default";
0199 
0200 };
0201 
0202 &cec_AO {
0203         status = "okay";
0204         pinctrl-0 = <&ao_cec_pins>;
0205         pinctrl-names = "default";
0206         hdmi-phandle = <&hdmi_tx>;
0207 };
0208 
0209 &cvbs_vdac_port {
0210         cvbs_vdac_out: endpoint {
0211                 remote-endpoint = <&cvbs_connector_in>;
0212         };
0213 };
0214 
0215 &ethmac {
0216         status = "okay";
0217 };
0218 
0219 &hdmi_tx {
0220         status = "okay";
0221         pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
0222         pinctrl-names = "default";
0223         hdmi-supply = <&hdmi_5v>;
0224 };
0225 
0226 &hdmi_tx_tmds_port {
0227         hdmi_tx_tmds_out: endpoint {
0228                 remote-endpoint = <&hdmi_connector_in>;
0229         };
0230 };
0231 
0232 &ir {
0233         status = "okay";
0234         pinctrl-0 = <&remote_input_ao_pins>;
0235         pinctrl-names = "default";
0236 };
0237 
0238 &pwm_ef {
0239         status = "okay";
0240         pinctrl-0 = <&pwm_e_pins>;
0241         pinctrl-names = "default";
0242         clocks = <&clkc CLKID_FCLK_DIV4>;
0243         clock-names = "clkin0";
0244 };
0245 
0246 &saradc {
0247         status = "okay";
0248         vref-supply = <&vddio_ao18>;
0249 };
0250 
0251 /* Wireless SDIO Module */
0252 &sd_emmc_a {
0253         status = "okay";
0254         pinctrl-0 = <&sdio_pins>;
0255         pinctrl-1 = <&sdio_clk_gate_pins>;
0256         pinctrl-names = "default", "clk-gate";
0257         #address-cells = <1>;
0258         #size-cells = <0>;
0259 
0260         bus-width = <4>;
0261         cap-sd-highspeed;
0262         max-frequency = <50000000>;
0263 
0264         non-removable;
0265         disable-wp;
0266 
0267         /* WiFi firmware requires power to be kept while in suspend */
0268         keep-power-in-suspend;
0269 
0270         mmc-pwrseq = <&sdio_pwrseq>;
0271 
0272         vmmc-supply = <&vddao_3v3>;
0273         vqmmc-supply = <&vddio_boot>;
0274 };
0275 
0276 /* SD card */
0277 &sd_emmc_b {
0278         status = "okay";
0279         pinctrl-0 = <&sdcard_pins>;
0280         pinctrl-1 = <&sdcard_clk_gate_pins>;
0281         pinctrl-names = "default", "clk-gate";
0282 
0283         bus-width = <4>;
0284         cap-sd-highspeed;
0285         max-frequency = <50000000>;
0286         disable-wp;
0287 
0288         cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
0289 
0290         vmmc-supply = <&vddao_3v3>;
0291         vqmmc-supply = <&vddio_boot>;
0292 };
0293 
0294 /* eMMC */
0295 &sd_emmc_c {
0296         status = "okay";
0297         pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
0298         pinctrl-1 = <&emmc_clk_gate_pins>;
0299         pinctrl-names = "default", "clk-gate";
0300 
0301         bus-width = <8>;
0302         cap-mmc-highspeed;
0303         max-frequency = <200000000>;
0304         non-removable;
0305         disable-wp;
0306         mmc-ddr-1_8v;
0307         mmc-hs200-1_8v;
0308 
0309         mmc-pwrseq = <&emmc_pwrseq>;
0310         vmmc-supply = <&vcc_3v3>;
0311         vqmmc-supply = <&vddio_boot>;
0312 };
0313 
0314 /* This UART is brought out to the DB9 connector */
0315 &uart_AO {
0316         status = "okay";
0317         pinctrl-0 = <&uart_ao_a_pins>;
0318         pinctrl-names = "default";
0319 };
0320 
0321 &usb {
0322         status = "okay";
0323         dr_mode = "otg";
0324 };