Skip to contentSkip to conversation

sunxi: devicetree updates plus new boards

PATCH New Andre Przywara 1 participant 5 messages Apr 24, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover sunxi: devicetree updates plus new boards

This updates the Allwinner related devicetree files from the Linux kernel repository. The files were taken from Linux v6.9-rc4, and adjusted to increase compatibility with older kernels.

This also adds board support for two new devices: the old Remix Mini PC, a TV box like "Android desktop" device from 2015, and the Tanix TX1, which is a tiny TV box with an H313 SoC.
The DT for the latter is preliminary for now, as it hasn't been merged into Linus' tree yet - though that's supposed to happen in about a few weeks time.

Please have a look!

Cheers,
Andre

Andre Przywara (4):
sunxi: dts: arm/arm64: update devicetree files from Linux-v6.9-rc4
sunxi: a64: Add Remix Mini PC support
[DO NOT MERGE] sunxi: dts: arm64: add Tanix TX1 DT from Linux
sunxi: H616: add Tanix TX1 support

 arch/arm/dts/Makefile                         |   4 +-
 arch/arm/dts/sun50i-h313-tanix-tx1.dts        | 183 +++++++++
 arch/arm/dts/sun50i-h6-beelink-gs1.dts        |   2 +
 arch/arm/dts/sun50i-h6-tanix.dtsi             |   2 +
 arch/arm/dts/sun50i-h6.dtsi                   |   7 +-
 .../dts/sun50i-h616-bigtreetech-cb1-manta.dts |   2 +-
 arch/arm/dts/sun50i-h616-bigtreetech-cb1.dtsi |   4 +-
 arch/arm/dts/sun50i-h616-bigtreetech-pi.dts   |   2 +-
 arch/arm/dts/sun50i-h616.dtsi                 | 155 ++++++++
 .../arm/dts/sun50i-h618-longan-module-3h.dtsi |  75 ++++
 arch/arm/dts/sun50i-h618-longanpi-3h.dts      | 144 +++++++
 .../arm/dts/sun50i-h618-transpeed-8k618-t.dts |  23 ++
 arch/arm/dts/sun50i-h64-remix-mini-pc.dts     | 356 ++++++++++++++++++
 arch/arm/dts/sun8i-r40-feta40i.dtsi           |   7 +
 configs/remix-mini-pc_defconfig               |  14 +
 configs/tanix_tx1_defconfig                   |  25 ++
 16 files changed, 996 insertions(+), 9 deletions(-)
 create mode 100644 arch/arm/dts/sun50i-h313-tanix-tx1.dts
 create mode 100644 arch/arm/dts/sun50i-h618-longan-module-3h.dtsi
 create mode 100644 arch/arm/dts/sun50i-h618-longanpi-3h.dts
 create mode 100644 arch/arm/dts/sun50i-h64-remix-mini-pc.dts
 create mode 100644 configs/remix-mini-pc_defconfig
 create mode 100644 configs/tanix_tx1_defconfig
Signature · 1 line
2.35.8
#1 lore raw

PATCH 1/4 sunxi: dts: arm/arm64: update devicetree files from Linux-v6.9-rc4

Sync the devicetree files from the official Linux kernel tree, v6.9-rc4. This is covering Allwinner SoCs with 32-bit and 64-bit ARM cores.

Besides some cosmectic changes, this adds S/PDIF, DMA, and thermal support to the H616 .dtsi. Nothing that U-Boot needs for itself, but helpful to pass on to kernels.
This also adds new devicetrees, for some LonganPi H616 board, and the Remix Mini PC. The latter will get a defconfig next.

As before, this omits the non-backwards compatible changes to the R_INTC controller, to remain compatible with older kernels.

---
 arch/arm/dts/sun50i-h6-beelink-gs1.dts        |   2 +
 arch/arm/dts/sun50i-h6-tanix.dtsi             |   2 +
 arch/arm/dts/sun50i-h6.dtsi                   |   7 +-
 .../dts/sun50i-h616-bigtreetech-cb1-manta.dts |   2 +-
 arch/arm/dts/sun50i-h616-bigtreetech-cb1.dtsi |   4 +-
 arch/arm/dts/sun50i-h616-bigtreetech-pi.dts   |   2 +-
 arch/arm/dts/sun50i-h616.dtsi                 | 155 ++++++++
 .../arm/dts/sun50i-h618-longan-module-3h.dtsi |  75 ++++
 arch/arm/dts/sun50i-h618-longanpi-3h.dts      | 144 +++++++
 .../arm/dts/sun50i-h618-transpeed-8k618-t.dts |  23 ++
 arch/arm/dts/sun50i-h64-remix-mini-pc.dts     | 356 ++++++++++++++++++
 arch/arm/dts/sun8i-r40-feta40i.dtsi           |   7 +
 12 files changed, 771 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/dts/sun50i-h618-longan-module-3h.dtsi
 create mode 100644 arch/arm/dts/sun50i-h618-longanpi-3h.dts
 create mode 100644 arch/arm/dts/sun50i-h64-remix-mini-pc.dts
arch/arm/dts/sun50i-h6-beelink-gs1.dts +2 -0
index d6897ec9799..87432c4f1ff 100644
@@ -291,6 +291,8 @@
 };
 
 &spdif {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spdif_tx_pin>;
 	status = "okay";
 };
 
arch/arm/dts/sun50i-h6-tanix.dtsi +2 -0
index 4903d635811..855b7d43bc5 100644
@@ -166,6 +166,8 @@
 };
 
 &spdif {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spdif_tx_pin>;
 	status = "okay";
 };
 
arch/arm/dts/sun50i-h6.dtsi +3 -4
index 3c85c8cc8ea..09e21689284 100644
@@ -405,6 +405,7 @@
 				function = "spi1";
 			};
 
+			/omit-if-no-ref/
 			spdif_tx_pin: spdif-tx-pin {
 				pins = "PH7";
 				function = "spdif";
@@ -654,10 +655,8 @@
 			clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>;
 			clock-names = "apb", "spdif";
 			resets = <&ccu RST_BUS_SPDIF>;
-			dmas = <&dma 2>;
-			dma-names = "tx";
-			pinctrl-names = "default";
-			pinctrl-0 = <&spdif_tx_pin>;
+			dmas = <&dma 2>, <&dma 2>;
+			dma-names = "rx", "tx";
 			status = "disabled";
 		};
 
arch/arm/dts/sun50i-h616-bigtreetech-cb1-manta.dts +1 -1
index dbce61b355d..4bfb52609c9 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Copyright (C) 2023 Martin Botka <[email protected]>.
  */
arch/arm/dts/sun50i-h616-bigtreetech-cb1.dtsi +2 -2
index 1fed2b46cfe..af421ba24ce 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Copyright (C) 2023 Martin Botka <[email protected]>.
  */
@@ -93,7 +93,7 @@
 		interrupt-controller;
 		#interrupt-cells = <1>;
 
-		regulators{
+		regulators {
 			reg_dcdc1: dcdc1 {
 				regulator-name = "vdd-gpu-sys";
 				regulator-min-microvolt = <810000>;
arch/arm/dts/sun50i-h616-bigtreetech-pi.dts +1 -1
index 832f08b2b26..ff84a379447 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Copyright (C) 2023 Martin Botka <[email protected]>.
  */
arch/arm/dts/sun50i-h616.dtsi +155 -0

278 lines not on this page · raw message

arch/arm/dts/sun50i-h618-longan-module-3h.dtsi new file +75 -0

75 lines not on this page · raw message

arch/arm/dts/sun50i-h618-longanpi-3h.dts new file +144 -0

144 lines not on this page · raw message

arch/arm/dts/sun50i-h618-transpeed-8k618-t.dts +23 -0
index 8ea1fd41aeb..ac0a2b7ea6f 100644
@@ -15,6 +15,7 @@
 	compatible = "transpeed,8k618-t", "allwinner,sun50i-h618";
 
 	aliases {
+		ethernet1 = &sdio_wifi;
 		serial0 = &uart0;
 	};
 
@@ -39,6 +40,15 @@
 		regulator-max-microvolt = <3300000>;
 		regulator-always-on;
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rtc CLK_OSC32K_FANOUT>;
+		clock-names = "ext_clock";
+		pinctrl-0 = <&x32clk_fanout_pin>;
+		pinctrl-names = "default";
+		reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */
+	};
 };
 
 &ehci0 {
@@ -60,6 +70,19 @@
 	status = "okay";
 };
 
+&mmc1 {
+	vmmc-supply = <&reg_dldo1>;
+	vqmmc-supply = <&reg_aldo1>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	sdio_wifi: wifi@1 {
+		reg = <1>;
+	};
+};
+
 &mmc2 {
 	vmmc-supply = <&reg_dldo1>;
 	vqmmc-supply = <&reg_aldo1>;
arch/arm/dts/sun50i-h64-remix-mini-pc.dts new file +356 -0

356 lines not on this page · raw message

arch/arm/dts/sun8i-r40-feta40i.dtsi +7 -0
index 9f39b5a2bb3..c12361d0317 100644
@@ -42,6 +42,13 @@
 	vcc-pg-supply = <&reg_dldo1>;
 };
 
+&reg_aldo1 {
+	regulator-always-on;
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-3v3-tv-usb";
+};
+
 &reg_aldo2 {
 	regulator-always-on;
 	regulator-min-microvolt = <1800000>;
Signature · 1 line
2.35.8
#2 lore raw

PATCH 2/4 sunxi: a64: Add Remix Mini PC support

In reply to Andre Przywara

The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC, which appears to be just a relabelled A64. It was launched in 2015 by the now defunct company Jide, and shipped with a desktop optimised version of Android. Its appearance and feature set is close to a typical TV box.

The devicetree file has been imported from the Linux tree already, so just add a defconfig and enable the DTB build in the Makefile. The SoC has the "secure boot" fuse burnt, so we need to generate a TOC0 image instead of the standard Allwinner eGON image format for the SPL.

---
 arch/arm/dts/Makefile           |  3 ++-
 configs/remix-mini-pc_defconfig | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 configs/remix-mini-pc_defconfig
arch/arm/dts/Makefile +2 -1
index b1c9c6222e5..127345975ef 100644
@@ -801,7 +801,8 @@ dtb-$(CONFIG_MACH_SUN50I) += \
 	sun50i-a64-pinephone-1.2.dtb \
 	sun50i-a64-pinetab.dtb \
 	sun50i-a64-sopine-baseboard.dtb \
-	sun50i-a64-teres-i.dtb
+	sun50i-a64-teres-i.dtb \
+	sun50i-h64-remix-mini-pc.dtb
 dtb-$(CONFIG_MACH_SUN9I) += \
 	sun9i-a80-optimus.dtb \
 	sun9i-a80-cubieboard4.dtb \
configs/remix-mini-pc_defconfig new file +14 -0
new file mode 100644
index 00000000000..fa427a027f8
@@ -0,0 +1,14 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h64-remix-mini-pc"
+CONFIG_SPL=y
+CONFIG_MACH_SUN50I=y
+CONFIG_DRAM_CLK=672
+CONFIG_DRAM_ZQ=4013533
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_SPL_IMAGE_TYPE_SUNXI_TOC0=y
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_CMD_POWEROFF=y
+CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
Signature · 1 line
2.35.8
#3 lore raw

PATCH 3/4 sunxi: dts: arm64: add Tanix TX1 DT from Linux

In reply to Andre Przywara

Add the board DT file for the Tanix TX1 TV box, with the H313 SoC. This has been taken from the sunxi/for-next tree, though it has not been merged into any other tree yet.
So this is a placeholder for now, to enable the board support, and will be superseded by the regular sync of the DT files later.

---
 arch/arm/dts/sun50i-h313-tanix-tx1.dts | 183 +++++++++++++++++++++++++
 1 file changed, 183 insertions(+)
 create mode 100644 arch/arm/dts/sun50i-h313-tanix-tx1.dts
arch/arm/dts/sun50i-h313-tanix-tx1.dts new file +183 -0
new file mode 100644
index 00000000000..bb2cde59bd0
@@ -0,0 +1,183 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2024 Arm Ltd.
+ */
+
+/dts-v1/;
+
+#include "sun50i-h616.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "Tanix TX1";
+	compatible = "oranth,tanix-tx1", "allwinner,sun50i-h616";
+
+	aliases {
+		serial0 = &uart0;
+		ethernet0 = &sdio_wifi;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		key {
+			label = "hidden";
+			linux,code = <BTN_0>;
+			gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led-0 {
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
+			default-state = "on";
+		};
+	};
+
+	wifi_pwrseq: pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rtc CLK_OSC32K_FANOUT>;
+		clock-names = "ext_clock";
+		pinctrl-0 = <&x32clk_fanout_pin>;
+		pinctrl-names = "default";
+		reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */
+	};
+
+	reg_vcc5v: vcc5v {
+		/* board wide 5V supply directly from the DC input */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc-5v";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+};
+
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&ir {
+	status = "okay";
+};
+
+&mmc1 {
+	vmmc-supply = <&reg_dldo1>;
+	vqmmc-supply = <&reg_aldo1>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	sdio_wifi: wifi@1 {
+		reg = <1>;
+	};
+};
+
+&mmc2 {
+	vmmc-supply = <&reg_dldo1>;
+	vqmmc-supply = <&reg_aldo1>;
+	bus-width = <8>;
+	non-removable;
+	max-frequency = <100000000>;
+	cap-mmc-hw-reset;
+	mmc-ddr-1_8v;
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
+&pio {
+	vcc-pc-supply = <&reg_aldo1>;
+	vcc-pf-supply = <&reg_dldo1>;
+	vcc-pg-supply = <&reg_aldo1>;
+	vcc-ph-supply = <&reg_dldo1>;
+	vcc-pi-supply = <&reg_dldo1>;
+};
+
+&r_i2c {
+	status = "okay";
+
+	axp313: pmic@36 {
+		compatible = "x-powers,axp313a";
+		reg = <0x36>;
+		#interrupt-cells = <1>;
+		interrupt-controller;
+
+		vin1-supply = <&reg_vcc5v>;
+		vin2-supply = <&reg_vcc5v>;
+		vin3-supply = <&reg_vcc5v>;
+
+		regulators {
+			/* Supplies VCC-PLL, so needs to be always on. */
+			reg_aldo1: aldo1 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc1v8";
+			};
+
+			/* Supplies VCC-IO, so needs to be always on. */
+			reg_dldo1: dldo1 {
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc3v3";
+			};
+
+			reg_dcdc1: dcdc1 {
+				regulator-always-on;
+				regulator-min-microvolt = <810000>;
+				regulator-max-microvolt = <990000>;
+				regulator-name = "vdd-gpu-sys";
+			};
+
+			reg_dcdc2: dcdc2 {
+				regulator-always-on;
+				regulator-min-microvolt = <810000>;
+				regulator-max-microvolt = <1120000>;
+				regulator-name = "vdd-cpu";
+			};
+
+			reg_dcdc3: dcdc3 {
+				regulator-always-on;
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+				regulator-name = "vdd-dram";
+			};
+		};
+	};
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_ph_pins>;
+	status = "okay";
+};
+
+&usbotg {
+	dr_mode = "host";       /* USB A type receptable */
+	status = "okay";
+};
+
+&usbphy {
+	status = "okay";
+};
Signature · 1 line
2.35.8
#4 lore raw

PATCH 4/4 sunxi: H616: add Tanix TX1 support

In reply to Andre Przywara

The Tanix TX1 is a tiny TV box, featuring the Allwinner H313 SoC with up to 2GB of DRAM and 16GB of eMMC. There is no SD card or Ethernet port on this small device, but it can be booted via the USB debug "FEL" mode. The bootloader could then be written to the eMMC.

Add the defconfig for that board, and add the devicetree file to the Makefile, for it to be built.
The DRAM parameters were taken from the vendor firmware on the eMMC.

---
 arch/arm/dts/Makefile       |  1 +
 configs/tanix_tx1_defconfig | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 configs/tanix_tx1_defconfig
arch/arm/dts/Makefile +1 -0
index 127345975ef..69b0d6a9ad7 100644
@@ -779,6 +779,7 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \
 	sun50i-h6-tanix-tx6.dtb \
 	sun50i-h6-tanix-tx6-mini.dtb
 dtb-$(CONFIG_MACH_SUN50I_H616) += \
+	sun50i-h313-tanix-tx1.dtb \
 	sun50i-h616-orangepi-zero2.dtb \
 	sun50i-h618-orangepi-zero2w.dtb \
 	sun50i-h618-orangepi-zero3.dtb \
configs/tanix_tx1_defconfig new file +25 -0
new file mode 100644
index 00000000000..9915fff4a00
@@ -0,0 +1,25 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h313-tanix-tx1"
+CONFIG_SPL=y
+CONFIG_DRAM_SUN50I_H616_DX_ODT=0x06060606
+CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0d0d0d0d
+CONFIG_DRAM_SUN50I_H616_CA_DRI=0x1919
+CONFIG_DRAM_SUN50I_H616_ODT_EN=0x9988eeee
+CONFIG_DRAM_SUN50I_H616_TPR6=0x2fb08080
+CONFIG_DRAM_SUN50I_H616_TPR10=0x402f4469
+CONFIG_DRAM_SUN50I_H616_TPR11=0x0e0f0d0d
+CONFIG_DRAM_SUN50I_H616_TPR12=0x11131213
+CONFIG_MACH_SUN50I_H616=y
+CONFIG_SUNXI_DRAM_H616_LPDDR3=y
+CONFIG_R_I2C_ENABLE=y
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL_I2C=y
+CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_MVTWSI=y
+CONFIG_SYS_I2C_SLAVE=0x7f
+CONFIG_SYS_I2C_SPEED=400000
+CONFIG_AXP313_POWER=y
+CONFIG_AXP_DCDC3_VOLT=1200
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
Signature · 1 line
2.35.8