Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (c) 2019 BayLibre, SAS
0004  * Author: Neil Armstrong <narmstrong@baylibre.com>
0005  * Copyright (c) 2019 Christian Hewitt <christianshewitt@gmail.com>
0006  */
0007 
0008 /dts-v1/;
0009 
0010 #include "meson-g12b.dtsi"
0011 #include "meson-g12b-s922x.dtsi"
0012 #include <dt-bindings/input/input.h>
0013 #include <dt-bindings/gpio/meson-g12a-gpio.h>
0014 
0015 / {
0016         aliases {
0017                 serial0 = &uart_AO;
0018                 ethernet0 = &ethmac;
0019         };
0020 
0021         chosen {
0022                 stdout-path = "serial0:115200n8";
0023         };
0024 
0025         memory@0 {
0026                 device_type = "memory";
0027                 reg = <0x0 0x0 0x0 0x40000000>;
0028         };
0029 
0030         emmc_pwrseq: emmc-pwrseq {
0031                 compatible = "mmc-pwrseq-emmc";
0032                 reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
0033         };
0034 
0035         sdio_pwrseq: sdio-pwrseq {
0036                 compatible = "mmc-pwrseq-simple";
0037                 reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
0038                 clocks = <&wifi32k>;
0039                 clock-names = "ext_clock";
0040         };
0041 
0042         flash_1v8: regulator-flash_1v8 {
0043                 compatible = "regulator-fixed";
0044                 regulator-name = "FLASH_1V8";
0045                 regulator-min-microvolt = <1800000>;
0046                 regulator-max-microvolt = <1800000>;
0047                 vin-supply = <&vcc_3v3>;
0048                 regulator-always-on;
0049         };
0050 
0051         main_12v: regulator-main_12v {
0052                 compatible = "regulator-fixed";
0053                 regulator-name = "12V";
0054                 regulator-min-microvolt = <12000000>;
0055                 regulator-max-microvolt = <12000000>;
0056                 regulator-always-on;
0057         };
0058 
0059         vcc_5v: regulator-vcc_5v {
0060                 compatible = "regulator-fixed";
0061                 regulator-name = "VCC_5V";
0062                 regulator-min-microvolt = <5000000>;
0063                 regulator-max-microvolt = <5000000>;
0064                 vin-supply = <&main_12v>;
0065 
0066                 gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
0067                 enable-active-high;
0068         };
0069 
0070         vcc_1v8: regulator-vcc_1v8 {
0071                 compatible = "regulator-fixed";
0072                 regulator-name = "VCC_1V8";
0073                 regulator-min-microvolt = <1800000>;
0074                 regulator-max-microvolt = <1800000>;
0075                 vin-supply = <&vcc_3v3>;
0076                 regulator-always-on;
0077         };
0078 
0079         vcc_3v3: regulator-vcc_3v3 {
0080                 compatible = "regulator-fixed";
0081                 regulator-name = "VCC_3V3";
0082                 regulator-min-microvolt = <3300000>;
0083                 regulator-max-microvolt = <3300000>;
0084                 vin-supply = <&vddao_3v3>;
0085                 regulator-always-on;
0086                 /* FIXME: actually controlled by VDDCPU_B_EN */
0087         };
0088 
0089         vddcpu_a: regulator-vddcpu-a {
0090                 /*
0091                  * MP1653 Regulator.
0092                  */
0093                 compatible = "pwm-regulator";
0094 
0095                 regulator-name = "VDDCPU_A";
0096                 regulator-min-microvolt = <721000>;
0097                 regulator-max-microvolt = <1022000>;
0098 
0099                 pwm-supply = <&main_12v>;
0100 
0101                 pwms = <&pwm_ab 0 1250 0>;
0102                 pwm-dutycycle-range = <100 0>;
0103 
0104                 regulator-boot-on;
0105                 regulator-always-on;
0106         };
0107 
0108         vddcpu_b: regulator-vddcpu-b {
0109                 /*
0110                  * MP1652 Regulator.
0111                  */
0112                 compatible = "pwm-regulator";
0113 
0114                 regulator-name = "VDDCPU_B";
0115                 regulator-min-microvolt = <721000>;
0116                 regulator-max-microvolt = <1022000>;
0117 
0118                 pwm-supply = <&main_12v>;
0119 
0120                 pwms = <&pwm_AO_cd 1 1250 0>;
0121                 pwm-dutycycle-range = <100 0>;
0122 
0123                 regulator-boot-on;
0124                 regulator-always-on;
0125         };
0126 
0127         usb1_pow: regulator-usb1-pow {
0128                 compatible = "regulator-fixed";
0129                 regulator-name = "USB1_POW";
0130                 regulator-min-microvolt = <5000000>;
0131                 regulator-max-microvolt = <5000000>;
0132                 vin-supply = <&vcc_5v>;
0133 
0134                 /* connected to SY6280A Power Switch */
0135                 gpio = <&gpio GPIOA_8 GPIO_ACTIVE_HIGH>;
0136                 enable-active-high;
0137         };
0138 
0139         usb_pwr_en: regulator-usb-pwr-en {
0140                 compatible = "regulator-fixed";
0141                 regulator-name = "USB_PWR_EN";
0142                 regulator-min-microvolt = <5000000>;
0143                 regulator-max-microvolt = <5000000>;
0144                 vin-supply = <&vcc_5v>;
0145 
0146                 /* Connected to USB3 Type-A Port power enable */
0147                 gpio = <&gpio GPIOAO_7 GPIO_ACTIVE_HIGH>;
0148                 enable-active-high;
0149         };
0150 
0151         vddao_1v8: regulator-vddao-1v8 {
0152                 compatible = "regulator-fixed";
0153                 regulator-name = "VDDAO_1V8";
0154                 regulator-min-microvolt = <1800000>;
0155                 regulator-max-microvolt = <1800000>;
0156                 vin-supply = <&vddao_3v3>;
0157                 regulator-always-on;
0158         };
0159 
0160         vddao_3v3: regulator-vddao-3v3 {
0161                 compatible = "regulator-fixed";
0162                 regulator-name = "VDDAO_3V3";
0163                 regulator-min-microvolt = <3300000>;
0164                 regulator-max-microvolt = <3300000>;
0165                 vin-supply = <&main_12v>;
0166                 regulator-always-on;
0167         };
0168 
0169         cvbs-connector {
0170                 compatible = "composite-video-connector";
0171 
0172                 port {
0173                         cvbs_connector_in: endpoint {
0174                                 remote-endpoint = <&cvbs_vdac_out>;
0175                         };
0176                 };
0177         };
0178 
0179         hdmi-connector {
0180                 compatible = "hdmi-connector";
0181                 type = "a";
0182 
0183                 port {
0184                         hdmi_connector_in: endpoint {
0185                                 remote-endpoint = <&hdmi_tx_tmds_out>;
0186                         };
0187                 };
0188         };
0189 
0190         wifi32k: wifi32k {
0191                 compatible = "pwm-clock";
0192                 #clock-cells = <0>;
0193                 clock-frequency = <32768>;
0194                 pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
0195         };
0196 };
0197 
0198 &cec_AO {
0199         pinctrl-0 = <&cec_ao_a_h_pins>;
0200         pinctrl-names = "default";
0201         status = "disabled";
0202         hdmi-phandle = <&hdmi_tx>;
0203 };
0204 
0205 &cecb_AO {
0206         pinctrl-0 = <&cec_ao_b_h_pins>;
0207         pinctrl-names = "default";
0208         status = "okay";
0209         hdmi-phandle = <&hdmi_tx>;
0210 };
0211 
0212 &cpu0 {
0213         cpu-supply = <&vddcpu_b>;
0214         operating-points-v2 = <&cpu_opp_table_0>;
0215         clocks = <&clkc CLKID_CPU_CLK>;
0216         clock-latency = <50000>;
0217 };
0218 
0219 &cpu1 {
0220         cpu-supply = <&vddcpu_b>;
0221         operating-points-v2 = <&cpu_opp_table_0>;
0222         clocks = <&clkc CLKID_CPU_CLK>;
0223         clock-latency = <50000>;
0224 };
0225 
0226 &cpu100 {
0227         cpu-supply = <&vddcpu_a>;
0228         operating-points-v2 = <&cpub_opp_table_1>;
0229         clocks = <&clkc CLKID_CPUB_CLK>;
0230         clock-latency = <50000>;
0231 };
0232 
0233 &cpu101 {
0234         cpu-supply = <&vddcpu_a>;
0235         operating-points-v2 = <&cpub_opp_table_1>;
0236         clocks = <&clkc CLKID_CPUB_CLK>;
0237         clock-latency = <50000>;
0238 };
0239 
0240 &cpu102 {
0241         cpu-supply = <&vddcpu_a>;
0242         operating-points-v2 = <&cpub_opp_table_1>;
0243         clocks = <&clkc CLKID_CPUB_CLK>;
0244         clock-latency = <50000>;
0245 };
0246 
0247 &cpu103 {
0248         cpu-supply = <&vddcpu_a>;
0249         operating-points-v2 = <&cpub_opp_table_1>;
0250         clocks = <&clkc CLKID_CPUB_CLK>;
0251         clock-latency = <50000>;
0252 };
0253 
0254 &cvbs_vdac_port {
0255         cvbs_vdac_out: endpoint {
0256                 remote-endpoint = <&cvbs_connector_in>;
0257         };
0258 };
0259 
0260 &ext_mdio {
0261         external_phy: ethernet-phy@0 {
0262                 /* Realtek RTL8211F (0x001cc916) */
0263                 reg = <0>;
0264                 max-speed = <1000>;
0265 
0266                 reset-assert-us = <10000>;
0267                 reset-deassert-us = <80000>;
0268                 reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
0269 
0270                 interrupt-parent = <&gpio_intc>;
0271                 /* MAC_INTR on GPIOZ_14 */
0272                 interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
0273         };
0274 };
0275 
0276 &ethmac {
0277         pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
0278         pinctrl-names = "default";
0279         status = "okay";
0280         phy-mode = "rgmii";
0281         phy-handle = <&external_phy>;
0282         amlogic,tx-delay-ns = <2>;
0283 };
0284 
0285 &hdmi_tx {
0286         status = "okay";
0287         pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
0288         pinctrl-names = "default";
0289         hdmi-supply = <&vcc_5v>;
0290 };
0291 
0292 &hdmi_tx_tmds_port {
0293         hdmi_tx_tmds_out: endpoint {
0294                 remote-endpoint = <&hdmi_connector_in>;
0295         };
0296 };
0297 
0298 &ir {
0299         status = "okay";
0300         pinctrl-0 = <&remote_input_ao_pins>;
0301         pinctrl-names = "default";
0302 };
0303 
0304 &pwm_ab {
0305         pinctrl-0 = <&pwm_a_e_pins>;
0306         pinctrl-names = "default";
0307         clocks = <&xtal>;
0308         clock-names = "clkin0";
0309         status = "okay";
0310 };
0311 
0312 &pwm_AO_cd {
0313         pinctrl-0 = <&pwm_ao_d_e_pins>;
0314         pinctrl-names = "default";
0315         clocks = <&xtal>;
0316         clock-names = "clkin1";
0317         status = "okay";
0318 };
0319 
0320 &pwm_ef {
0321         pinctrl-0 = <&pwm_e_pins>;
0322         pinctrl-names = "default";
0323         clocks = <&xtal>;
0324         clock-names = "clkin0";
0325         status = "okay";
0326 };
0327 
0328 /* SDIO */
0329 &sd_emmc_a {
0330         status = "okay";
0331         pinctrl-0 = <&sdio_pins>;
0332         pinctrl-1 = <&sdio_clk_gate_pins>;
0333         pinctrl-names = "default", "clk-gate";
0334         #address-cells = <1>;
0335         #size-cells = <0>;
0336 
0337         bus-width = <4>;
0338         cap-sd-highspeed;
0339         max-frequency = <100000000>;
0340 
0341         /* WiFi firmware requires power to be kept while in suspend */
0342         keep-power-in-suspend;
0343 
0344         non-removable;
0345         disable-wp;
0346 
0347         mmc-pwrseq = <&sdio_pwrseq>;
0348 
0349         vmmc-supply = <&vddao_3v3>;
0350         vqmmc-supply = <&vddao_1v8>;
0351 
0352         brcmf: wifi@1 {
0353                 reg = <1>;
0354                 compatible = "brcm,bcm4329-fmac";
0355         };
0356 };
0357 
0358 /* SD card */
0359 &sd_emmc_b {
0360         status = "okay";
0361         pinctrl-0 = <&sdcard_c_pins>;
0362         pinctrl-1 = <&sdcard_clk_gate_c_pins>;
0363         pinctrl-names = "default", "clk-gate";
0364 
0365         bus-width = <4>;
0366         cap-sd-highspeed;
0367         max-frequency = <50000000>;
0368         disable-wp;
0369 
0370         cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
0371         vmmc-supply = <&vddao_3v3>;
0372         vqmmc-supply = <&vddao_3v3>;
0373 };
0374 
0375 /* eMMC */
0376 &sd_emmc_c {
0377         status = "okay";
0378         pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
0379         pinctrl-1 = <&emmc_clk_gate_pins>;
0380         pinctrl-names = "default", "clk-gate";
0381 
0382         bus-width = <8>;
0383         cap-mmc-highspeed;
0384         max-frequency = <100000000>;
0385         disable-wp;
0386 
0387         mmc-pwrseq = <&emmc_pwrseq>;
0388         vmmc-supply = <&vcc_3v3>;
0389         vqmmc-supply = <&flash_1v8>;
0390 };
0391 
0392 &uart_A {
0393         status = "okay";
0394         pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
0395         pinctrl-names = "default";
0396         uart-has-rtscts;
0397 
0398         bluetooth {
0399                 compatible = "brcm,bcm43438-bt";
0400                 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
0401                 max-speed = <2000000>;
0402                 clocks = <&wifi32k>;
0403                 clock-names = "lpo";
0404         };
0405 };
0406 
0407 &uart_AO {
0408         status = "okay";
0409         pinctrl-0 = <&uart_ao_a_pins>;
0410         pinctrl-names = "default";
0411 };
0412 
0413 &usb {
0414         status = "okay";
0415         dr_mode = "host";
0416         vbus-supply = <&usb_pwr_en>;
0417 };
0418 
0419 &usb2_phy0 {
0420         phy-supply = <&usb1_pow>;
0421 };
0422 
0423 &usb2_phy1 {
0424         phy-supply = <&usb1_pow>;
0425 };