armbian_build/patch/kernel/archive/meson-5.10/board_onecloud/0001-add-dts.patch
hzyitc 1ad2e6aeb0
meson: current and legacy: Support HDMI (#4177)
* meson: current: Support HDMI
* meson: legacy: Support HDMI
2022-09-14 16:33:44 +02:00

432 lines
8.6 KiB
Diff

Add dts
---
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/meson8b-onecloud.dts | 402 +++++++++++++++++++++++++
2 files changed, 403 insertions(+)
create mode 100644 arch/arm/boot/dts/meson8b-onecloud.dts
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 7e8151681597..e8d5ca39d0c6 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -347,6 +347,7 @@ dtb-$(CONFIG_MACH_MESON8) += \
meson8b-ec100.dtb \
meson8b-mxq.dtb \
meson8b-odroidc1.dtb \
+ meson8b-onecloud.dtb \
meson8m2-mxiii-plus.dtb
dtb-$(CONFIG_ARCH_MMP) += \
pxa168-aspenite.dtb \
diff --git a/arch/arm/boot/dts/meson8b-onecloud.dts b/arch/arm/boot/dts/meson8b-onecloud.dts
new file mode 100644
index 000000000000..d517e45e22ba
--- /dev/null
+++ b/arch/arm/boot/dts/meson8b-onecloud.dts
@@ -0,0 +1,402 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Author: hzyitc
+ */
+
+/dts-v1/;
+#include "meson8b.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ model = "Xunlei OneCloud";
+ compatible = "xunlei,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>;
+ };
+
+ button {
+ // compatible = "gpio-keys-polled";
+ // poll-interval = <100>;
+
+ compatible = "gpio-keys";
+
+ autorepeat;
+
+ reset-button {
+ label = "reset";
+ linux,code = <BTN_0>;
+
+ // gpios = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_LOW>;
+
+ interrupt-parent = <&gpio_intc>;
+ interrupts = <5 IRQ_TYPE_LEVEL_LOW>; // GPIOAO 5
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ red {
+ label = "onecloud:red:alive";
+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
+
+ default-state = "on";
+ linux,default-trigger = "default-on";
+ };
+
+ green {
+ label = "onecloud:green:alive";
+ gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
+
+ default-state = "off";
+ linux,default-trigger = "mmc1";
+ };
+
+ blue {
+ label = "onecloud:blue:alive";
+ gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>;
+
+ default-state = "off";
+ linux,default-trigger = "usb-host";
+ };
+ };
+
+ 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% | 10% | 0% |
+ // +------+--------+--------+--------+--------+--------+
+ // | V1.0 | 677mV | 857mV | 992mV | 1082mV | 1127mV |
+ // | V1.3 | 1116mV | 1121mV | 1125mV | 1128mV | 1129mV |
+ // +------+--------+--------+--------+--------+--------+
+ //
+ // According to meson8b.dtsi, the CPU should be able to
+ // run at 504MHz with 870mV. But this regulator supplies
+ // not only CPU but also GPU. And according to the users'
+ // tests on V1.0, we need such higher voltages.
+
+ pwms = <&pwm_cd 1 12001 0>; // PWM_D
+ pwm-dutycycle-range = <10 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>;
+};
+
+&mali {
+ // commented to allow cpufreq tweaking
+ // mali-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
+ "";
+};
+
+&ethmac {
+ status = "okay";
+
+ pinctrl-0 = <&eth_rgmii_pins>;
+ pinctrl-names = "default";
+
+ phy-handle = <&eth_phy>;
+ phy-mode = "rgmii-id";
+
+ 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";
+};
--
2.25.1