Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (c) 2018 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
0004  */
0005 
0006 /dts-v1/;
0007 
0008 #include <dt-bindings/gpio/gpio.h>
0009 #include <dt-bindings/input/input.h>
0010 
0011 #include "meson8b.dtsi"
0012 
0013 / {
0014         model = "Endless Computers Endless Mini";
0015         compatible = "endless,ec100", "amlogic,meson8b";
0016 
0017         aliases {
0018                 serial0 = &uart_AO;
0019         };
0020 
0021         chosen {
0022                 stdout-path = "serial0:115200n8";
0023         };
0024 
0025         memory {
0026                 device_type = "memory";
0027                 reg = <0x40000000 0x40000000>;
0028         };
0029 
0030         emmc_pwrseq: emmc-pwrseq {
0031                 compatible = "mmc-pwrseq-emmc";
0032                 reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
0033         };
0034 
0035         gpio-keys {
0036                 compatible = "gpio-keys-polled";
0037                 #address-cells = <1>;
0038                 #size-cells = <0>;
0039                 poll-interval = <100>;
0040 
0041                 pal-switch {
0042                         label = "pal";
0043                         linux,input-type = <EV_SW>;
0044                         linux,code = <KEY_SWITCHVIDEOMODE>;
0045                         gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
0046                 };
0047 
0048                 ntsc-switch {
0049                         label = "ntsc";
0050                         linux,input-type = <EV_SW>;
0051                         linux,code = <KEY_SWITCHVIDEOMODE>;
0052                         gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
0053                 };
0054 
0055                 power-button {
0056                         label = "power";
0057                         linux,code = <KEY_POWER>;
0058                         gpios = <&gpio GPIOH_9 GPIO_ACTIVE_LOW>;
0059                 };
0060         };
0061 
0062         gpio-poweroff {
0063                 compatible = "gpio-poweroff";
0064                 /*
0065                  * shutdown is managed by the EC (embedded micro-controller)
0066                  * which is configured through GPIOAO_2 (poweroff GPIO) and
0067                  * GPIOAO_7 (power LED, which has to go LOW as well).
0068                  */
0069                 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
0070                 timeout-ms = <20000>;
0071         };
0072 
0073         leds {
0074                 compatible = "gpio-leds";
0075 
0076                 power {
0077                         label = "ec100:red:power";
0078                         /*
0079                          * Needs to go LOW (together with the poweroff GPIO)
0080                          * during shutdown to allow the EC (embedded
0081                          * micro-controller) to shutdown the system. Setting
0082                          * the output to LOW signals the EC to start a
0083                          * "breathing"/pulsing effect until the power is fully
0084                          * turned off.
0085                          */
0086                         gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
0087                         default-state = "on";
0088                 };
0089         };
0090 
0091         rtc32k_xtal: rtc32k-xtal-clk {
0092                 /* X2 in the schematics */
0093                 compatible = "fixed-clock";
0094                 clock-frequency = <32768>;
0095                 clock-output-names = "RTC32K";
0096                 #clock-cells = <0>;
0097         };
0098 
0099         sound {
0100                 compatible = "amlogic,gx-sound-card";
0101                 model = "M8B-EC100";
0102 
0103                 assigned-clocks = <&clkc CLKID_MPLL0>,
0104                                   <&clkc CLKID_MPLL1>,
0105                                   <&clkc CLKID_MPLL2>;
0106                 assigned-clock-rates = <270950400>,
0107                                        <294912000>,
0108                                        <393216000>;
0109 
0110                 dai-link-0 {
0111                         sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
0112                 };
0113 
0114                 dai-link-1 {
0115                         sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
0116                         dai-format = "i2s";
0117                         mclk-fs = <256>;
0118 
0119                         codec-0 {
0120                                 sound-dai = <&rt5640>;
0121                         };
0122                 };
0123         };
0124 
0125         usb_vbus: regulator-usb-vbus {
0126                 /*
0127                  * Silergy SY6288CCAC-GP 2A Power Distribution Switch.
0128                  */
0129                 compatible = "regulator-fixed";
0130 
0131                 regulator-name = "USB_VBUS";
0132 
0133                 regulator-min-microvolt = <5000000>;
0134                 regulator-max-microvolt = <5000000>;
0135 
0136                 vin-supply = <&vcc_5v>;
0137 
0138                 /*
0139                  * signal name from the schematics: USB_PWR_EN
0140                  */
0141                 gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
0142                 enable-active-high;
0143         };
0144 
0145         vcc_5v: regulator-vcc5v {
0146                 /*
0147                  * supplied by the main power input which called PWR_5V_STB
0148                  * in the schematics
0149                  */
0150                 compatible = "regulator-fixed";
0151 
0152                 regulator-name = "VCC5V";
0153 
0154                 regulator-min-microvolt = <5000000>;
0155                 regulator-max-microvolt = <5000000>;
0156 
0157                 /*
0158                  * signal name from the schematics: 3V3_5V_EN
0159                  */
0160                 gpio = <&gpio GPIODV_29 GPIO_ACTIVE_LOW>;
0161 
0162                 regulator-boot-on;
0163                 regulator-always-on;
0164         };
0165 
0166         vcck: regulator-vcck {
0167                 /*
0168                  * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
0169                  * Synchronous Step Down Regulator.
0170                  */
0171                 compatible = "pwm-regulator";
0172 
0173                 regulator-name = "VCCK";
0174                 regulator-min-microvolt = <860000>;
0175                 regulator-max-microvolt = <1140000>;
0176 
0177                 pwm-supply = <&vcc_5v>;
0178 
0179                 pwms = <&pwm_cd 0 1148 0>;
0180                 pwm-dutycycle-range = <100 0>;
0181 
0182                 regulator-boot-on;
0183                 regulator-always-on;
0184         };
0185 
0186         vcc_1v8: regulator-vcc1v8 {
0187                 /*
0188                  * ABLIC S-1339D18-M5001-GP
0189                  */
0190                 compatible = "regulator-fixed";
0191 
0192                 regulator-name = "VCC1V8";
0193                 regulator-min-microvolt = <1800000>;
0194                 regulator-max-microvolt = <1800000>;
0195 
0196                 vin-supply = <&vcc_3v3>;
0197         };
0198 
0199         vcc_3v3: regulator-vcc3v3 {
0200                 /*
0201                  * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
0202                  * Synchronous Step Down Regulator. Also called
0203                  * VDDIO_AO3.3V in the schematics.
0204                  */
0205                 compatible = "regulator-fixed";
0206 
0207                 regulator-name = "VCC3V3";
0208                 regulator-min-microvolt = <3300000>;
0209                 regulator-max-microvolt = <3300000>;
0210 
0211                 vin-supply = <&vcc_5v>;
0212         };
0213 
0214         vcc_ddr3: regulator-vcc-ddr3 {
0215                 /*
0216                  * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
0217                  * Synchronous Step Down Regulator. Also called
0218                  * DDR3_1.5V in the schematics.
0219                  */
0220                 compatible = "regulator-fixed";
0221 
0222                 regulator-name = "VCC_DDR3_1V5";
0223                 regulator-min-microvolt = <1500000>;
0224                 regulator-max-microvolt = <1500000>;
0225 
0226                 vin-supply = <&vcc_5v>;
0227 
0228                 regulator-boot-on;
0229                 regulator-always-on;
0230         };
0231 
0232         vcc_rtc: regulator-vcc-rtc {
0233                 /*
0234                  * Global Mixed-mode Technology Inc. G918T12U-GP
0235                  */
0236                 compatible = "regulator-fixed";
0237 
0238                 regulator-name = "VCC_RTC";
0239                 regulator-min-microvolt = <900000>;
0240                 regulator-max-microvolt = <900000>;
0241 
0242                 /*
0243                  * When the board is powered then the input is VCC3V3,
0244                  * otherwise power is taken from the coin cell battery.
0245                  */
0246                 vin-supply = <&vcc_3v3>;
0247         };
0248 
0249         vddee: regulator-vddee {
0250                 /*
0251                  * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
0252                  * Synchronous Step Down Regulator. Also called VDDAO
0253                  * in a part of the schematics.
0254                  */
0255                 compatible = "pwm-regulator";
0256 
0257                 regulator-name = "VDDEE";
0258                 regulator-min-microvolt = <860000>;
0259                 regulator-max-microvolt = <1140000>;
0260 
0261                 pwm-supply = <&vcc_5v>;
0262 
0263                 pwms = <&pwm_cd 1 1148 0>;
0264                 pwm-dutycycle-range = <100 0>;
0265 
0266                 regulator-boot-on;
0267                 regulator-always-on;
0268         };
0269 };
0270 
0271 &aiu {
0272         status = "okay";
0273 
0274         pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
0275                     <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
0276         pinctrl-names = "default";
0277 };
0278 
0279 &cpu0 {
0280         cpu-supply = <&vcck>;
0281 };
0282 
0283 &ethmac {
0284         status = "okay";
0285 
0286         pinctrl-0 = <&eth_rmii_pins>;
0287         pinctrl-names = "default";
0288 
0289         phy-handle = <&eth_phy0>;
0290         phy-mode = "rmii";
0291 
0292         mdio {
0293                 compatible = "snps,dwmac-mdio";
0294                 #address-cells = <1>;
0295                 #size-cells = <0>;
0296 
0297                 eth_phy0: ethernet-phy@0 {
0298                         /* IC Plus IP101A/G (0x02430c54) */
0299                         reg = <0>;
0300 
0301                         reset-assert-us = <10000>;
0302                         reset-deassert-us = <10000>;
0303                         reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
0304 
0305                         icplus,select-interrupt;
0306                         interrupt-parent = <&gpio_intc>;
0307                         /* GPIOH_3 */
0308                         interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
0309                 };
0310         };
0311 };
0312 
0313 &i2c_A {
0314         status = "okay";
0315         pinctrl-0 = <&i2c_a_pins>;
0316         pinctrl-names = "default";
0317 
0318         rt5640: codec@1c {
0319                 compatible = "realtek,rt5640";
0320 
0321                 reg = <0x1c>;
0322 
0323                 #sound-dai-cells = <0>;
0324 
0325                 interrupt-parent = <&gpio_intc>;
0326                 interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
0327 
0328                 /*
0329                  * TODO: realtek,ldo1-en-gpios is connected to GPIO_BSD_EN.
0330                  * We currently cannot configure this pin correctly.
0331                  * Luckily for us it's in the "right" state by default.
0332                  */
0333                 realtek,in1-differential;
0334         };
0335 };
0336 
0337 &mali {
0338         mali-supply = <&vddee>;
0339 };
0340 
0341 &saradc {
0342         status = "okay";
0343         vref-supply = <&vcc_1v8>;
0344 };
0345 
0346 &sdhc {
0347         status = "okay";
0348 
0349         pinctrl-0 = <&sdxc_c_pins>;
0350         pinctrl-names = "default";
0351 
0352         bus-width = <8>;
0353         max-frequency = <50000000>;
0354 
0355         cap-mmc-highspeed;
0356         disable-wp;
0357         non-removable;
0358         no-sdio;
0359 
0360         mmc-pwrseq = <&emmc_pwrseq>;
0361 
0362         vmmc-supply = <&vcc_3v3>;
0363         vqmmc-supply = <&vcc_3v3>;
0364 };
0365 
0366 &sdio {
0367         status = "okay";
0368 
0369         pinctrl-0 = <&sd_b_pins>;
0370         pinctrl-names = "default";
0371 
0372         /* SD card */
0373         sd_card_slot: slot@1 {
0374                 compatible = "mmc-slot";
0375                 reg = <1>;
0376                 status = "okay";
0377 
0378                 bus-width = <4>;
0379                 no-sdio;
0380                 cap-mmc-highspeed;
0381                 cap-sd-highspeed;
0382                 disable-wp;
0383 
0384                 cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
0385 
0386                 vmmc-supply = <&vcc_3v3>;
0387         };
0388 };
0389 
0390 &gpio_ao {
0391         gpio-line-names = "Linux_TX", "Linux_RX",
0392                           "SLP_S5_N", "USB2_OC_FLAG#",
0393                           "HUB_RST", "USB_PWR_EN",
0394                           "I2S_IN", "SLP_S1_N",
0395                           "TCK", "TMS", "TDI", "TDO",
0396                           "HDMI_CEC", "5640_IRQ",
0397                           "MUTE", "S805_TEST#";
0398 };
0399 
0400 &gpio {
0401         gpio-line-names = /* Bank GPIOX */
0402                           "WIFI_SD_D0", "WIFI_SD_D1", "WIFI_SD_D2",
0403                           "WIFI_SD_D3", "BTPCM_DOUT", "BTPCM_DIN",
0404                           "BTPCM_SYNC", "BTPCM_CLK", "WIFI_SD_CLK",
0405                           "WIFI_SD_CMD", "WIFI_32K", "WIFI_PWREN",
0406                           "UART_B_TX", "UART_B_RX", "UART_B_CTS_N",
0407                           "UART_B_RTS_N", "BT_EN", "WIFI_WAKE_HOST",
0408                           /* Bank GPIOY */
0409                           "", "", "", "", "", "", "", "", "", "",
0410                           "", "",
0411                           /* Bank GPIODV */
0412                           "VCCK_PWM_C", "I2C_SDA_A", "I2C_SCL_A",
0413                           "I2C_SDA_B", "I2C_SCL_B", "VDDEE_PWM_D",
0414                           "VDDEE_PWM 3V3_5V_EN",
0415                           /* Bank GPIOH */
0416                           "HDMI_HPD", "HDMI_I2C_SDA", "HDMI_I2C_SCL",
0417                           "RMII_IRQ", "RMII_RST#", "RMII_TXD1",
0418                           "RMII_TXD0", "AV_select_1", "AV_select_2",
0419                           "MCU_Control_S",
0420                           /* Bank CARD */
0421                           "SD_D1_B", "SD_D0_B", "SD_CLK_8726MX",
0422                           "SD_CMD_8726MX", "SD_D3_B", "SD_D2_B",
0423                           "CARD_EN_DET (CARD_DET)",
0424                           /* Bank BOOT */
0425                           "NAND_D0 (EMMC)", "NAND_D1 (EMMC)",
0426                           "NAND_D2 (EMMC)", "NAND_D3 (EMMC)",
0427                           "NAND_D4 (EMMC)", "NAND_D5 (EMMC)",
0428                           "NAND_D6 (EMMC)", "NAND_D7 (EMMC)",
0429                           "NAND_CS1 (EMMC)", "NAND_CS2 iNAND_RS1 (EMMC)",
0430                           "NAND_nR/B iNAND_CMD (EMMC)", "NAND_ALE (EMMC)",
0431                           "NAND_CLE (EMMC)", "nRE_S1 NAND_nRE (EMMC)",
0432                           "nWE_S1 NAND_nWE (EMMC)",  "", "", "SPI_CS",
0433                           /* Bank DIF */
0434                           "RMII_RXD1", "RMII_RXD0", "RMII_CRS_DV",
0435                           "RMII_50M_IN", "GPIODIF_4", "GPIODIF_5",
0436                           "RMII_TXEN", "CPUETH_25MOUT", "RMII_MDC",
0437                           "RMII_MDIO";
0438 };
0439 
0440 &pwm_cd {
0441         status = "okay";
0442         pinctrl-0 = <&pwm_c1_pins>, <&pwm_d_pins>;
0443         pinctrl-names = "default";
0444         clocks = <&xtal>, <&xtal>;
0445         clock-names = "clkin0", "clkin1";
0446 };
0447 
0448 &rtc {
0449         status = "okay";
0450         clocks = <&rtc32k_xtal>;
0451         vdd-supply = <&vcc_rtc>;
0452 };
0453 
0454 /* exposed through the pin headers labeled "URDUG1" on the top of the PCB */
0455 &uart_AO {
0456         status = "okay";
0457         pinctrl-0 = <&uart_ao_a_pins>;
0458         pinctrl-names = "default";
0459 };
0460 
0461 /*
0462  * connected to the Bluetooth part of the RTL8723BS SDIO wifi / Bluetooth
0463  * combo chip. This is only available on the variant with 2GB RAM.
0464  */
0465 &uart_B {
0466         status = "okay";
0467         pinctrl-0 = <&uart_b0_pins>, <&uart_b0_cts_rts_pins>;
0468         pinctrl-names = "default";
0469         uart-has-rtscts;
0470 };
0471 
0472 &usb1 {
0473         status = "okay";
0474         vbus-supply = <&usb_vbus>;
0475 };
0476 
0477 &usb1_phy {
0478         status = "okay";
0479 };