Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (c) 2020 Dongjin Kim <tobetter@gmail.com>
0004  */
0005 
0006 #include "meson-sm1.dtsi"
0007 #include <dt-bindings/gpio/meson-g12a-gpio.h>
0008 #include <dt-bindings/leds/common.h>
0009 #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
0010 
0011 / {
0012         aliases {
0013                 serial0 = &uart_AO;
0014                 ethernet0 = &ethmac;
0015         };
0016 
0017         chosen {
0018                 stdout-path = "serial0:115200n8";
0019         };
0020 
0021         memory@0 {
0022                 device_type = "memory";
0023                 reg = <0x0 0x0 0x0 0x40000000>;
0024         };
0025 
0026         emmc_pwrseq: emmc-pwrseq {
0027                 compatible = "mmc-pwrseq-emmc";
0028                 reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
0029         };
0030 
0031         tflash_vdd: regulator-tflash_vdd {
0032                 compatible = "regulator-fixed";
0033 
0034                 regulator-name = "TFLASH_VDD";
0035                 regulator-min-microvolt = <3300000>;
0036                 regulator-max-microvolt = <3300000>;
0037 
0038                 gpio = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>;
0039                 enable-active-high;
0040                 regulator-always-on;
0041         };
0042 
0043         tf_io: gpio-regulator-tf_io {
0044                 compatible = "regulator-gpio";
0045 
0046                 regulator-name = "TF_IO";
0047                 regulator-min-microvolt = <1800000>;
0048                 regulator-max-microvolt = <3300000>;
0049                 vin-supply = <&vcc_5v>;
0050 
0051                 enable-gpio = <&gpio_ao GPIOE_2 GPIO_OPEN_DRAIN>;
0052                 enable-active-high;
0053                 regulator-always-on;
0054 
0055                 gpios = <&gpio_ao GPIOAO_6 GPIO_OPEN_SOURCE>;
0056                 gpios-states = <0>;
0057 
0058                 states = <3300000 0>,
0059                          <1800000 1>;
0060         };
0061 
0062         flash_1v8: regulator-flash_1v8 {
0063                 compatible = "regulator-fixed";
0064                 regulator-name = "FLASH_1V8";
0065                 regulator-min-microvolt = <1800000>;
0066                 regulator-max-microvolt = <1800000>;
0067                 vin-supply = <&vcc_3v3>;
0068                 regulator-always-on;
0069         };
0070 
0071         main_12v: regulator-main_12v {
0072                 compatible = "regulator-fixed";
0073                 regulator-name = "12V";
0074                 regulator-min-microvolt = <12000000>;
0075                 regulator-max-microvolt = <12000000>;
0076                 regulator-always-on;
0077         };
0078 
0079         vcc_5v: regulator-vcc_5v {
0080                 compatible = "regulator-fixed";
0081                 regulator-name = "5V";
0082                 regulator-min-microvolt = <5000000>;
0083                 regulator-max-microvolt = <5000000>;
0084                 regulator-always-on;
0085                 vin-supply = <&main_12v>;
0086                 gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
0087                 enable-active-high;
0088         };
0089 
0090         vcc_1v8: regulator-vcc_1v8 {
0091                 compatible = "regulator-fixed";
0092                 regulator-name = "VCC_1V8";
0093                 regulator-min-microvolt = <1800000>;
0094                 regulator-max-microvolt = <1800000>;
0095                 vin-supply = <&vcc_3v3>;
0096                 regulator-always-on;
0097         };
0098 
0099         vcc_3v3: regulator-vcc_3v3 {
0100                 compatible = "regulator-fixed";
0101                 regulator-name = "VCC_3V3";
0102                 regulator-min-microvolt = <3300000>;
0103                 regulator-max-microvolt = <3300000>;
0104                 vin-supply = <&vddao_3v3>;
0105                 regulator-always-on;
0106                 /* FIXME: actually controlled by VDDCPU_B_EN */
0107         };
0108 
0109         vddcpu: regulator-vddcpu {
0110                 /*
0111                  * MP8756GD Regulator.
0112                  */
0113                 compatible = "pwm-regulator";
0114 
0115                 regulator-name = "VDDCPU";
0116                 regulator-min-microvolt = <721000>;
0117                 regulator-max-microvolt = <1022000>;
0118 
0119                 pwm-supply = <&main_12v>;
0120 
0121                 pwms = <&pwm_AO_cd 1 1250 0>;
0122                 pwm-dutycycle-range = <100 0>;
0123 
0124                 regulator-boot-on;
0125                 regulator-always-on;
0126         };
0127 
0128         usb_pwr_en: regulator-usb_pwr_en {
0129                 compatible = "regulator-fixed";
0130                 regulator-name = "USB_PWR_EN";
0131                 regulator-min-microvolt = <5000000>;
0132                 regulator-max-microvolt = <5000000>;
0133                 vin-supply = <&vcc_5v>;
0134 
0135                 /* Connected to the microUSB port power enable */
0136                 gpio = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
0137                 enable-active-high;
0138         };
0139 
0140         vddao_1v8: regulator-vddao_1v8 {
0141                 compatible = "regulator-fixed";
0142                 regulator-name = "VDDAO_1V8";
0143                 regulator-min-microvolt = <1800000>;
0144                 regulator-max-microvolt = <1800000>;
0145                 vin-supply = <&vddao_3v3>;
0146                 regulator-always-on;
0147         };
0148 
0149         vddao_3v3: regulator-vddao_3v3 {
0150                 compatible = "regulator-fixed";
0151                 regulator-name = "VDDAO_3V3";
0152                 regulator-min-microvolt = <3300000>;
0153                 regulator-max-microvolt = <3300000>;
0154                 vin-supply = <&main_12v>;
0155                 regulator-always-on;
0156         };
0157 
0158         hdmi-connector {
0159                 compatible = "hdmi-connector";
0160                 type = "a";
0161 
0162                 port {
0163                         hdmi_connector_in: endpoint {
0164                                 remote-endpoint = <&hdmi_tx_tmds_out>;
0165                         };
0166                 };
0167         };
0168 
0169         sound {
0170                 compatible = "amlogic,axg-sound-card";
0171                 audio-aux-devs = <&tdmout_b>;
0172                 audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
0173                                 "TDMOUT_B IN 1", "FRDDR_B OUT 1",
0174                                 "TDMOUT_B IN 2", "FRDDR_C OUT 1",
0175                                 "TDM_B Playback", "TDMOUT_B OUT";
0176 
0177                 assigned-clocks = <&clkc CLKID_MPLL2>,
0178                                   <&clkc CLKID_MPLL0>,
0179                                   <&clkc CLKID_MPLL1>;
0180                 assigned-clock-parents = <0>, <0>, <0>;
0181                 assigned-clock-rates = <294912000>,
0182                                        <270950400>,
0183                                        <393216000>;
0184                 status = "okay";
0185 
0186                 dai-link-0 {
0187                         sound-dai = <&frddr_a>;
0188                 };
0189 
0190                 dai-link-1 {
0191                         sound-dai = <&frddr_b>;
0192                 };
0193 
0194                 dai-link-2 {
0195                         sound-dai = <&frddr_c>;
0196                 };
0197 
0198                 /* 8ch hdmi interface */
0199                 dai-link-3 {
0200                         sound-dai = <&tdmif_b>;
0201                         dai-format = "i2s";
0202                         dai-tdm-slot-tx-mask-0 = <1 1>;
0203                         dai-tdm-slot-tx-mask-1 = <1 1>;
0204                         dai-tdm-slot-tx-mask-2 = <1 1>;
0205                         dai-tdm-slot-tx-mask-3 = <1 1>;
0206                         mclk-fs = <256>;
0207 
0208                         codec {
0209                                 sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
0210                         };
0211                 };
0212 
0213                 /* hdmi glue */
0214                 dai-link-4 {
0215                         sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
0216 
0217                         codec {
0218                                 sound-dai = <&hdmi_tx>;
0219                         };
0220                 };
0221         };
0222 };
0223 
0224 &arb {
0225         status = "okay";
0226 };
0227 
0228 &cec_AO {
0229         pinctrl-0 = <&cec_ao_a_h_pins>;
0230         pinctrl-names = "default";
0231         status = "disabled";
0232         hdmi-phandle = <&hdmi_tx>;
0233 };
0234 
0235 &cecb_AO {
0236         pinctrl-0 = <&cec_ao_b_h_pins>;
0237         pinctrl-names = "default";
0238         status = "okay";
0239         hdmi-phandle = <&hdmi_tx>;
0240 };
0241 
0242 &clkc_audio {
0243         status = "okay";
0244 };
0245 
0246 &cpu0 {
0247         cpu-supply = <&vddcpu>;
0248         operating-points-v2 = <&cpu_opp_table>;
0249         clocks = <&clkc CLKID_CPU_CLK>;
0250         clock-latency = <50000>;
0251 };
0252 
0253 &cpu1 {
0254         cpu-supply = <&vddcpu>;
0255         operating-points-v2 = <&cpu_opp_table>;
0256         clocks = <&clkc CLKID_CPU1_CLK>;
0257         clock-latency = <50000>;
0258 };
0259 
0260 &cpu2 {
0261         cpu-supply = <&vddcpu>;
0262         operating-points-v2 = <&cpu_opp_table>;
0263         clocks = <&clkc CLKID_CPU2_CLK>;
0264         clock-latency = <50000>;
0265 };
0266 
0267 &cpu3 {
0268         cpu-supply = <&vddcpu>;
0269         operating-points-v2 = <&cpu_opp_table>;
0270         clocks = <&clkc CLKID_CPU3_CLK>;
0271         clock-latency = <50000>;
0272 };
0273 
0274 &ext_mdio {
0275         external_phy: ethernet-phy@0 {
0276                 /* Realtek RTL8211F (0x001cc916) */
0277                 reg = <0>;
0278                 max-speed = <1000>;
0279 
0280                 reset-assert-us = <10000>;
0281                 reset-deassert-us = <80000>;
0282                 reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
0283 
0284                 interrupt-parent = <&gpio_intc>;
0285                 /* MAC_INTR on GPIOZ_14 */
0286                 interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
0287         };
0288 };
0289 
0290 &ethmac {
0291         pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
0292         pinctrl-names = "default";
0293         status = "okay";
0294         phy-mode = "rgmii";
0295         phy-handle = <&external_phy>;
0296         amlogic,tx-delay-ns = <2>;
0297 };
0298 
0299 &frddr_a {
0300         status = "okay";
0301 };
0302 
0303 &frddr_b {
0304         status = "okay";
0305 };
0306 
0307 &frddr_c {
0308         status = "okay";
0309 };
0310 
0311 &gpio {
0312         gpio-line-names =
0313                 /* GPIOZ */
0314                 "", "", "", "", "", "", "", "",
0315                 "", "", "", "", "", "", "", "",
0316                 /* GPIOH */
0317                 "", "", "", "", "",
0318                 "PIN_36", /* GPIOH_5 */
0319                 "PIN_26", /* GPIOH_6 */
0320                 "PIN_32", /* GPIOH_7 */
0321                 "",
0322                 /* BOOT */
0323                 "", "", "", "", "", "", "", "",
0324                 "", "", "", "", "", "", "", "",
0325                 /* GPIOC */
0326                 "", "", "", "", "", "", "", "",
0327                 /* GPIOA */
0328                 "", "", "", "", "", "", "", "",
0329                 "", "", "", "", "", "",
0330                 "PIN_27", /* GPIOA_14 */
0331                 "PIN_28", /* GPIOA_15 */
0332                 /* GPIOX */
0333                 "PIN_16", /* GPIOX_0 */
0334                 "PIN_18", /* GPIOX_1 */
0335                 "PIN_22", /* GPIOX_2 */
0336                 "PIN_11", /* GPIOX_3 */
0337                 "PIN_13", /* GPIOX_4 */
0338                 "PIN_7",  /* GPIOX_5 */
0339                 "PIN_33", /* GPIOX_6 */
0340                 "PIN_15", /* GPIOX_7 */
0341                 "PIN_19", /* GPIOX_8 */
0342                 "PIN_21", /* GPIOX_9 */
0343                 "PIN_24", /* GPIOX_10 */
0344                 "PIN_23", /* GPIOX_11 */
0345                 "PIN_8",  /* GPIOX_12 */
0346                 "PIN_10", /* GPIOX_13 */
0347                 "PIN_29", /* GPIOX_14 */
0348                 "PIN_31", /* GPIOX_15 */
0349                 "PIN_12", /* GPIOX_16 */
0350                 "PIN_3",  /* GPIOX_17 */
0351                 "PIN_5",  /* GPIOX_18 */
0352                 "PIN_35"; /* GPIOX_19 */
0353 };
0354 
0355 &gpio_ao {
0356         gpio-line-names =
0357                 /* GPIOAO */
0358                 "", "", "", "",
0359                 "PIN_47", /* GPIOAO_4 */
0360                 "", "",
0361                 "PIN_45", /* GPIOAO_7 */
0362                 "PIN_46", /* GPIOAO_8 */
0363                 "PIN_44", /* GPIOAO_9 */
0364                 "PIN_42", /* GPIOAO_10 */
0365                 "",
0366                 /* GPIOE */
0367                 "", "", "";
0368 };
0369 
0370 &hdmi_tx {
0371         status = "okay";
0372         pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
0373         pinctrl-names = "default";
0374         hdmi-supply = <&vcc_5v>;
0375 };
0376 
0377 &hdmi_tx_tmds_port {
0378         hdmi_tx_tmds_out: endpoint {
0379                 remote-endpoint = <&hdmi_connector_in>;
0380         };
0381 };
0382 
0383 &ir {
0384         status = "okay";
0385         pinctrl-0 = <&remote_input_ao_pins>;
0386         pinctrl-names = "default";
0387 };
0388 
0389 &pwm_AO_cd {
0390         pinctrl-0 = <&pwm_ao_d_e_pins>;
0391         pinctrl-names = "default";
0392         clocks = <&xtal>;
0393         clock-names = "clkin1";
0394         status = "okay";
0395 };
0396 
0397 &saradc {
0398         status = "okay";
0399 };
0400 
0401 /* SD card */
0402 &sd_emmc_b {
0403         status = "okay";
0404         pinctrl-0 = <&sdcard_c_pins>;
0405         pinctrl-1 = <&sdcard_clk_gate_c_pins>;
0406         pinctrl-names = "default", "clk-gate";
0407 
0408         bus-width = <4>;
0409         cap-sd-highspeed;
0410         max-frequency = <200000000>;
0411         sd-uhs-sdr12;
0412         sd-uhs-sdr25;
0413         sd-uhs-sdr50;
0414         sd-uhs-sdr104;
0415         disable-wp;
0416 
0417         cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
0418         vmmc-supply = <&tflash_vdd>;
0419         vqmmc-supply = <&tf_io>;
0420 };
0421 
0422 /* eMMC */
0423 &sd_emmc_c {
0424         status = "okay";
0425         pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
0426         pinctrl-1 = <&emmc_clk_gate_pins>;
0427         pinctrl-names = "default", "clk-gate";
0428 
0429         bus-width = <8>;
0430         cap-mmc-highspeed;
0431         mmc-ddr-1_8v;
0432         mmc-hs200-1_8v;
0433         max-frequency = <200000000>;
0434         disable-wp;
0435 
0436         mmc-pwrseq = <&emmc_pwrseq>;
0437         vmmc-supply = <&vcc_3v3>;
0438         vqmmc-supply = <&flash_1v8>;
0439 };
0440 
0441 &tdmif_b {
0442         status = "okay";
0443 };
0444 
0445 &tdmout_b {
0446         status = "okay";
0447 };
0448 
0449 &tohdmitx {
0450         status = "okay";
0451 };
0452 
0453 &uart_AO {
0454         status = "okay";
0455         pinctrl-0 = <&uart_ao_a_pins>;
0456         pinctrl-names = "default";
0457 };
0458 
0459 &usb {
0460         status = "okay";
0461         vbus-supply = <&usb_pwr_en>;
0462 };
0463 
0464 &usb2_phy0 {
0465         phy-supply = <&vcc_5v>;
0466 };
0467