linux-postmarketos-amlogic: add Xiaomi Mi Box 3 DTS

Co-authored-by: exkc <exkc@exkc.moe>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8971>
This commit is contained in:
Stanley 2026-07-04 18:43:31 +07:00 committed by The Friendly Meow (merge) Bot
parent a6cef777a0
commit 8faa726dea
No known key found for this signature in database
2 changed files with 188 additions and 1 deletions

View file

@ -0,0 +1,185 @@
From efd1039ff812f1d6bb58d57ea84802a428b58ccd Mon Sep 17 00:00:00 2001
From: "@exkc" <exkc@exkc.moe>
Date: Tue, 14 Mar 2023 23:08:03 +0800
Subject: [PATCH] ARM64: dts: meson-gxl: add support for the Xiaomi Mi Box 3
The Xiaomi Mi Box 3 is a TV box based on the Amlogic S905X chipset.
There are two variants:
- 2 GiB of DDR3 memory
- 8 GB eMMC flash
Both variants come with:
- 802.11a/b/g/n/ac wifi (BCM4345)
- HDMI and AV (CVBS) output
- 1x USB (utilizing both USB ports provided by the SoC)
The board seems to be very similar to the P212 reference
boards, which is why it includes meson-gxl-s905x-p212.dtsi:
---
arch/arm64/boot/dts/amlogic/Makefile | 1 +
.../amlogic/meson-gxl-s905x-xiaomi-once.dts | 142 ++++++++++++++++++
2 files changed, 143 insertions(+)
create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-xiaomi-once.dts
diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
index e213aeebb..904bb1e19 100644
--- a/arch/arm64/boot/dts/amlogic/Makefile
+++ b/arch/arm64/boot/dts/amlogic/Makefile
@@ -76,5 +76,6 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-nexbox-a95x.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-p212.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-vero4k.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-xiaomi-once.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-gxlx-s905l-p271.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-gxm-gt1-ultimate.dtb
dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-xiaomi-once.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-xiaomi-once.dts
new file mode 100644
index 000000000..6169c0dc0
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-xiaomi-once.dts
@@ -0,0 +1,142 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2023 exkc <exxxxkc@getgoogleoff.me>
+ * Based on meson-gxl-s905x-p212.dts
+ *
+ */
+
+/dts-v1/;
+
+#include "meson-gxl-s905x-p212.dtsi"
+#include <dt-bindings/sound/meson-aiu.h>
+
+/ {
+ compatible = "xiaomi,once", "amlogic,s905x", "amlogic,meson-gxl";
+ model = "Xiaomi Mi Box 3";
+
+ dio2133: analog-amplifier {
+ compatible = "simple-audio-amplifier";
+ sound-name-prefix = "AU2";
+ VCC-supply = <&hdmi_5v>;
+ enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
+ };
+
+ cvbs-connector {
+ compatible = "composite-video-connector";
+
+ port {
+ cvbs_connector_in: endpoint {
+ remote-endpoint = <&cvbs_vdac_out>;
+ };
+ };
+ };
+
+ hdmi-connector {
+ compatible = "hdmi-connector";
+ type = "a";
+
+ port {
+ hdmi_connector_in: endpoint {
+ remote-endpoint = <&hdmi_tx_tmds_out>;
+ };
+ };
+ };
+
+ sound {
+ compatible = "amlogic,gx-sound-card";
+ model = "XIAOMI-ONCE";
+ audio-aux-devs = <&dio2133>;
+ audio-widgets = "Line", "Lineout";
+ audio-routing = "Lineout", "AU2 OUTL",
+ "Lineout", "AU2 OUTR";
+ assigned-clocks = <&clkc CLKID_MPLL0>,
+ <&clkc CLKID_MPLL1>,
+ <&clkc CLKID_MPLL2>;
+ assigned-clock-parents = <0>, <0>, <0>;
+ assigned-clock-rates = <294912000>,
+ <270950400>,
+ <393216000>;
+ dai-link-0 {
+ sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
+ };
+
+ dai-link-1 {
+ sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
+ dai-format = "i2s";
+ mclk-fs = <256>;
+
+ codec-0 {
+ sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
+ };
+
+ codec-1 {
+ sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
+ };
+ };
+
+ dai-link-2 {
+ sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+ codec-0 {
+ sound-dai = <&hdmi_tx>;
+ };
+ };
+
+ dai-link-3 {
+ sound-dai = <&aiu AIU_ACODEC CTRL_OUT>;
+
+ codec-0 {
+ sound-dai = <&acodec>;
+ };
+ };
+ };
+};
+
+&acodec {
+ AVDD-supply = <&vddio_ao18>;
+ status = "okay";
+};
+
+&aiu {
+ status = "okay";
+};
+
+&cec_AO {
+ status = "okay";
+ pinctrl-0 = <&ao_cec_pins>;
+ pinctrl-names = "default";
+ hdmi-phandle = <&hdmi_tx>;
+};
+
+&cvbs_vdac_port {
+ cvbs_vdac_out: endpoint {
+ remote-endpoint = <&cvbs_connector_in>;
+ };
+};
+
+&hdmi_tx {
+ status = "okay";
+ pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
+ pinctrl-names = "default";
+ hdmi-supply = <&hdmi_5v>;
+};
+
+&hdmi_tx_tmds_port {
+ hdmi_tx_tmds_out: endpoint {
+ remote-endpoint = <&hdmi_connector_in>;
+ };
+};
+
+&ethmac {
+ status = "disabled";
+};
+
+&usb {
+ status = "okay";
+ dr_mode = "host";
+};
+
+/* This UART is brought out to the uarl pad on the pcb*/
+&uart_AO {
+ status = "okay";
+};
--
2.39.2

View file

@ -4,7 +4,7 @@
maintainer="Ferass El Hafidi <funderscore@postmarketos.org>"
pkgname=linux-postmarketos-amlogic
pkgver=7.1.1
pkgrel=2
pkgrel=3
pkgdesc="Mainline kernel for Amlogic devices"
arch="aarch64"
_carch="arm64"
@ -63,6 +63,7 @@ source="
0021-WORKAROUND-meson-plane-disable-afbc-32x8.patch
0022-arm64-dts-amlogic-add-zte-b860h-v1v2.patch
0023-arm64-dts-amlogic-add-fiberhome-hg680p.patch
0024-add-xiaomi-once-support.patch
"
builddir="$srcdir/linux-$pkgver"
@ -116,4 +117,5 @@ f6fb37ac0aa876f8d95ed598be20263417d8522a3c1f48a4ce148f95e6c6774664048064f4a96ff7
3d38202c1b5b56f25c16664924b72e6041e7911e71985a028b91c7151758659a2e662009c06342a0fddd8d829df03d6feb8ee929c550fde74a16f955cb01ae30 0021-WORKAROUND-meson-plane-disable-afbc-32x8.patch
4a8bbd4d3c00e760ceb6e02eedd590b4dc20641276e4f9058c932d1cc0a2bbfa4a1b122296f052b6dfad6d01a155b7dc28a925f9c6982dfc7b9ebf2ea0ad2a86 0022-arm64-dts-amlogic-add-zte-b860h-v1v2.patch
c85b997a9c6bc9190550a933f0bfd75bb834efc570869e6c6b9d8a2b8f93cf16f5f0bb6672b0451d4f1c7aa7878b32407b2d5007588fb1adeb5432028a6e2c8e 0023-arm64-dts-amlogic-add-fiberhome-hg680p.patch
f9b4362a5be8655a6027101e2377a4506ba1fb2671534195c3b703df0933e08254ce8852d787c82b173d4917968542264fc849641deb810611cb005f362797db 0024-add-xiaomi-once-support.patch
"