// SPDX-License-Identifier: GPL-2.0 OR MIT /dts-v1/; #include "meson8b.dtsi" #include #include / { model = "Thunder OneCloud"; compatible = "thunder,onecloud", "amlogic,meson8b"; aliases { serial0 = &uart_AO; mmc0 = &sd_card_slot; mmc1 = &sdhc; }; chosen { stdout-path = "serial0:115200n8"; }; memory { device_type = "memory"; reg = <0x40000000 0x40000000>; }; emmc_pwrseq: emmc-pwrseq { compatible = "mmc-pwrseq-emmc"; reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>; }; gpio-keys { // compatible = "gpio-keys-polled"; // poll-interval = <100>; compatible = "gpio-keys"; autorepeat; reset-button { label = "reset"; linux,code = ; // gpios = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_LOW>; interrupt-parent = <&gpio_intc>; interrupts = <5 IRQ_TYPE_LEVEL_LOW>; // GPIOAO 5 }; }; leds { compatible = "gpio-leds"; led_status_red: status-red { label = "red:status"; gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>; }; led_status_green: status-green { label = "green:status"; gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>; }; led_status_blue: status-blue { label = "blue:status"; gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>; }; }; p12v: regulator-p12v { compatible = "regulator-fixed"; regulator-name = "P12V"; regulator-min-microvolt = <12000000>; regulator-max-microvolt = <12000000>; }; vcc_5v: regulator-vcc-5v { compatible = "regulator-fixed"; regulator-name = "VCC5V"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; vin-supply = <&p12v>; regulator-boot-on; regulator-always-on; }; vcc_3v3: regulator-vcc-3v3 { compatible = "regulator-fixed"; regulator-name = "VCC3V3"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; vin-supply = <&p12v>; regulator-boot-on; regulator-always-on; }; vcc_1v8: regulator-vcc-1v8 { compatible = "regulator-fixed"; regulator-name = "VCC1V8"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; vin-supply = <&p12v>; regulator-boot-on; regulator-always-on; }; vcc_ddr: regulator-vcc-ddr { compatible = "regulator-fixed"; regulator-name = "VCC_DDR"; regulator-min-microvolt = <1500000>; regulator-max-microvolt = <1500000>; vin-supply = <&vcc_3v3>; regulator-boot-on; regulator-always-on; }; vcc_core: regulator-vcc-core { compatible = "pwm-regulator"; regulator-name = "VCC_CORE"; // ------------------------------------------ // | The actual mapping in phyical | // -------------------------------------- // | | 100% | 60% | 30% | 0% | // -------------------------------------- // | V1.0 | 677mV | 857mV | 992mV | 1127mV | // | V1.3 | 1116mV | 1121mV | 1125mV | 1129mV | // -------------------------------------- // // According to meson8b.dtsi, the CPU should be able // to run at 504MHz with 870mV. But according to my // test on V1.0, the system will crash in this case. // // And this regulator supplies not only CPU but also GPU. // // So we use higher voltages. pwms = <&pwm_cd 1 12001 0>; // PWM_D pwm-dutycycle-range = <30 0>; regulator-min-microvolt = <860000>; regulator-max-microvolt = <1140000>; pwm-supply = <&p12v>; regulator-boot-on; regulator-always-on; }; }; &pwm_cd { status = "okay"; pinctrl-0 = <&pwm_c1_pins>, <&pwm_d_pins>; pinctrl-names = "default"; clocks = <&xtal>, <&xtal>; clock-names = "clkin0", "clkin1"; }; &cpu0 { cpu-supply = <&vcc_core>; }; &gpio { gpio-line-names = // 0-3 Bank GPIOX 0-3 "7U1_PIN_18", "7U1_PIN_19", "7U1_PIN_14", "7U1_PIN_15", // 4-7 Bank GPIOX 4-7 "7U1_PIN_27", "7U1_PIN_25", "7U1_PIN_28", "7U1_PIN_26", // 8 Bank GPIOX 8 "R_RightOf_LED", // 9 Bank GPIOX 9 "7U1_PIN_16", // 10 Bank GPIOX 10 "", // 11 Bank GPIOX 11 "7U1_PIN_12", // 12-16 Bank GPIOX 16-20 "7U1_PIN_43", "7U1_PIN_42", "7U1_PIN_41(Resistor)", "7U1_PIN_44", "7U1_PIN_34", // 17 Bank GPIOX 21 "7U1_PIN_13", // 18 Bank GPIOY 0 "Resistor_TopOf_LED", // 19-20 Bank GPIOY 1-3 "", "", // 21-26 Bank GPIOY 6-11 "", "", "", "", "", "", // 27 Bank GPIOY 12 "", // 28-29 Bank GPIOY 13-14 "Left_BottomOf_CPU", "Right_BottomOf_CPU", // 30 Bank GPIODV 9 "VCCK_PWM (PWM_C)", // 31-35 Bank GPIODV 24-28 "I2CA_SDA", "I2CA_SCL", "I2CB_SDA", "I2CB_SCL", "VDDEE_PWM (PWM_D)", // 36 Bank GPIODV 29 "", // 37-39 Bank GPIOH 0-2 "HDMI_HPD", "HDMI_I2C_SDA", "HDMI_I2C_SCL", // 40-46 Bank GPIOH 3-9 "ETH_PHY_INTR", "ETH_PHY_NRST", "ETH_TXD1", "ETH_TXD0", "ETH_TXD3", "ETH_TXD2", "ETH_RGMII_TX_CLK", // 47-53 Bank CARD 0-6 "SD_D1", "SD_D0", "SD_CLK", "SD_CMD", "SD_D3", "SD_D2", "SD_CD", // 54-65 Bank BOOT 0-11 "EMMC_D0", "EMMC_D1", "EMMC_D2", "EMMC_D3", "EMMC_D4", "EMMC_D5", "EMMC_D6", "EMMC_D7", "EMMC_CLK", "EMMC_RSTn", "EMMC_CMD", "BOOT_SEL", // 66-72 Bank BOOT 12-18 "", "", "", "", "", "", "", // 73-74 Bank DIF 0P 0N "ETH_RXD1", "ETH_RXD0", // 75-76 Bank DIF 1P 1N "ETH_RX_DV", "RGMII_RX_CLK", // 77-78 Bank DIF 2P 2N "ETH_RXD3", "ETH_RXD2", // 79-80 Bank DIF 3P 3N "ETH_TXEN", "ETH_PHY_REF_CLK_25MOUT", // 81-82 Bank DIF 4P 4N "ETH_MDC", "ETH_MDIO"; }; &gpio_ao { gpio-line-names = // 0-1 Band GPIOAO 0-1 "UART TX", "UART RX", // 2-4 Band GPIOAO 2-4 "RED_LED", "GREEN_LED", "BLUE_LED", // 5 Band GPIOAO 5 "BUTTON", // 6 Band GPIOAO 6 "", // 7 Band GPIOAO 7 "IR_IN", // 8 Band GPIOAO 8-13 "", "", "", "", "", "", // 14 Band GPIO_BSD_EN "", // 15 GPIO_TEST_N ""; }; ðmac { status = "okay"; pinctrl-0 = <ð_rgmii_pins>; pinctrl-names = "default"; phy-handle = <ð_phy>; phy-mode = "rgmii-rxid"; mdio { compatible = "snps,dwmac-mdio"; #address-cells = <1>; #size-cells = <0>; // Realtek RTL8211F (0x001cc916) eth_phy: ethernet-phy@0 { reg = <0>; reset-assert-us = <10000>; reset-deassert-us = <80000>; reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; interrupt-parent = <&gpio_intc>; interrupts = <17 IRQ_TYPE_LEVEL_LOW>; // GPIOH 3 }; }; }; &saradc { status = "okay"; vref-supply = <&vcc_1v8>; }; // eMMC &sdhc { status = "okay"; pinctrl-0 = <&sdxc_c_pins>; pinctrl-names = "default"; bus-width = <8>; max-frequency = <100000000>; disable-wp; cap-mmc-highspeed; mmc-hs200-1_8v; no-sdio; mmc-pwrseq = <&emmc_pwrseq>; vmmc-supply = <&vcc_3v3>; // vqmmc-supply = <&vcc_3v3>; }; &sdio { status = "okay"; pinctrl-0 = <&sd_b_pins>; pinctrl-names = "default"; // SD card sd_card_slot: slot@1 { compatible = "mmc-slot"; reg = <1>; status = "okay"; bus-width = <4>; no-sdio; cap-mmc-highspeed; cap-sd-highspeed; disable-wp; cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>; vmmc-supply = <&vcc_3v3>; // vqmmc-supply = <&vcc_3v3>; }; }; &uart_AO { status = "okay"; pinctrl-0 = <&uart_ao_a_pins>; pinctrl-names = "default"; }; &usb0_phy { status = "okay"; }; &usb0 { status = "okay"; }; &usb1_phy { status = "okay"; }; &usb1 { status = "okay"; }; &ir_receiver { status = "okay"; pinctrl-0 = <&ir_recv_pins>; pinctrl-names = "default"; };