Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (c) 2016 Andreas Färber
0004  * Copyright (c) 2016 BayLibre, Inc.
0005  * Author: Kevin Hilman <khilman@kernel.org>
0006  */
0007 
0008 /dts-v1/;
0009 
0010 #include "meson-gxbb.dtsi"
0011 #include <dt-bindings/gpio/gpio.h>
0012 #include <dt-bindings/sound/meson-aiu.h>
0013 
0014 / {
0015         compatible = "hardkernel,odroid-c2", "amlogic,meson-gxbb";
0016         model = "Hardkernel ODROID-C2";
0017 
0018         aliases {
0019                 serial0 = &uart_AO;
0020                 ethernet0 = &ethmac;
0021         };
0022 
0023         chosen {
0024                 stdout-path = "serial0:115200n8";
0025         };
0026 
0027         memory@0 {
0028                 device_type = "memory";
0029                 reg = <0x0 0x0 0x0 0x80000000>;
0030         };
0031 
0032         usb_otg_pwr: regulator-usb-pwrs {
0033                 compatible = "regulator-fixed";
0034 
0035                 regulator-name = "USB_OTG_PWR";
0036 
0037                 regulator-min-microvolt = <5000000>;
0038                 regulator-max-microvolt = <5000000>;
0039 
0040                 /*
0041                  * signal name from schematics: PWREN
0042                  */
0043                 gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
0044                 enable-active-high;
0045                 /*
0046                  * signal name from schematics: USB_POWER
0047                  */
0048                 vin-supply = <&p5v0>;
0049         };
0050 
0051         leds {
0052                 compatible = "gpio-leds";
0053                 led-blue {
0054                         label = "c2:blue:alive";
0055                         gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
0056                         linux,default-trigger = "heartbeat";
0057                         default-state = "off";
0058                 };
0059         };
0060 
0061         p5v0: regulator-p5v0 {
0062                 compatible = "regulator-fixed";
0063 
0064                 regulator-name = "P5V0";
0065                 regulator-min-microvolt = <5000000>;
0066                 regulator-max-microvolt = <5000000>;
0067                 regulator-always-on;
0068         };
0069 
0070         hdmi_p5v0: regulator-hdmi_p5v0 {
0071                 compatible = "regulator-fixed";
0072                 regulator-name = "HDMI_P5V0";
0073                 regulator-min-microvolt = <5000000>;
0074                 regulator-max-microvolt = <5000000>;
0075                 /* AP2331SA-7 */
0076                 vin-supply = <&p5v0>;
0077         };
0078 
0079         tflash_vdd: regulator-tflash_vdd {
0080                 compatible = "regulator-fixed";
0081 
0082                 regulator-name = "TFLASH_VDD";
0083                 regulator-min-microvolt = <3300000>;
0084                 regulator-max-microvolt = <3300000>;
0085 
0086                 /*
0087                  * signal name from schematics: TFLASH_VDD_EN
0088                  */
0089                 gpio = <&gpio GPIOY_12 GPIO_ACTIVE_HIGH>;
0090                 enable-active-high;
0091                 /* U16 RT9179GB */
0092                 vin-supply = <&vddio_ao3v3>;
0093         };
0094 
0095         tf_io: gpio-regulator-tf_io {
0096                 compatible = "regulator-gpio";
0097 
0098                 regulator-name = "TF_IO";
0099                 regulator-min-microvolt = <1800000>;
0100                 regulator-max-microvolt = <3300000>;
0101 
0102                 /*
0103                  * signal name from schematics: TF_3V3N_1V8_EN
0104                  */
0105                 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
0106                 gpios-states = <0>;
0107 
0108                 states = <3300000 0>,
0109                          <1800000 1>;
0110                 /* U12/U13 RT9179GB */
0111                 vin-supply = <&vddio_ao3v3>;
0112         };
0113 
0114         vcc1v8: regulator-vcc1v8 {
0115                 compatible = "regulator-fixed";
0116                 regulator-name = "VCC1V8";
0117                 regulator-min-microvolt = <1800000>;
0118                 regulator-max-microvolt = <1800000>;
0119                 regulator-always-on;
0120                 /* U18 RT9179GB */
0121                 vin-supply = <&vddio_ao3v3>;
0122         };
0123 
0124         vcc3v3: regulator-vcc3v3 {
0125                 compatible = "regulator-fixed";
0126                 regulator-name = "VCC3V3";
0127                 regulator-min-microvolt = <3300000>;
0128                 regulator-max-microvolt = <3300000>;
0129         };
0130 
0131         vddio_ao1v8: regulator-vddio-ao1v8 {
0132                 compatible = "regulator-fixed";
0133                 regulator-name = "VDDIO_AO1V8";
0134                 regulator-min-microvolt = <1800000>;
0135                 regulator-max-microvolt = <1800000>;
0136                 regulator-always-on;
0137                 /* U17 RT9179GB */
0138                 vin-supply = <&p5v0>;
0139         };
0140 
0141         vddio_ao3v3: regulator-vddio-ao3v3 {
0142                 compatible = "regulator-fixed";
0143                 regulator-name = "VDDIO_AO3V3";
0144                 regulator-min-microvolt = <3300000>;
0145                 regulator-max-microvolt = <3300000>;
0146                 regulator-always-on;
0147                 /* U11 MP2161GJ-C499 */
0148                 vin-supply = <&p5v0>;
0149         };
0150 
0151         ddr3_1v5: regulator-ddr3_1v5 {
0152                 compatible = "regulator-fixed";
0153                 regulator-name = "DDR3_1V5";
0154                 regulator-min-microvolt = <1500000>;
0155                 regulator-max-microvolt = <1500000>;
0156                 regulator-always-on;
0157                 /* U15 MP2161GJ-C499 */
0158                 vin-supply = <&p5v0>;
0159         };
0160 
0161         emmc_pwrseq: emmc-pwrseq {
0162                 compatible = "mmc-pwrseq-emmc";
0163                 reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
0164         };
0165 
0166         hdmi-connector {
0167                 compatible = "hdmi-connector";
0168                 type = "a";
0169 
0170                 port {
0171                         hdmi_connector_in: endpoint {
0172                                 remote-endpoint = <&hdmi_tx_tmds_out>;
0173                         };
0174                 };
0175         };
0176 
0177         sound {
0178                 compatible = "amlogic,gx-sound-card";
0179                 model = "ODROID-C2";
0180                 assigned-clocks = <&clkc CLKID_MPLL0>,
0181                                   <&clkc CLKID_MPLL1>,
0182                                   <&clkc CLKID_MPLL2>;
0183                 assigned-clock-parents = <0>, <0>, <0>;
0184                 assigned-clock-rates = <294912000>,
0185                                        <270950400>,
0186                                        <393216000>;
0187                 status = "okay";
0188 
0189                 dai-link-0 {
0190                         sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
0191                 };
0192 
0193                 dai-link-1 {
0194                         sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
0195                         dai-format = "i2s";
0196                         mclk-fs = <256>;
0197 
0198                         codec-0 {
0199                                 sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
0200                         };
0201                 };
0202 
0203                 dai-link-2 {
0204                         sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
0205 
0206                         codec-0 {
0207                                 sound-dai = <&hdmi_tx>;
0208                         };
0209                 };
0210         };
0211 };
0212 
0213 &aiu {
0214         status = "okay";
0215 };
0216 
0217 &cec_AO {
0218         status = "okay";
0219         pinctrl-0 = <&ao_cec_pins>;
0220         pinctrl-names = "default";
0221         hdmi-phandle = <&hdmi_tx>;
0222 };
0223 
0224 &ethmac {
0225         status = "okay";
0226         pinctrl-0 = <&eth_rgmii_pins>;
0227         pinctrl-names = "default";
0228         phy-handle = <&eth_phy0>;
0229         phy-mode = "rgmii";
0230 
0231         amlogic,tx-delay-ns = <2>;
0232 
0233         mdio {
0234                 compatible = "snps,dwmac-mdio";
0235                 #address-cells = <1>;
0236                 #size-cells = <0>;
0237 
0238                 eth_phy0: ethernet-phy@0 {
0239                         /* Realtek RTL8211F (0x001cc916) */
0240                         reg = <0>;
0241 
0242                         reset-assert-us = <10000>;
0243                         reset-deassert-us = <80000>;
0244                         reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
0245 
0246                         interrupt-parent = <&gpio_intc>;
0247                         /* MAC_INTR on GPIOZ_15 */
0248                         interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
0249                 };
0250         };
0251 };
0252 
0253 &gpio_ao {
0254         /*
0255          * WARNING: The USB Hub on the Odroid-C2 needs a reset signal
0256          * to be turned high in order to be detected by the USB Controller
0257          * This signal should be handled by a USB specific power sequence
0258          * in order to reset the Hub when USB bus is powered down.
0259          */
0260         hog-0 {
0261                 gpio-hog;
0262                 gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
0263                 output-high;
0264                 line-name = "usb-hub-reset";
0265         };
0266 };
0267 
0268 &hdmi_tx {
0269         status = "okay";
0270         pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
0271         pinctrl-names = "default";
0272         hdmi-supply = <&hdmi_p5v0>;
0273 };
0274 
0275 &hdmi_tx_tmds_port {
0276         hdmi_tx_tmds_out: endpoint {
0277                 remote-endpoint = <&hdmi_connector_in>;
0278         };
0279 };
0280 
0281 &i2c_A {
0282         status = "okay";
0283         pinctrl-0 = <&i2c_a_pins>;
0284         pinctrl-names = "default";
0285 };
0286 
0287 &ir {
0288         status = "okay";
0289         pinctrl-0 = <&remote_input_ao_pins>;
0290         pinctrl-names = "default";
0291         linux,rc-map-name = "rc-odroid";
0292 };
0293 
0294 &gpio_ao {
0295         gpio-line-names = "UART TX", "UART RX", "VCCK En", "TF 3V3/1V8 En",
0296                           "USB HUB nRESET", "USB OTG Power En",
0297                           "J7 Header Pin2", "IR In", "J7 Header Pin4",
0298                           "J7 Header Pin6", "J7 Header Pin5", "J7 Header Pin7",
0299                           "HDMI CEC", "SYS LED",
0300                           /* GPIO_TEST_N */
0301                           "";
0302 };
0303 
0304 &gpio {
0305         gpio-line-names = /* Bank GPIOZ */
0306                           "Eth MDIO", "Eth MDC", "Eth RGMII RX Clk",
0307                           "Eth RX DV", "Eth RX D0", "Eth RX D1", "Eth RX D2",
0308                           "Eth RX D3", "Eth RGMII TX Clk", "Eth TX En",
0309                           "Eth TX D0", "Eth TX D1", "Eth TX D2", "Eth TX D3",
0310                           "Eth PHY nRESET", "Eth PHY Intc",
0311                           /* Bank GPIOH */
0312                           "HDMI HPD", "HDMI DDC SDA", "HDMI DDC SCL", "",
0313                           /* Bank BOOT */
0314                           "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3", "eMMC D4",
0315                           "eMMC D5", "eMMC D6", "eMMC D7", "eMMC Clk",
0316                           "eMMC Reset", "eMMC CMD",
0317                           "", "", "", "", "", "", "",
0318                           /* Bank CARD */
0319                           "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD",
0320                           "SDCard D3", "SDCard D2", "SDCard Det",
0321                           /* Bank GPIODV */
0322                           "", "", "", "", "", "", "", "", "", "", "", "", "",
0323                           "", "", "", "", "", "", "", "", "", "", "",
0324                           "I2C A SDA", "I2C A SCK", "I2C B SDA", "I2C B SCK",
0325                           "PWM D", "PWM B",
0326                           /* Bank GPIOY */
0327                           "Revision Bit0", "Revision Bit1", "",
0328                           "J2 Header Pin35", "", "", "", "J2 Header Pin36",
0329                           "J2 Header Pin31", "", "", "", "TF VDD En",
0330                           "J2 Header Pin32", "J2 Header Pin26", "", "",
0331                           /* Bank GPIOX */
0332                           "J2 Header Pin29", "J2 Header Pin24",
0333                           "J2 Header Pin23", "J2 Header Pin22",
0334                           "J2 Header Pin21", "J2 Header Pin18",
0335                           "J2 Header Pin33", "J2 Header Pin19",
0336                           "J2 Header Pin16", "J2 Header Pin15",
0337                           "J2 Header Pin12", "J2 Header Pin13",
0338                           "J2 Header Pin8", "J2 Header Pin10",
0339                           "", "", "", "", "",
0340                           "J2 Header Pin11", "", "J2 Header Pin7", "",
0341                           /* Bank GPIOCLK */
0342                           "", "", "", "";
0343 };
0344 
0345 &saradc {
0346         status = "okay";
0347         vref-supply = <&vcc1v8>;
0348 };
0349 
0350 &scpi_clocks {
0351         status = "disabled";
0352 };
0353 
0354 /* SD */
0355 &sd_emmc_b {
0356         status = "okay";
0357         pinctrl-0 = <&sdcard_pins>;
0358         pinctrl-1 = <&sdcard_clk_gate_pins>;
0359         pinctrl-names = "default", "clk-gate";
0360 
0361         bus-width = <4>;
0362         cap-sd-highspeed;
0363         sd-uhs-sdr12;
0364         sd-uhs-sdr25;
0365         sd-uhs-sdr50;
0366         sd-uhs-ddr50;
0367         max-frequency = <100000000>;
0368         disable-wp;
0369 
0370         cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
0371 
0372         vmmc-supply = <&tflash_vdd>;
0373         vqmmc-supply = <&tf_io>;
0374 };
0375 
0376 /* eMMC */
0377 &sd_emmc_c {
0378         status = "okay";
0379         pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
0380         pinctrl-1 = <&emmc_clk_gate_pins>;
0381         pinctrl-names = "default", "clk-gate";
0382 
0383         bus-width = <8>;
0384         max-frequency = <200000000>;
0385         non-removable;
0386         disable-wp;
0387         cap-mmc-highspeed;
0388         mmc-ddr-1_8v;
0389         mmc-hs200-1_8v;
0390 
0391         mmc-pwrseq = <&emmc_pwrseq>;
0392         vmmc-supply = <&vcc3v3>;
0393         vqmmc-supply = <&vcc1v8>;
0394 };
0395 
0396 &uart_AO {
0397         status = "okay";
0398         pinctrl-0 = <&uart_ao_a_pins>;
0399         pinctrl-names = "default";
0400 };
0401 
0402 &usb0_phy {
0403         status = "disabled";
0404         phy-supply = <&usb_otg_pwr>;
0405 };
0406 
0407 &usb1_phy {
0408         status = "okay";
0409         phy-supply = <&usb_otg_pwr>;
0410 };
0411 
0412 &usb0 {
0413         status = "disabled";
0414 };
0415 
0416 &usb1 {
0417         status = "okay";
0418 };