Skip to contentSkip to conversation

sunxi: h616: add initial support for T95 AXP313 TV Box

PATCH In review Kamil Kasperski 3 participants 4 messages Mar 9, 2024 – Mar 11, 2024

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

PATCH 1/1 sunxi: h616: add initial support for T95 AXP313 TV Box

T95 is a most commonly known for being a box with a pre-installed malware.
It uses Allwinner H616 and comes with eMMC and DDR3 memory.
This device comes with two versions - one with AXP305 PMIC and another with AXP313 PMIC.
The AXP313 version comes with Secure Boot enabled and locked bootloader, so the u-boot has to be built with TOC0. DRAM settings are taken from Allwinner's boot0 for this box.

Cc Andre Przywara <[email protected]>
---
 arch/arm/dts/Makefile                   |   3 +-
 arch/arm/dts/sun50i-h616-t95-axp313.dts | 148 ++++++++++++++++++++++++
 configs/t95_axp313_defconfig            |  27 +++++
 3 files changed, 177 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/sun50i-h616-t95-axp313.dts
 create mode 100644 configs/t95_axp313_defconfig
arch/arm/dts/Makefile +2 -1
index b102ffb5f6..144daf6c48 100644
@@ -842,7 +842,8 @@ dtb-$(CONFIG_MACH_SUN50I_H616) += \
 	sun50i-h618-orangepi-zero2w.dtb \
 	sun50i-h618-orangepi-zero3.dtb \
 	sun50i-h618-transpeed-8k618-t.dtb \
-	sun50i-h616-x96-mate.dtb
+	sun50i-h616-x96-mate.dtb \
+	sun50i-h616-t95-axp313.dtb
 dtb-$(CONFIG_MACH_SUN50I) += \
 	sun50i-a64-amarula-relic.dtb \
 	sun50i-a64-bananapi-m64.dtb \
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +148 -0

148 lines not on this page · raw message

configs/t95_axp313_defconfig new file +27 -0
new file mode 100644
index 0000000000..6542b5bc88
@@ -0,0 +1,27 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h616-t95-axp313"
+CONFIG_SPL=y
+CONFIG_MACH_SUN50I_H616=y
+CONFIG_DRAM_CLK=648
+CONFIG_DRAM_SUN50I_H616_ODT_EN=0x1
+CONFIG_DRAM_SUN50I_H616_DX_ODT=0x03030303
+CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0e0e0e0e
+CONFIG_DRAM_SUN50I_H616_CA_DRI=0x1c1c
+CONFIG_DRAM_SUN50I_H616_TPR10=0x2f0006
+CONFIG_DRAM_SUN50I_H616_TPR11=0xffffdddd
+CONFIG_DRAM_SUN50I_H616_TPR12=0xfedf7657
+CONFIG_SUNXI_DRAM_H616_DDR3_1333=y
+CONFIG_R_I2C_ENABLE=y
+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_SUPPORT_EMMC_BOOT=y
+CONFIG_AXP313_POWER=y
+CONFIG_AXP_DCDC3_VOLT=1360
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_SUN8I_EMAC=y
+CONFIG_SPL_IMAGE_TYPE_SUNXI_TOC0=y
Signature · 1 line
2.34.1
#1 lore raw

On Sat, 9 Mar 2024 19:24:26 +0000
Kamil Kasperski <[email protected]> wrote:

Hi Kamil,

many thanks for sending a patch, that looks mostly good from the technical point of view, only some smaller comments.

But please note that the devicetree needs to go through the Linux mailing lists and repo first, and we automatically copy it from the Linux tree once it has been merged there. This is to ensure proper review and checks with the Linux tooling.

So can you please send just the .dts file to the DT and sunxi maintainers the respective lists, as reported by get_maintainer.pl? Then we can take it from there.

Quoted 5 lines

T95 is a most commonly known for being a box with a pre-installed malware.
It uses Allwinner H616 and comes with eMMC and DDR3 memory.
This device comes with two versions - one with AXP305 PMIC and another with AXP313 PMIC.
The AXP313 version comes with Secure Boot enabled and locked bootloader, so the u-boot has to be built with TOC0. DRAM settings are taken from Allwinner's boot0 for this box.

Ah, thanks for figuring those out, that's very helpful.

Quoted 32 lines
Cc Andre Przywara <[email protected]>
---
 arch/arm/dts/Makefile                   |   3 +-
 arch/arm/dts/sun50i-h616-t95-axp313.dts | 148 ++++++++++++++++++++++++
 configs/t95_axp313_defconfig            |  27 +++++
 3 files changed, 177 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/sun50i-h616-t95-axp313.dts
 create mode 100644 configs/t95_axp313_defconfig
arch/arm/dts/Makefile +2 -1
index b102ffb5f6..144daf6c48 100644
@@ -842,7 +842,8 @@ dtb-$(CONFIG_MACH_SUN50I_H616) += \
 	sun50i-h618-orangepi-zero2w.dtb \
 	sun50i-h618-orangepi-zero3.dtb \
 	sun50i-h618-transpeed-8k618-t.dtb \
-	sun50i-h616-x96-mate.dtb
+	sun50i-h616-x96-mate.dtb \
+	sun50i-h616-t95-axp313.dtb
 dtb-$(CONFIG_MACH_SUN50I) += \
 	sun50i-a64-amarula-relic.dtb \
 	sun50i-a64-bananapi-m64.dtb \
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +0 -0
new file mode 100644
index 0000000000..b006f363d5

arch/arm/dts/sun50i-h616-t95-axp313.dts line 3

Quoted 3 lines
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +3 -0
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2021 Arm Ltd.

Please change this copyright you and this year.

arch/arm/dts/sun50i-h616-t95-axp313.dts line 15

Quoted 12 lines
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +12 -0
+ */
+
+/dts-v1/;
+
+#include "sun50i-h616.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	model = "T95 (AXP313)";
+	compatible = "mbox,t95-axp313", "allwinner,sun50i-h616";

What is "mbox"? Do you have any more information about this vendor? In any case a new vendor would need to be added to Documentation/devicetree/bindings/vendor-prefixes.yaml, in a separate patch. Also you need a patch to add this compatible combination to Documentation/devicetree/bindings/arm/sunxi.yaml.

Cheers,
Andre

Quoted 166 lines
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +133 -0
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	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;
+	};
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&ehci2 {
+	status = "okay";
+};
+
+&ir {
+	status = "okay";
+};
+
+&mmc0 {
+	cd-gpios = <&pio 8 16 GPIO_ACTIVE_LOW>;	/* PI16 */
+	vmmc-supply = <&reg_dldo1>;
+	status = "okay";
+};
+
+&mmc2 {
+	vmmc-supply = <&reg_dldo1>;
+	vqmmc-supply = <&reg_aldo1>;
+	bus-width = <8>;
+	non-removable;
+	cap-mmc-hw-reset;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
+&ohci2 {
+	status = "okay";
+};
+
+&r_i2c {
+	status = "okay";
+
+	axp313: pmic@36 {
+		compatible = "x-powers,axp313a";
+		reg = <0x36>;
+		#interrupt-cells = <1>;
+		interrupt-controller;
+		interrupt-parent = <&pio>;
+		interrupts = <2 9 IRQ_TYPE_LEVEL_LOW>;	/* PC9 */
+
+		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 = <1100000>;
+				regulator-name = "vdd-cpu";
+			};
+
+			reg_dcdc3: dcdc3 {
+				regulator-always-on;
+				regulator-min-microvolt = <1360000>;
+				regulator-max-microvolt = <1360000>;
+				regulator-name = "vdd-dram";
+			};
+		};
+	};
+};
+
+&pio {
+	vcc-pc-supply = <&reg_aldo1>;
+	vcc-pg-supply = <&reg_dldo1>;
+	vcc-ph-supply = <&reg_dldo1>;
+	vcc-pi-supply = <&reg_dldo1>;
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_ph_pins>;
+	status = "okay";
+};
+
+&usbotg {
+	dr_mode = "host";	/* USB A type receptable */
+	status = "okay";
+};
+
+&usbphy {
+	status = "okay";
+};
configs/t95_axp313_defconfig new file +27 -0
new file mode 100644
index 0000000000..6542b5bc88
@@ -0,0 +1,27 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h616-t95-axp313"
+CONFIG_SPL=y
+CONFIG_MACH_SUN50I_H616=y
+CONFIG_DRAM_CLK=648
+CONFIG_DRAM_SUN50I_H616_ODT_EN=0x1
+CONFIG_DRAM_SUN50I_H616_DX_ODT=0x03030303
+CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0e0e0e0e
+CONFIG_DRAM_SUN50I_H616_CA_DRI=0x1c1c
+CONFIG_DRAM_SUN50I_H616_TPR10=0x2f0006
+CONFIG_DRAM_SUN50I_H616_TPR11=0xffffdddd
+CONFIG_DRAM_SUN50I_H616_TPR12=0xfedf7657
+CONFIG_SUNXI_DRAM_H616_DDR3_1333=y
+CONFIG_R_I2C_ENABLE=y
+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_SUPPORT_EMMC_BOOT=y
+CONFIG_AXP313_POWER=y
+CONFIG_AXP_DCDC3_VOLT=1360
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_SUN8I_EMAC=y
+CONFIG_SPL_IMAGE_TYPE_SUNXI_TOC0=y
#2 lore raw

Hello Andre,
Thanks for your reply and thanks for pointing some stuff out.

Quoted 1 line

What is "mbox"? Do you have any more information about this vendor?

"MBOX" refers to the "Model" string from system properties.
The problem is that it's quite hard to pin the correct vendor, since
the OS is built based on Google Pixel 2.
You can see that the fingerprint contains strings only for this phone:
[ro.build.fingerprint]:
[google/walley/walleye:10/QP1A.191105.004/eng.cmj.20220408.125005:userdebug/test-keys] Setting the device model as Vendor string seemed to be the most safe bet. If you have any other suggestions, please let me know.

Quoted 3 lines

But please note that the devicetree needs to go through the Linux mailing lists and repo first, and we automatically copy it from the Linux tree once it has been merged there.

Thanks for pointing that out. I'll contact Linux maintainers and will send updated patch.

Best regards,
Kamil

niedz., 10 mar 2024 o 23:00 Andre Przywara <[email protected]> napisał(a):

Quoted 253 lines

On Sat, 9 Mar 2024 19:24:26 +0000
Kamil Kasperski <[email protected]> wrote:

Hi Kamil,

many thanks for sending a patch, that looks mostly good from the technical point of view, only some smaller comments.

But please note that the devicetree needs to go through the Linux mailing lists and repo first, and we automatically copy it from the Linux tree once it has been merged there. This is to ensure proper review and checks with the Linux tooling.

So can you please send just the .dts file to the DT and sunxi maintainers the respective lists, as reported by get_maintainer.pl? Then we can take it from there.

Quoted 5 lines

T95 is a most commonly known for being a box with a pre-installed malware.
It uses Allwinner H616 and comes with eMMC and DDR3 memory.
This device comes with two versions - one with AXP305 PMIC and another with AXP313 PMIC.
The AXP313 version comes with Secure Boot enabled and locked bootloader, so the u-boot has to be built with TOC0. DRAM settings are taken from Allwinner's boot0 for this box.

Ah, thanks for figuring those out, that's very helpful.

Quoted 32 lines
Cc Andre Przywara <[email protected]>
---
 arch/arm/dts/Makefile                   |   3 +-
 arch/arm/dts/sun50i-h616-t95-axp313.dts | 148 ++++++++++++++++++++++++
 configs/t95_axp313_defconfig            |  27 +++++
 3 files changed, 177 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/sun50i-h616-t95-axp313.dts
 create mode 100644 configs/t95_axp313_defconfig
arch/arm/dts/Makefile +2 -1
index b102ffb5f6..144daf6c48 100644
@@ -842,7 +842,8 @@ dtb-$(CONFIG_MACH_SUN50I_H616) += \
      sun50i-h618-orangepi-zero2w.dtb \
      sun50i-h618-orangepi-zero3.dtb \
      sun50i-h618-transpeed-8k618-t.dtb \
-     sun50i-h616-x96-mate.dtb
+     sun50i-h616-x96-mate.dtb \
+     sun50i-h616-t95-axp313.dtb
 dtb-$(CONFIG_MACH_SUN50I) += \
      sun50i-a64-amarula-relic.dtb \
      sun50i-a64-bananapi-m64.dtb \
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +0 -0
new file mode 100644
index 0000000000..b006f363d5

arch/arm/dts/sun50i-h616-t95-axp313.dts line 3

Quoted 3 lines
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +3 -0
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2021 Arm Ltd.

Please change this copyright you and this year.

arch/arm/dts/sun50i-h616-t95-axp313.dts line 15

Quoted 12 lines
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +12 -0
+ */
+
+/dts-v1/;
+
+#include "sun50i-h616.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+     model = "T95 (AXP313)";
+     compatible = "mbox,t95-axp313", "allwinner,sun50i-h616";

What is "mbox"? Do you have any more information about this vendor? In any case a new vendor would need to be added to Documentation/devicetree/bindings/vendor-prefixes.yaml, in a separate patch. Also you need a patch to add this compatible combination to Documentation/devicetree/bindings/arm/sunxi.yaml.

Cheers,
Andre

Quoted 166 lines
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +133 -0
+
+     aliases {
+             serial0 = &uart0;
+     };
+
+     chosen {
+             stdout-path = "serial0:115200n8";
+     };
+
+     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;
+     };
+};
+
+&ehci0 {
+     status = "okay";
+};
+
+&ehci2 {
+     status = "okay";
+};
+
+&ir {
+     status = "okay";
+};
+
+&mmc0 {
+     cd-gpios = <&pio 8 16 GPIO_ACTIVE_LOW>; /* PI16 */
+     vmmc-supply = <&reg_dldo1>;
+     status = "okay";
+};
+
+&mmc2 {
+     vmmc-supply = <&reg_dldo1>;
+     vqmmc-supply = <&reg_aldo1>;
+     bus-width = <8>;
+     non-removable;
+     cap-mmc-hw-reset;
+     mmc-ddr-1_8v;
+     mmc-hs200-1_8v;
+     status = "okay";
+};
+
+&ohci0 {
+     status = "okay";
+};
+
+&ohci2 {
+     status = "okay";
+};
+
+&r_i2c {
+     status = "okay";
+
+     axp313: pmic@36 {
+             compatible = "x-powers,axp313a";
+             reg = <0x36>;
+             #interrupt-cells = <1>;
+             interrupt-controller;
+             interrupt-parent = <&pio>;
+             interrupts = <2 9 IRQ_TYPE_LEVEL_LOW>;  /* PC9 */
+
+             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 = <1100000>;
+                             regulator-name = "vdd-cpu";
+                     };
+
+                     reg_dcdc3: dcdc3 {
+                             regulator-always-on;
+                             regulator-min-microvolt = <1360000>;
+                             regulator-max-microvolt = <1360000>;
+                             regulator-name = "vdd-dram";
+                     };
+             };
+     };
+};
+
+&pio {
+     vcc-pc-supply = <&reg_aldo1>;
+     vcc-pg-supply = <&reg_dldo1>;
+     vcc-ph-supply = <&reg_dldo1>;
+     vcc-pi-supply = <&reg_dldo1>;
+};
+
+&uart0 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&uart0_ph_pins>;
+     status = "okay";
+};
+
+&usbotg {
+     dr_mode = "host";       /* USB A type receptable */
+     status = "okay";
+};
+
+&usbphy {
+     status = "okay";
+};
configs/t95_axp313_defconfig new file +27 -0
new file mode 100644
index 0000000000..6542b5bc88
@@ -0,0 +1,27 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h616-t95-axp313"
+CONFIG_SPL=y
+CONFIG_MACH_SUN50I_H616=y
+CONFIG_DRAM_CLK=648
+CONFIG_DRAM_SUN50I_H616_ODT_EN=0x1
+CONFIG_DRAM_SUN50I_H616_DX_ODT=0x03030303
+CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0e0e0e0e
+CONFIG_DRAM_SUN50I_H616_CA_DRI=0x1c1c
+CONFIG_DRAM_SUN50I_H616_TPR10=0x2f0006
+CONFIG_DRAM_SUN50I_H616_TPR11=0xffffdddd
+CONFIG_DRAM_SUN50I_H616_TPR12=0xfedf7657
+CONFIG_SUNXI_DRAM_H616_DDR3_1333=y
+CONFIG_R_I2C_ENABLE=y
+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_SUPPORT_EMMC_BOOT=y
+CONFIG_AXP313_POWER=y
+CONFIG_AXP_DCDC3_VOLT=1360
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_SUN8I_EMAC=y
+CONFIG_SPL_IMAGE_TYPE_SUNXI_TOC0=y
Signature · 1 line
Kamil Kasperski
#3 lore raw

Hi,

Quoted 6 lines · Kamil Kasperski

Hello Andre,
Thanks for your reply and thanks for pointing some stuff out.

Quoted 1 line

What is "mbox"? Do you have any more information about this vendor?

Quoted 8 lines

"MBOX" refers to the "Model" string from system properties.
The problem is that it's quite hard to pin the correct vendor, since
the OS is built based on Google Pixel 2.
You can see that the fingerprint contains strings only for this phone:
[ro.build.fingerprint]:
[google/walley/walleye:10/QP1A.191105.004/eng.cmj.20220408.125005:userdebug/test-keys] Setting the device model as Vendor string seemed to be the most safe bet. If you have any other suggestions, please let me know.

Maybe a suggestion could be "YAGALA"

If you look on amazon, aliexpress you could find some vendors setting the brand to this name.

Regards,

Quoted 271 lines
Quoted 4 lines

But please note that the devicetree needs to go through the Linux mailing lists and repo first, and we automatically copy it from the Linux tree once it has been merged there.

Thanks for pointing that out. I'll contact Linux maintainers and will send updated patch.

Best regards,
Kamil

niedz., 10 mar 2024 o 23:00 Andre Przywara <[email protected]> napisał(a):

Quoted 244 lines

On Sat, 9 Mar 2024 19:24:26 +0000
Kamil Kasperski <[email protected]> wrote:

Hi Kamil,

many thanks for sending a patch, that looks mostly good from the technical point of view, only some smaller comments.

But please note that the devicetree needs to go through the Linux mailing lists and repo first, and we automatically copy it from the Linux tree once it has been merged there. This is to ensure proper review and checks with the Linux tooling.

So can you please send just the .dts file to the DT and sunxi maintainers the respective lists, as reported by get_maintainer.pl? Then we can take it from there.

Quoted 5 lines

T95 is a most commonly known for being a box with a pre-installed malware.
It uses Allwinner H616 and comes with eMMC and DDR3 memory.
This device comes with two versions - one with AXP305 PMIC and another with AXP313 PMIC.
The AXP313 version comes with Secure Boot enabled and locked bootloader, so the u-boot has to be built with TOC0. DRAM settings are taken from Allwinner's boot0 for this box.

Ah, thanks for figuring those out, that's very helpful.

Quoted 32 lines
Cc Andre Przywara <[email protected]>
---
 arch/arm/dts/Makefile                   |   3 +-
 arch/arm/dts/sun50i-h616-t95-axp313.dts | 148 ++++++++++++++++++++++++
 configs/t95_axp313_defconfig            |  27 +++++
 3 files changed, 177 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/sun50i-h616-t95-axp313.dts
 create mode 100644 configs/t95_axp313_defconfig
arch/arm/dts/Makefile +2 -1
index b102ffb5f6..144daf6c48 100644
@@ -842,7 +842,8 @@ dtb-$(CONFIG_MACH_SUN50I_H616) += \
      sun50i-h618-orangepi-zero2w.dtb \
      sun50i-h618-orangepi-zero3.dtb \
      sun50i-h618-transpeed-8k618-t.dtb \
-     sun50i-h616-x96-mate.dtb
+     sun50i-h616-x96-mate.dtb \
+     sun50i-h616-t95-axp313.dtb
 dtb-$(CONFIG_MACH_SUN50I) += \
      sun50i-a64-amarula-relic.dtb \
      sun50i-a64-bananapi-m64.dtb \
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +0 -0
new file mode 100644
index 0000000000..b006f363d5

arch/arm/dts/sun50i-h616-t95-axp313.dts line 3

Quoted 3 lines
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +3 -0
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2021 Arm Ltd.

Please change this copyright you and this year.

arch/arm/dts/sun50i-h616-t95-axp313.dts line 15

Quoted 12 lines
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +12 -0
+ */
+
+/dts-v1/;
+
+#include "sun50i-h616.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+     model = "T95 (AXP313)";
+     compatible = "mbox,t95-axp313", "allwinner,sun50i-h616";

What is "mbox"? Do you have any more information about this vendor? In any case a new vendor would need to be added to Documentation/devicetree/bindings/vendor-prefixes.yaml, in a separate patch. Also you need a patch to add this compatible combination to Documentation/devicetree/bindings/arm/sunxi.yaml.

Cheers,
Andre

Quoted 158 lines
arch/arm/dts/sun50i-h616-t95-axp313.dts new file +133 -0
+
+     aliases {
+             serial0 = &uart0;
+     };
+
+     chosen {
+             stdout-path = "serial0:115200n8";
+     };
+
+     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;
+     };
+};
+
+&ehci0 {
+     status = "okay";
+};
+
+&ehci2 {
+     status = "okay";
+};
+
+&ir {
+     status = "okay";
+};
+
+&mmc0 {
+     cd-gpios = <&pio 8 16 GPIO_ACTIVE_LOW>; /* PI16 */
+     vmmc-supply = <&reg_dldo1>;
+     status = "okay";
+};
+
+&mmc2 {
+     vmmc-supply = <&reg_dldo1>;
+     vqmmc-supply = <&reg_aldo1>;
+     bus-width = <8>;
+     non-removable;
+     cap-mmc-hw-reset;
+     mmc-ddr-1_8v;
+     mmc-hs200-1_8v;
+     status = "okay";
+};
+
+&ohci0 {
+     status = "okay";
+};
+
+&ohci2 {
+     status = "okay";
+};
+
+&r_i2c {
+     status = "okay";
+
+     axp313: pmic@36 {
+             compatible = "x-powers,axp313a";
+             reg = <0x36>;
+             #interrupt-cells = <1>;
+             interrupt-controller;
+             interrupt-parent = <&pio>;
+             interrupts = <2 9 IRQ_TYPE_LEVEL_LOW>;  /* PC9 */
+
+             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 = <1100000>;
+                             regulator-name = "vdd-cpu";
+                     };
+
+                     reg_dcdc3: dcdc3 {
+                             regulator-always-on;
+                             regulator-min-microvolt = <1360000>;
+                             regulator-max-microvolt = <1360000>;
+                             regulator-name = "vdd-dram";
+                     };
+             };
+     };
+};
+
+&pio {
+     vcc-pc-supply = <&reg_aldo1>;
+     vcc-pg-supply = <&reg_dldo1>;
+     vcc-ph-supply = <&reg_dldo1>;
+     vcc-pi-supply = <&reg_dldo1>;
+};
+
+&uart0 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&uart0_ph_pins>;
+     status = "okay";
+};
+
+&usbotg {
+     dr_mode = "host";       /* USB A type receptable */
+     status = "okay";
+};
+
+&usbphy {
+     status = "okay";
+};
configs/t95_axp313_defconfig new file +19 -0
new file mode 100644
index 0000000000..6542b5bc88
@@ -0,0 +1,27 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h616-t95-axp313"
+CONFIG_SPL=y
+CONFIG_MACH_SUN50I_H616=y
+CONFIG_DRAM_CLK=648
+CONFIG_DRAM_SUN50I_H616_ODT_EN=0x1
+CONFIG_DRAM_SUN50I_H616_DX_ODT=0x03030303
+CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0e0e0e0e
+CONFIG_DRAM_SUN50I_H616_CA_DRI=0x1c1c
+CONFIG_DRAM_SUN50I_H616_TPR10=0x2f0006
+CONFIG_DRAM_SUN50I_H616_TPR11=0xffffdddd
+CONFIG_DRAM_SUN50I_H616_TPR12=0xfedf7657
+CONFIG_SUNXI_DRAM_H616_DDR3_1333=y
+CONFIG_R_I2C_ENABLE=y
+CONFIG_SPL_I2C=y
+CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_MVTWSI=y
+CONFIG_SYS_I2C_SLAVE=0x7f
Quoted 9 lines

configs/t95_axp313_defconfig line 27

Quoted 8 lines
configs/t95_axp313_defconfig new file +8 -0
+CONFIG_SYS_I2C_SPEED=400000
+CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_AXP313_POWER=y
+CONFIG_AXP_DCDC3_VOLT=1360
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_SUN8I_EMAC=y
+CONFIG_SPL_IMAGE_TYPE_SUNXI_TOC0=y

--
Kamil Kasperski