Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
0004  */
0005 
0006 /dts-v1/;
0007 
0008 #include "meson-gxl-s905x-p212.dtsi"
0009 #include <dt-bindings/input/input.h>
0010 #include <dt-bindings/sound/meson-aiu.h>
0011 
0012 / {
0013         compatible = "khadas,vim", "amlogic,s905x", "amlogic,meson-gxl";
0014         model = "Khadas VIM";
0015 
0016         adc-keys {
0017                 compatible = "adc-keys";
0018                 io-channels = <&saradc 0>;
0019                 io-channel-names = "buttons";
0020                 keyup-threshold-microvolt = <1710000>;
0021 
0022                 button-function {
0023                         label = "Function";
0024                         linux,code = <KEY_FN>;
0025                         press-threshold-microvolt = <10000>;
0026                 };
0027         };
0028 
0029         aliases {
0030                 serial2 = &uart_AO_B;
0031                 ethernet0 = &ethmac;
0032         };
0033 
0034         gpio-keys-polled {
0035                 compatible = "gpio-keys-polled";
0036                 poll-interval = <100>;
0037 
0038                 power-button {
0039                         label = "power";
0040                         linux,code = <KEY_POWER>;
0041                         gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
0042                 };
0043         };
0044 
0045         led-controller {
0046                 compatible = "pwm-leds";
0047 
0048                 led-1 {
0049                         label = "vim:red:power";
0050                         pwms = <&pwm_AO_ab 1 7812500 0>;
0051                         max-brightness = <255>;
0052                         linux,default-trigger = "default-on";
0053                 };
0054         };
0055 
0056         hdmi-connector {
0057                 compatible = "hdmi-connector";
0058                 type = "a";
0059 
0060                 port {
0061                         hdmi_connector_in: endpoint {
0062                                 remote-endpoint = <&hdmi_tx_tmds_out>;
0063                         };
0064                 };
0065         };
0066 
0067         sound {
0068                 compatible = "amlogic,gx-sound-card";
0069                 model = "KHADAS-VIM";
0070                 assigned-clocks = <&clkc CLKID_MPLL0>,
0071                                   <&clkc CLKID_MPLL1>,
0072                                   <&clkc CLKID_MPLL2>;
0073                 assigned-clock-parents = <0>, <0>, <0>;
0074                 assigned-clock-rates = <294912000>,
0075                                        <270950400>,
0076                                        <393216000>;
0077                 status = "okay";
0078 
0079                 dai-link-0 {
0080                         sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
0081                 };
0082 
0083                 dai-link-1 {
0084                         sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
0085                         dai-format = "i2s";
0086                         mclk-fs = <256>;
0087 
0088                         codec-0 {
0089                                 sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
0090                         };
0091                 };
0092 
0093                 dai-link-2 {
0094                         sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
0095 
0096                         codec-0 {
0097                                 sound-dai = <&hdmi_tx>;
0098                         };
0099                 };
0100         };
0101 };
0102 
0103 &aiu {
0104         status = "okay";
0105 };
0106 
0107 &cec_AO {
0108         status = "okay";
0109         pinctrl-0 = <&ao_cec_pins>;
0110         pinctrl-names = "default";
0111         hdmi-phandle = <&hdmi_tx>;
0112 };
0113 
0114 &hdmi_tx {
0115         status = "okay";
0116         pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
0117         pinctrl-names = "default";
0118         hdmi-supply = <&hdmi_5v>;
0119 };
0120 
0121 &hdmi_tx_tmds_port {
0122         hdmi_tx_tmds_out: endpoint {
0123                 remote-endpoint = <&hdmi_connector_in>;
0124         };
0125 };
0126 
0127 &i2c_A {
0128         status = "okay";
0129         pinctrl-0 = <&i2c_a_pins>;
0130         pinctrl-names = "default";
0131 };
0132 
0133 &i2c_B {
0134         status = "okay";
0135         pinctrl-0 = <&i2c_b_pins>;
0136         pinctrl-names = "default";
0137 
0138         rtc: rtc@51 {
0139                 status = "okay";
0140                 compatible = "haoyu,hym8563";
0141                 reg = <0x51>;
0142                 #clock-cells = <0>;
0143                 clock-frequency = <32768>;
0144                 clock-output-names = "xin32k";
0145         };
0146 };
0147 
0148 &ir {
0149         linux,rc-map-name = "rc-khadas";
0150 };
0151 
0152 &gpio_ao {
0153         gpio-line-names = "UART TX",
0154                           "UART RX",
0155                           "Power Key In",
0156                           "J9 Header Pin35",
0157                           "J9 Header Pin16",
0158                           "J9 Header Pin15",
0159                           "J9 Header Pin33",
0160                           "IR In",
0161                           "HDMI CEC",
0162                           "SYS LED",
0163                           /* GPIO_TEST_N */
0164                           "";
0165 };
0166 
0167 &gpio {
0168         gpio-line-names = /* Bank GPIOZ */
0169                           "", "", "", "", "", "", "",
0170                           "", "", "", "", "", "", "",
0171                           "Power OFF",
0172                           "VCCK Enable",
0173                           /* Bank GPIOH */
0174                           "HDMI HPD", "HDMI SDA", "HDMI SCL",
0175                           "HDMI_5V_EN", "SPDIF",
0176                           "J9 Header Pin37",
0177                           "J9 Header Pin30",
0178                           "J9 Header Pin29",
0179                           "J9 Header Pin32",
0180                           "J9 Header Pin31",
0181                           /* Bank BOOT */
0182                           "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3",
0183                           "eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7",
0184                           "eMMC Clk", "eMMC Reset", "eMMC CMD",
0185                           "", "BOOT_MODE", "", "", "eMMC Data Strobe",
0186                           /* Bank CARD */
0187                           "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD",
0188                           "SDCard D3", "SDCard D2", "SDCard Det",
0189                           /* Bank GPIODV */
0190                           "", "", "", "", "", "", "", "", "", "", "", "",
0191                           "", "", "", "", "", "", "", "", "", "", "", "",
0192                           "I2C A SDA", "I2C A SCK", "I2C B SDA", "I2C B SCK",
0193                           "VCCK Regulator", "VDDEE Regulator",
0194                           /* Bank GPIOX */
0195                           "WIFI SDIO D0", "WIFI SDIO D1", "WIFI SDIO D2",
0196                           "WIFI SDIO D3", "WIFI SDIO CLK", "WIFI SDIO CMD",
0197                           "WIFI Power Enable", "WIFI WAKE HOST",
0198                           "Bluetooth PCM DOUT", "Bluetooth PCM DIN",
0199                           "Bluetooth PCM SYNC", "Bluetooth PCM CLK",
0200                           "Bluetooth UART TX", "Bluetooth UART RX",
0201                           "Bluetooth UART CTS", "Bluetooth UART RTS",
0202                           "WIFI 32K", "Bluetooth Enable",
0203                           "Bluetooth WAKE HOST",
0204                           /* Bank GPIOCLK */
0205                           "", "J9 Header Pin39";
0206 };
0207 
0208 &pwm_AO_ab {
0209         status = "okay";
0210         pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
0211         pinctrl-names = "default";
0212         clocks = <&xtal> , <&xtal>;
0213         clock-names = "clkin0", "clkin1" ;
0214 };
0215 
0216 &pwm_ef {
0217         pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>;
0218 };
0219 
0220 &sd_emmc_a {
0221         max-frequency = <100000000>;
0222 
0223         brcmf: wifi@1 {
0224                 reg = <1>;
0225                 compatible = "brcm,bcm4329-fmac";
0226         };
0227 };
0228 
0229 &uart_A {
0230         bluetooth {
0231                 compatible = "brcm,bcm43438-bt";
0232                 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
0233                 max-speed = <2000000>;
0234                 clocks = <&wifi32k>;
0235                 clock-names = "lpo";
0236         };
0237 };
0238 
0239 /* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */
0240 &uart_AO {
0241         status = "okay";
0242 };
0243 
0244 /* This is brought out on the UART_RX_AO_B (15) and UART_TX_AO_B (16) pins: */
0245 &uart_AO_B {
0246         status = "okay";
0247         pinctrl-0 = <&uart_ao_b_pins>;
0248         pinctrl-names = "default";
0249 };
0250 
0251 &usb {
0252         dr_mode = "peripheral";
0253 };