diff --git a/config/boards/x96q.tvb b/config/boards/x96q.tvb new file mode 100644 index 000000000000..1de4c24911ce --- /dev/null +++ b/config/boards/x96q.tvb @@ -0,0 +1,10 @@ +# Allwinner H313 TVBox with 2GB of RAM and EMMC +BOARD_NAME="X96Q TV Box" +BOARDFAMILY="sun50iw9" +BOARD_MAINTAINER="sicXnull" +BOOTCONFIG="x96q_lpddr3_defconfig" +BOOT_LOGO="desktop" +KERNEL_TARGET="current" +FORCE_BOOTSCRIPT_UPDATE="yes" +OVERLAY_PREFIX="sun50i-h616" +enable_extension "uwe5622-allwinner" diff --git a/patch/kernel/archive/sunxi-6.6/patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch b/patch/kernel/archive/sunxi-6.6/patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch new file mode 100644 index 000000000000..2964914428b2 --- /dev/null +++ b/patch/kernel/archive/sunxi-6.6/patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch @@ -0,0 +1,511 @@ +diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile +index a957365..812685d 100644 +--- a/arch/arm64/boot/dts/allwinner/Makefile ++++ b/arch/arm64/boot/dts/allwinner/Makefile +@@ -23,6 +23,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb ++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h313-x96q-lpddr3.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-emlid-neutis-n5-devboard.dtb + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h313-x96q-lpddr3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h313-x96q-lpddr3.dts +new file mode 100644 +index 0000000..ba48e0d +--- /dev/null ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h313-x96q-lpddr3.dts +@@ -0,0 +1,491 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2023 Arm Ltd. ++ */ ++ ++/dts-v1/; ++ ++#include "sun50i-h616.dtsi" ++#include "sun50i-h616-cpu-opp.dtsi" ++#include "sun50i-h618-cpu-dvfs.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ model = "X96Q TV-Box"; ++ compatible = "x96q,tv-box", "allwinner,sun50i-h616"; ++ ++ aliases { ++ serial0 = &uart0; ++ serial2 = &uart2; ++ serial3 = &uart3; ++ serial4 = &uart4; ++ serial5 = &uart5; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ connector { ++ compatible = "hdmi-connector"; ++ type = "d"; ++ ++ port { ++ hdmi_con_in: endpoint { ++ remote-endpoint = <&hdmi_out_con>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ label = "green_led"; ++ gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */ ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ 100m_link { ++ label = "100m_link"; ++ gpios = <&pio 2 15 GPIO_ACTIVE_HIGH>; /* PC15 */ ++ default-state = "off"; ++ }; ++ ++ 100m_act { ++ label = "100m_act"; ++ gpios = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ ++ default-state = "off"; ++ }; ++ }; ++ ++ reg_vcc5v: vcc5v { ++ /* board wide 5V supply directly from the USB-C socket */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-5v"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ /* SY8089 DC/DC converter */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <®_vcc5v>; ++ regulator-always-on; ++ }; ++ ++ reg_vcc_wifi_io: vcc-wifi-io { ++ /* Always on 1.8V/300mA regulator for WiFi and BT IO */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-wifi-io"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ vin-supply = <®_vcc3v3>; ++ }; ++ ++ wifi_pwrseq: wifi-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ clocks = <&rtc 1>; ++ clock-names = "osc32k-out"; ++ reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */ ++ post-power-on-delay-ms = <200>; ++ }; ++ ++ ac200_pwm_clk: ac200_clk { ++ compatible = "pwm-clock"; ++ #clock-cells = <0>; ++ // pwm5 period_ns = 500 > 334 for select 24M clock. ++ pwms = <&pwm 5 500 0>; ++ clock-frequency = <2000000>; ++ status = "okay"; ++ }; ++ ++ soc { ++ pwm: pwm@300a000 { ++ compatible = "allwinner,sun50i-h616-pwm"; ++ reg = <0x0300a000 0x400>; ++ clocks = <&osc24M>, <&ccu CLK_BUS_PWM>; ++ clock-names = "mod", "bus"; ++ resets = <&ccu RST_BUS_PWM>; ++ pwm-number = <6>; ++ pwm-base = <0x0>; ++ sunxi-pwms = <&pwm0>, <&pwm1>, <&pwm2>, <&pwm3>, <&pwm4>, <&pwm5>; ++ #pwm-cells = <3>; ++ status = "okay"; ++ }; ++ ++ pwm0: pwm0@0300a000 { ++ compatible = "allwinner,sunxi-pwm0"; ++ }; ++ ++ pwm1: pwm1@0300a000 { ++ compatible = "allwinner,sunxi-pwm1"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm1_ph_pin>; ++ }; ++ ++ pwm2: pwm2@0300a000 { ++ compatible = "allwinner,sunxi-pwm2"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm2_ph_pin>; ++ }; ++ ++ pwm3: pwm3@0300a000 { ++ compatible = "allwinner,sunxi-pwm3"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm3_ph_pin>; ++ }; ++ ++ pwm4: pwm4@0300a000 { ++ compatible = "allwinner,sunxi-pwm4"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm4_ph_pin>; ++ }; ++ ++ pwm5: pwm5@0300a000 { ++ compatible = "allwinner,sunxi-pwm5"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm5_pin>; ++ clk_bypass_output = <0x1>; ++ status = "okay"; ++ }; ++ }; ++}; ++ ++&de { ++ status = "okay"; ++}; ++ ++&hdmi { ++ status = "okay"; ++}; ++ ++&hdmi_out { ++ hdmi_out_con: endpoint { ++ remote-endpoint = <&hdmi_con_in>; ++ }; ++}; ++ ++&gpu { ++ mali-supply = <®_dcdc1>; ++ status = "disabled"; ++}; ++ ++&mmc0 { ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ bus-width = <4>; ++ vmmc-supply = <®_dldo1>; ++ max-frequency = <50000000>; ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc_wifi_io>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ mmc-ddr-1_8v; ++ status = "okay"; ++}; ++ ++&emac0 { ++ status = "disabled"; ++}; ++ ++&emac1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&rmii_pins>; ++ phy-mode = "rmii"; ++ phy-handle = <&rmii_phy>; ++ phy-supply = <®_dldo1>; ++ allwinner,rx-delay-ps = <3100>; ++ allwinner,tx-delay-ps = <700>; ++ status = "okay"; ++}; ++ ++&mdio1 { ++ rmii_phy: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <1>; ++ }; ++}; ++ ++&ehci0 { ++ status = "disabled"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ehci2 { ++ status = "okay"; ++}; ++ ++&ehci3 { ++ status = "okay"; ++}; ++ ++&ohci0 { ++ status = "disabled"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&ohci2 { ++ status = "okay"; ++}; ++ ++&ohci3 { ++ status = "okay"; ++}; ++ ++&ir { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ir_rx_pin>; ++ status = "okay"; ++}; ++ ++&spi0 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>; ++ ++ flash@0 { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <40000000>; ++ }; ++}; ++ ++&spi1 { ++ status = "disabled"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi1_pins>, <&spi1_cs1_pin>; ++ ++ spidev@1 { ++ compatible = "rohm,dh2228fv"; ++ status = "disabled"; ++ reg = <1>; ++ spi-max-frequency = <1000000>; ++ }; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_ph_pins>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2_pi_pins>; ++ status = "disabled"; ++}; ++ ++&uart3 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart3_pi_pins>; ++ status = "disabled"; ++}; ++ ++&uart4 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart4_pi_pins>; ++ status = "disabled"; ++}; ++ ++&uart5 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart5_ph_pins>; ++ status = "disabled"; ++}; ++ ++&i2c3 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c3_pa_pins>; ++ ++ ac200_x: mfd@10 { ++ compatible = "x-powers,ac200-sunxi"; ++ reg = <0x10>; ++ clocks = <&ac200_pwm_clk>; ++ // ephy id ++ nvmem-cells = <&ephy_calibration>; ++ nvmem-cell-names = "calibration"; ++ ++ ac200_ephy: phy { ++ compatible = "x-powers,ac200-ephy-sunxi"; ++ status = "okay"; ++ }; ++ }; ++}; ++ ++&i2c4 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c4_ph_pins>; ++ status = "disabled"; ++}; ++ ++&usbotg { ++ /* ++ * PHY0 pins are connected to a USB-C socket, but a role switch ++ * is not implemented: both CC pins are pulled to GND. ++ * The VBUS pins power the device, so a fixed peripheral mode ++ * is the best choice. ++ * The board can be powered via GPIOs, in this case port0 *can* ++ * act as a host (with a cable/adapter ignoring CC), as VBUS is ++ * then provided by the GPIOs. Any user of this setup would ++ * need to adjust the DT accordingly: dr_mode set to "host", ++ * enabling OHCI0 and EHCI0. ++ */ ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_vcc5v>; ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++ status = "okay"; ++}; ++ ++&sid { ++ ephy_calibration: ephy-calibration@2c { ++ reg = <0x2c 0x2>; ++ }; ++}; ++ ++&cpu_temp_critical { ++ temperature = <100000>; ++}; ++ ++&gpu_temp_critical { ++ temperature = <100000>; ++}; ++ ++&ve_temp_critical { ++ temperature = <100000>; ++}; ++ ++&ddr_temp_critical { ++ temperature = <100000>; ++}; ++ ++&pio { ++ vcc-pc-supply = <®_dldo1>; ++ vcc-pf-supply = <®_dldo1>; ++ vcc-pg-supply = <®_aldo1>; ++ vcc-ph-supply = <®_dldo1>; ++ vcc-pi-supply = <®_dldo1>; ++ ++ /omit-if-no-ref/ ++ i2c0_pi_pins: i2c0-pi-pins { ++ pins = "PI5", "PI6"; ++ function = "i2c0"; ++ }; ++ ++ /omit-if-no-ref/ ++ i2c1_pi_pins: i2c1-pi-pins { ++ pins = "PI7", "PI8"; ++ function = "i2c1"; ++ }; ++ ++ /omit-if-no-ref/ ++ i2c2_pi_pins: i2c2-pi-pins { ++ pins = "PI9", "PI10"; ++ function = "i2c2"; ++ }; ++ ++ i2c3_pa_pins: i2c3-pa-pins { ++ pins = "PA10", "PA11"; ++ function = "i2c3"; ++ bias-pull-up; ++ }; ++ ++ /omit-if-no-ref/ ++ i2c4_ph_pins: i2c4-ph-pins { ++ pins = "PH6", "PH7"; ++ function = "i2c4"; ++ }; ++ ++ /omit-if-no-ref/ ++ uart2_pi_pins: uart2-pi-pins { ++ pins = "PI5", "PI6"; ++ function = "uart2"; ++ }; ++ ++ /omit-if-no-ref/ ++ uart3_pi_pins: uart3-pi-pins { ++ pins = "PI9", "PI10"; ++ function = "uart3"; ++ }; ++ ++ /omit-if-no-ref/ ++ uart4_pi_pins: uart4-pi-pins { ++ pins = "PI13", "PI14"; ++ function = "uart4"; ++ }; ++ ++ /omit-if-no-ref/ ++ uart5_ph_pins: uart5-ph-pins { ++ pins = "PH2", "PH3"; ++ function = "uart5"; ++ }; ++ ++ /omit-if-no-ref/ ++ spi1_cs1_pin: spi1-cs1-pin { ++ pins = "PH9"; ++ function = "spi1"; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm1_ph_pin: pwm1-ph-pin { ++ pins = "PH3"; ++ function = "pwm1"; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm2_ph_pin: pwm2-ph-pin { ++ pins = "PH2"; ++ function = "pwm2"; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm3_ph_pin: pwm3-ph-pin { ++ pins = "PH0"; ++ function = "pwm3"; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm4_ph_pin: pwm4-ph-pin { ++ pins = "PH1"; ++ function = "pwm4"; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm5_pin: pwm5-pin { ++ pins = "PA12"; ++ function = "pwm5"; ++ }; ++}; + diff --git a/patch/kernel/archive/sunxi-6.6/series.armbian b/patch/kernel/archive/sunxi-6.6/series.armbian index 7b0ac6d72871..35f6a16a54a7 100644 --- a/patch/kernel/archive/sunxi-6.6/series.armbian +++ b/patch/kernel/archive/sunxi-6.6/series.armbian @@ -78,6 +78,7 @@ patches.armbian/arm64-dts-allwinner-sun50i-h616-Add-VPU-node.patch patches.armbian/arm64-dts-sun50i-h616-x96-mate-T95-eth-sd-card-hack.patch patches.armbian/arm64-dts-sun50i-h616-x96-mate-add-hdmi.patch + patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch patches.armbian/arm64-dts-allwinner-h616-Add-device-node-for-SID.patch patches.armbian/arm64-dts-allwinner-h616-Add-efuse_xlate-cpu-frequency-scaling-.patch patches.armbian/arm64-dts-allwinner-h616-Add-thermal-sensor-and-thermal-zones.patch diff --git a/patch/kernel/archive/sunxi-6.6/series.conf b/patch/kernel/archive/sunxi-6.6/series.conf index b423b98f30f4..b6827a5f2d1e 100644 --- a/patch/kernel/archive/sunxi-6.6/series.conf +++ b/patch/kernel/archive/sunxi-6.6/series.conf @@ -330,6 +330,7 @@ patches.armbian/arm64-dts-allwinner-sun50i-h616-Add-VPU-node.patch patches.armbian/arm64-dts-sun50i-h616-x96-mate-T95-eth-sd-card-hack.patch patches.armbian/arm64-dts-sun50i-h616-x96-mate-add-hdmi.patch + patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch patches.armbian/arm64-dts-allwinner-h616-Add-device-node-for-SID.patch patches.armbian/arm64-dts-allwinner-h616-Add-efuse_xlate-cpu-frequency-scaling-.patch patches.armbian/arm64-dts-allwinner-h616-Add-thermal-sensor-and-thermal-zones.patch diff --git a/patch/kernel/archive/sunxi-6.7/patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch b/patch/kernel/archive/sunxi-6.7/patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch new file mode 100644 index 000000000000..2964914428b2 --- /dev/null +++ b/patch/kernel/archive/sunxi-6.7/patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch @@ -0,0 +1,511 @@ +diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile +index a957365..812685d 100644 +--- a/arch/arm64/boot/dts/allwinner/Makefile ++++ b/arch/arm64/boot/dts/allwinner/Makefile +@@ -23,6 +23,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb ++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h313-x96q-lpddr3.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-emlid-neutis-n5-devboard.dtb + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h313-x96q-lpddr3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h313-x96q-lpddr3.dts +new file mode 100644 +index 0000000..ba48e0d +--- /dev/null ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h313-x96q-lpddr3.dts +@@ -0,0 +1,491 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2023 Arm Ltd. ++ */ ++ ++/dts-v1/; ++ ++#include "sun50i-h616.dtsi" ++#include "sun50i-h616-cpu-opp.dtsi" ++#include "sun50i-h618-cpu-dvfs.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ model = "X96Q TV-Box"; ++ compatible = "x96q,tv-box", "allwinner,sun50i-h616"; ++ ++ aliases { ++ serial0 = &uart0; ++ serial2 = &uart2; ++ serial3 = &uart3; ++ serial4 = &uart4; ++ serial5 = &uart5; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ connector { ++ compatible = "hdmi-connector"; ++ type = "d"; ++ ++ port { ++ hdmi_con_in: endpoint { ++ remote-endpoint = <&hdmi_out_con>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ label = "green_led"; ++ gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */ ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ 100m_link { ++ label = "100m_link"; ++ gpios = <&pio 2 15 GPIO_ACTIVE_HIGH>; /* PC15 */ ++ default-state = "off"; ++ }; ++ ++ 100m_act { ++ label = "100m_act"; ++ gpios = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ ++ default-state = "off"; ++ }; ++ }; ++ ++ reg_vcc5v: vcc5v { ++ /* board wide 5V supply directly from the USB-C socket */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-5v"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ /* SY8089 DC/DC converter */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <®_vcc5v>; ++ regulator-always-on; ++ }; ++ ++ reg_vcc_wifi_io: vcc-wifi-io { ++ /* Always on 1.8V/300mA regulator for WiFi and BT IO */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-wifi-io"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ vin-supply = <®_vcc3v3>; ++ }; ++ ++ wifi_pwrseq: wifi-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ clocks = <&rtc 1>; ++ clock-names = "osc32k-out"; ++ reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */ ++ post-power-on-delay-ms = <200>; ++ }; ++ ++ ac200_pwm_clk: ac200_clk { ++ compatible = "pwm-clock"; ++ #clock-cells = <0>; ++ // pwm5 period_ns = 500 > 334 for select 24M clock. ++ pwms = <&pwm 5 500 0>; ++ clock-frequency = <2000000>; ++ status = "okay"; ++ }; ++ ++ soc { ++ pwm: pwm@300a000 { ++ compatible = "allwinner,sun50i-h616-pwm"; ++ reg = <0x0300a000 0x400>; ++ clocks = <&osc24M>, <&ccu CLK_BUS_PWM>; ++ clock-names = "mod", "bus"; ++ resets = <&ccu RST_BUS_PWM>; ++ pwm-number = <6>; ++ pwm-base = <0x0>; ++ sunxi-pwms = <&pwm0>, <&pwm1>, <&pwm2>, <&pwm3>, <&pwm4>, <&pwm5>; ++ #pwm-cells = <3>; ++ status = "okay"; ++ }; ++ ++ pwm0: pwm0@0300a000 { ++ compatible = "allwinner,sunxi-pwm0"; ++ }; ++ ++ pwm1: pwm1@0300a000 { ++ compatible = "allwinner,sunxi-pwm1"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm1_ph_pin>; ++ }; ++ ++ pwm2: pwm2@0300a000 { ++ compatible = "allwinner,sunxi-pwm2"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm2_ph_pin>; ++ }; ++ ++ pwm3: pwm3@0300a000 { ++ compatible = "allwinner,sunxi-pwm3"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm3_ph_pin>; ++ }; ++ ++ pwm4: pwm4@0300a000 { ++ compatible = "allwinner,sunxi-pwm4"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm4_ph_pin>; ++ }; ++ ++ pwm5: pwm5@0300a000 { ++ compatible = "allwinner,sunxi-pwm5"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm5_pin>; ++ clk_bypass_output = <0x1>; ++ status = "okay"; ++ }; ++ }; ++}; ++ ++&de { ++ status = "okay"; ++}; ++ ++&hdmi { ++ status = "okay"; ++}; ++ ++&hdmi_out { ++ hdmi_out_con: endpoint { ++ remote-endpoint = <&hdmi_con_in>; ++ }; ++}; ++ ++&gpu { ++ mali-supply = <®_dcdc1>; ++ status = "disabled"; ++}; ++ ++&mmc0 { ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ bus-width = <4>; ++ vmmc-supply = <®_dldo1>; ++ max-frequency = <50000000>; ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc_wifi_io>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ mmc-ddr-1_8v; ++ status = "okay"; ++}; ++ ++&emac0 { ++ status = "disabled"; ++}; ++ ++&emac1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&rmii_pins>; ++ phy-mode = "rmii"; ++ phy-handle = <&rmii_phy>; ++ phy-supply = <®_dldo1>; ++ allwinner,rx-delay-ps = <3100>; ++ allwinner,tx-delay-ps = <700>; ++ status = "okay"; ++}; ++ ++&mdio1 { ++ rmii_phy: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <1>; ++ }; ++}; ++ ++&ehci0 { ++ status = "disabled"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ehci2 { ++ status = "okay"; ++}; ++ ++&ehci3 { ++ status = "okay"; ++}; ++ ++&ohci0 { ++ status = "disabled"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&ohci2 { ++ status = "okay"; ++}; ++ ++&ohci3 { ++ status = "okay"; ++}; ++ ++&ir { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ir_rx_pin>; ++ status = "okay"; ++}; ++ ++&spi0 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>; ++ ++ flash@0 { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <40000000>; ++ }; ++}; ++ ++&spi1 { ++ status = "disabled"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi1_pins>, <&spi1_cs1_pin>; ++ ++ spidev@1 { ++ compatible = "rohm,dh2228fv"; ++ status = "disabled"; ++ reg = <1>; ++ spi-max-frequency = <1000000>; ++ }; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_ph_pins>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2_pi_pins>; ++ status = "disabled"; ++}; ++ ++&uart3 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart3_pi_pins>; ++ status = "disabled"; ++}; ++ ++&uart4 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart4_pi_pins>; ++ status = "disabled"; ++}; ++ ++&uart5 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart5_ph_pins>; ++ status = "disabled"; ++}; ++ ++&i2c3 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c3_pa_pins>; ++ ++ ac200_x: mfd@10 { ++ compatible = "x-powers,ac200-sunxi"; ++ reg = <0x10>; ++ clocks = <&ac200_pwm_clk>; ++ // ephy id ++ nvmem-cells = <&ephy_calibration>; ++ nvmem-cell-names = "calibration"; ++ ++ ac200_ephy: phy { ++ compatible = "x-powers,ac200-ephy-sunxi"; ++ status = "okay"; ++ }; ++ }; ++}; ++ ++&i2c4 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c4_ph_pins>; ++ status = "disabled"; ++}; ++ ++&usbotg { ++ /* ++ * PHY0 pins are connected to a USB-C socket, but a role switch ++ * is not implemented: both CC pins are pulled to GND. ++ * The VBUS pins power the device, so a fixed peripheral mode ++ * is the best choice. ++ * The board can be powered via GPIOs, in this case port0 *can* ++ * act as a host (with a cable/adapter ignoring CC), as VBUS is ++ * then provided by the GPIOs. Any user of this setup would ++ * need to adjust the DT accordingly: dr_mode set to "host", ++ * enabling OHCI0 and EHCI0. ++ */ ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_vcc5v>; ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++ status = "okay"; ++}; ++ ++&sid { ++ ephy_calibration: ephy-calibration@2c { ++ reg = <0x2c 0x2>; ++ }; ++}; ++ ++&cpu_temp_critical { ++ temperature = <100000>; ++}; ++ ++&gpu_temp_critical { ++ temperature = <100000>; ++}; ++ ++&ve_temp_critical { ++ temperature = <100000>; ++}; ++ ++&ddr_temp_critical { ++ temperature = <100000>; ++}; ++ ++&pio { ++ vcc-pc-supply = <®_dldo1>; ++ vcc-pf-supply = <®_dldo1>; ++ vcc-pg-supply = <®_aldo1>; ++ vcc-ph-supply = <®_dldo1>; ++ vcc-pi-supply = <®_dldo1>; ++ ++ /omit-if-no-ref/ ++ i2c0_pi_pins: i2c0-pi-pins { ++ pins = "PI5", "PI6"; ++ function = "i2c0"; ++ }; ++ ++ /omit-if-no-ref/ ++ i2c1_pi_pins: i2c1-pi-pins { ++ pins = "PI7", "PI8"; ++ function = "i2c1"; ++ }; ++ ++ /omit-if-no-ref/ ++ i2c2_pi_pins: i2c2-pi-pins { ++ pins = "PI9", "PI10"; ++ function = "i2c2"; ++ }; ++ ++ i2c3_pa_pins: i2c3-pa-pins { ++ pins = "PA10", "PA11"; ++ function = "i2c3"; ++ bias-pull-up; ++ }; ++ ++ /omit-if-no-ref/ ++ i2c4_ph_pins: i2c4-ph-pins { ++ pins = "PH6", "PH7"; ++ function = "i2c4"; ++ }; ++ ++ /omit-if-no-ref/ ++ uart2_pi_pins: uart2-pi-pins { ++ pins = "PI5", "PI6"; ++ function = "uart2"; ++ }; ++ ++ /omit-if-no-ref/ ++ uart3_pi_pins: uart3-pi-pins { ++ pins = "PI9", "PI10"; ++ function = "uart3"; ++ }; ++ ++ /omit-if-no-ref/ ++ uart4_pi_pins: uart4-pi-pins { ++ pins = "PI13", "PI14"; ++ function = "uart4"; ++ }; ++ ++ /omit-if-no-ref/ ++ uart5_ph_pins: uart5-ph-pins { ++ pins = "PH2", "PH3"; ++ function = "uart5"; ++ }; ++ ++ /omit-if-no-ref/ ++ spi1_cs1_pin: spi1-cs1-pin { ++ pins = "PH9"; ++ function = "spi1"; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm1_ph_pin: pwm1-ph-pin { ++ pins = "PH3"; ++ function = "pwm1"; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm2_ph_pin: pwm2-ph-pin { ++ pins = "PH2"; ++ function = "pwm2"; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm3_ph_pin: pwm3-ph-pin { ++ pins = "PH0"; ++ function = "pwm3"; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm4_ph_pin: pwm4-ph-pin { ++ pins = "PH1"; ++ function = "pwm4"; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm5_pin: pwm5-pin { ++ pins = "PA12"; ++ function = "pwm5"; ++ }; ++}; + diff --git a/patch/kernel/archive/sunxi-6.7/series.armbian b/patch/kernel/archive/sunxi-6.7/series.armbian index ce3bb1fd9a8c..aec7f06b338c 100644 --- a/patch/kernel/archive/sunxi-6.7/series.armbian +++ b/patch/kernel/archive/sunxi-6.7/series.armbian @@ -89,6 +89,7 @@ patches.armbian/arm64-dts-allwinner-sun50i-h616-Add-VPU-node.patch patches.armbian/arm64-dts-sun50i-h616-x96-mate-T95-eth-sd-card-hack.patch patches.armbian/arm64-dts-sun50i-h616-x96-mate-add-hdmi.patch + patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch patches.armbian/arm64-dts-allwinner-h616-Add-device-node-for-SID.patch patches.armbian/arm64-dts-allwinner-h616-Add-efuse_xlate-cpu-frequency-scaling-v1_6_2.patch patches.armbian/arm64-dts-allwinner-h616-Add-thermal-sensor-and-thermal-zones.patch diff --git a/patch/kernel/archive/sunxi-6.7/series.conf b/patch/kernel/archive/sunxi-6.7/series.conf index 7bf43c144ff0..6f673c115e8c 100644 --- a/patch/kernel/archive/sunxi-6.7/series.conf +++ b/patch/kernel/archive/sunxi-6.7/series.conf @@ -411,6 +411,7 @@ patches.armbian/arm64-dts-allwinner-sun50i-h616-Add-VPU-node.patch patches.armbian/arm64-dts-sun50i-h616-x96-mate-T95-eth-sd-card-hack.patch patches.armbian/arm64-dts-sun50i-h616-x96-mate-add-hdmi.patch + patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch patches.armbian/arm64-dts-allwinner-h616-Add-device-node-for-SID.patch patches.armbian/arm64-dts-allwinner-h616-Add-efuse_xlate-cpu-frequency-scaling-v1_6_2.patch patches.armbian/arm64-dts-allwinner-h616-Add-thermal-sensor-and-thermal-zones.patch diff --git a/patch/u-boot/u-boot-sunxi/arm64-sun50i-h313-add-x96q-lpddr3-defconfig.patch b/patch/u-boot/u-boot-sunxi/arm64-sun50i-h313-add-x96q-lpddr3-defconfig.patch new file mode 100644 index 000000000000..a4b1eaf5fd86 --- /dev/null +++ b/patch/u-boot/u-boot-sunxi/arm64-sun50i-h313-add-x96q-lpddr3-defconfig.patch @@ -0,0 +1,241 @@ +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -836,6 +836,7 @@ + dtb-$(CONFIG_MACH_SUN50I_H616) += \ + sun50i-h616-orangepi-zero2.dtb \ + sun50i-h618-orangepi-zero3.dtb \ ++ sun50i-h313-x96q-lpddr3.dtb \ + sun50i-h616-x96-mate.dtb + + +diff --git a/configs/x96q_lpddr3_defconfig b/configs/x96q_lpddr3_defconfig ++ new file mode 100755 ++ index 000000000..306157b84 ++++ b/configs/x96q_lpddr3_defconfig +@@ -0,0 +1,34 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_DEFAULT_DEVICE_TREE="sun50i-h313-x96q-lpddr3" ++CONFIG_SPL=y ++CONFIG_SUNXI_DRAM_H616_LPDDR3=y ++CONFIG_DRAM_CLK=600 ++CONFIG_DRAM_SUN50I_H616_DX_ODT=0x06060606 ++CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0d0d0d0d ++CONFIG_DRAM_SUN50I_H616_CA_DRI=0x00000d0d ++CONFIG_DRAM_SUN50I_H616_ODT_EN=0x00000001 ++CONFIG_DRAM_SUN50I_H616_TPR0=0x0 ++CONFIG_DRAM_SUN50I_H616_TPR2=0x00000000 ++CONFIG_DRAM_SUN50I_H616_TPR10=0x002f3359 ++CONFIG_DRAM_SUN50I_H616_TPR11=0xaa889967 ++CONFIG_DRAM_SUN50I_H616_TPR12=0xeeee8979 ++CONFIG_MACH_SUN50I_H616=y ++CONFIG_R_I2C_ENABLE=y ++CONFIG_SPL_I2C=y ++CONFIG_SPL_I2C_SUPPORT=y ++CONFIG_SPL_SYS_I2C_LEGACY=y ++CONFIG_SYS_I2C_MVTWSI=y ++CONFIG_SYS_I2C_SLAVE=0x7f ++CONFIG_SYS_I2C_SPEED=100000 ++CONFIG_SYS_MONITOR_LEN=786432 ++CONFIG_PHY_REALTEK=y ++CONFIG_SUN8I_EMAC=y ++CONFIG_I2C3_ENABLE=y ++CONFIG_AXP313_POWER=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_OHCI_HCD=y ++CONFIG_USB_MUSB_GADGET=y ++CONFIG_SUPPORT_EMMC_BOOT=y ++CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x40 ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 + +diff --git a/arch/arm/dts/sun50i-h313-x96q-lpddr3.dts b/arch/arm/dts/sun50i-h313-x96q-lpddr3.dts +new file mode 100644 +index 000000000..306157b84 +--- /dev/null ++++ b/arch/arm/dts/sun50i-h313-x96q-lpddr3.dts +@@ -0,0 +1,181 @@ ++// SPDX-License-Identifier: (GPL-2.0+ or MIT) ++//* ++//* Copyright (C) 2020 Arm Ltd. ++//* ++ ++/dts-v1/; ++ ++#include ++#include ++#include ++#include ++ ++/ { ++ model = "X96Q TV-Box"; ++ compatible = "x96q,tv-box", "allwinner,sun50i-h616"; ++ ++ aliases { ++ ethernet0 = &emac0; ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */ ++ default-state = "on"; ++ }; ++ ++ led-1 { ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */ ++ }; ++ }; ++ ++ reg_vcc5v: vcc5v { ++ /* board wide 5V supply directly from the USB-C socket */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-5v"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ }; ++ ++ reg_usb1_vbus: usb1-vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb1-vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <®_vcc5v>; ++ enable-active-high; ++ gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ ++ status = "okay"; ++ }; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++/* USB 2 & 3 are on headers only. */ ++ ++&emac0 { ++ status = "disabled"; ++}; ++ ++&mmc0 { ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ bus-width = <4>; ++ status = "okay"; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&r_i2c { ++ status = "okay"; ++ ++ axp313a: pmic@36 { ++ compatible = "x-powers,axp313a"; ++ status = "okay"; ++ reg = <0x36>; ++ wakeup-source; ++ ++ standby_param: standby_param { ++ vcc-dram = <0x4>; ++ }; ++ ++ regulators{ ++ reg_dcdc1: dcdc1 { ++ regulator-name = "axp313a-dcdc1"; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <3400000>; ++ regulator-step-delay-us = <25>; ++ regulator-final-delay-us = <50>; ++ regulator-always-on; ++ }; ++ ++ reg_dcdc2: dcdc2 { ++ regulator-name = "axp313a-dcdc2"; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1540000>; ++ regulator-step-delay-us = <25>; ++ regulator-final-delay-us = <50>; ++ regulator-ramp-delay = <200>; ++ regulator-always-on; ++ }; ++ ++ reg_dcdc3: dcdc3 { ++ regulator-name = "axp313a-dcdc3"; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1100000>; ++ regulator-step-delay-us = <25>; ++ regulator-final-delay-us = <50>; ++ regulator-always-on; ++ }; ++ ++ reg_aldo1: aldo1 { ++ regulator-name = "axp313a-aldo1"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-step-delay-us = <25>; ++ regulator-final-delay-us = <50>; ++ regulator-always-on; ++ }; ++ ++ reg_dldo1: dldo1 { ++ regulator-name = "axp313a-dldo1"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-step-delay-us = <25>; ++ regulator-final-delay-us = <50>; ++ regulator-always-on; ++ }; ++ }; ++ }; ++}; ++ ++&spi0 { ++ status = "okay"; ++ ++ flash@0 { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <40000000>; ++ }; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_ph_pins>; ++ status = "okay"; ++}; ++ ++&usbotg { ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_usb1_vbus>; ++ status = "okay"; ++}; + + +