Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add support for Xiaomi Mi TV Stick
@ 2025-01-31 20:03 Ferass El Hafidi
  2025-01-31 20:03 ` [PATCH 1/2] dt-bindings: arm: amlogic: add " Ferass El Hafidi
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Ferass El Hafidi @ 2025-01-31 20:03 UTC (permalink / raw)
  To: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-amlogic
  Cc: linux-arm-kernel, devicetree, linux-kernel, funderscore,
	~postmarketos/upstreaming, Artur Weber, Karl Chan

From: Ferass El Hafidi <funderscore@postmarketos.org>

This patch series aims to add initial support for the Xiaomi Mi TV
Stick.

Xiaomi Mi TV Stick is a small Amlogic-based Android TV stick released in 
2020, and known as `xiaomi-aquaman` internally (in the downstream kernel,
u-boot, ...)
Its specifications are as follows:
 * Amlogic S805Y SoC (believed to be mostly identical to S805X)
 * 8 GB eMMC
 * 1 GB of RAM
 * Android TV 9, upgradable to Android TV 10

There are multiple variants:
 * 1. Green PCB, manufactured in 2020, known UART pinout (helpfully 
   labeled on the board)
 * 2. Blue PCB, not much documentation about it, presumably manufactured
   between 2021 and 2023
 * 3. Green PCB, manufactured in 2023, known UART pinout, some layout
   changes compared to the 2020 variant

Among these variants, there are many boards using multiple different
Wi-Fi chips.  Supporting all of them is out of scope for this patch
series.

As of the time of writing this has only been tested on the 3rd variant.
It is believed that software-wise all three work mostly the same (if we 
don't count Wi-Fi), but testing on the other variants would still be
appreciated.

The devicetree is based on the Amlogic P241 DTS.

Ferass El Hafidi (2):
  dt-bindings: arm: amlogic: add Xiaomi Mi TV Stick
  arm64: dts: amlogic: add support for xiaomi-aquaman/Mi TV Stick

 .../devicetree/bindings/arm/amlogic.yaml      |   1 +
 arch/arm64/boot/dts/amlogic/Makefile          |   1 +
 .../meson-gxl-s805y-xiaomi-aquaman.dts        | 311 ++++++++++++++++++
 3 files changed, 313 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts

-- 
2.47.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/2] dt-bindings: arm: amlogic: add Xiaomi Mi TV Stick
  2025-01-31 20:03 [PATCH 0/2] Add support for Xiaomi Mi TV Stick Ferass El Hafidi
@ 2025-01-31 20:03 ` Ferass El Hafidi
  2025-02-01  5:45   ` Christian Hewitt
  2025-01-31 20:03 ` [PATCH 2/2] arm64: dts: amlogic: add support for xiaomi-aquaman/Mi " Ferass El Hafidi
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Ferass El Hafidi @ 2025-01-31 20:03 UTC (permalink / raw)
  To: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-amlogic
  Cc: linux-arm-kernel, devicetree, linux-kernel, funderscore,
	~postmarketos/upstreaming, Artur Weber, Karl Chan

From: Ferass El Hafidi <funderscore@postmarketos.org>

Add support for xiaomi-aquaman.

Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
---
 Documentation/devicetree/bindings/arm/amlogic.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml
index 0647851ae..0db7038b9 100644
--- a/Documentation/devicetree/bindings/arm/amlogic.yaml
+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml
@@ -70,6 +70,7 @@ properties:
           - enum:
               - amlogic,p241
               - libretech,aml-s805x-ac
+              - xiaomi,aquaman
           - const: amlogic,s805x
           - const: amlogic,meson-gxl
 
-- 
2.47.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] arm64: dts: amlogic: add support for xiaomi-aquaman/Mi TV Stick
  2025-01-31 20:03 [PATCH 0/2] Add support for Xiaomi Mi TV Stick Ferass El Hafidi
  2025-01-31 20:03 ` [PATCH 1/2] dt-bindings: arm: amlogic: add " Ferass El Hafidi
@ 2025-01-31 20:03 ` Ferass El Hafidi
  2025-02-01  6:08   ` Christian Hewitt
  2025-02-01 11:01   ` Martin Blumenstingl
  2025-01-31 21:23 ` [PATCH 0/2] Add support for Xiaomi Mi " Rob Herring (Arm)
  2025-02-01 19:33 ` Ferass El Hafidi
  3 siblings, 2 replies; 11+ messages in thread
From: Ferass El Hafidi @ 2025-01-31 20:03 UTC (permalink / raw)
  To: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-amlogic
  Cc: linux-arm-kernel, devicetree, linux-kernel, funderscore,
	~postmarketos/upstreaming, Artur Weber, Karl Chan

From: Ferass El Hafidi <funderscore@postmarketos.org>

Xiaomi Mi TV Stick is a small Amlogic-based Android TV stick released in 
2020.  It is known as `xiaomi-aquaman` internally.  Specifications:
 * Amlogic S805Y SoC
 * Android TV 9, upgradable to Android TV 10
 * 8 GB eMMC
 * 1 GB of RAM

The devicetree is based on p241's DT, with some changes to better match
the Mi TV Stick.

Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
---
 arch/arm64/boot/dts/amlogic/Makefile          |   1 +
 .../meson-gxl-s805y-xiaomi-aquaman.dts        | 311 ++++++++++++++++++
 2 files changed, 312 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts

diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
index 2fbda8419..0921707f1 100644
--- a/arch/arm64/boot/dts/amlogic/Makefile
+++ b/arch/arm64/boot/dts/amlogic/Makefile
@@ -49,6 +49,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-wetek-hub.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-wetek-play2.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s805x-libretech-ac.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s805x-p241.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s805y-xiaomi-aquaman.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-libretech-pc.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-mecool-kii-pro.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-p230.dtb
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts
new file mode 100644
index 000000000..6b72f054a
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts
@@ -0,0 +1,311 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2025 Ferass El Hafidi <funderscore@postmarketos.org>
+ * Based on meson-gxl-s805x-p241.dtb:
+ *  - Copyright (c) 2018 BayLibre, SAS.
+ *    Author: Neil Armstrong <narmstrong@baylibre.com>
+ *    Author: Jerome Brunet <jbrunet@baylibre.com>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/sound/meson-aiu.h>
+
+#include "meson-gxl-s805x.dtsi"
+
+/ {
+	compatible = "xiaomi,aquaman", "amlogic,s805x", "amlogic,meson-gxl";
+	model = "Xiaomi Mi TV Stick (S805Y)";
+
+	aliases {
+		serial0 = &uart_AO;
+		serial1 = &uart_A;
+	};
+
+	au2: analog-amplifier {
+		compatible = "simple-audio-amplifier";
+		sound-name-prefix = "AU2";
+		VCC-supply = <&vcc_5v>;
+		enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	cvbs-connector {
+		/* No CVBS connector */
+		status = "disabled";
+	};
+
+	emmc_pwrseq: emmc-pwrseq {
+		compatible = "mmc-pwrseq-emmc";
+		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
+	};
+
+	hdmi-connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_connector_in: endpoint {
+				remote-endpoint = <&hdmi_tx_tmds_out>;
+			};
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led-white {
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_POWER;
+			gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
+			default-state = "heartbeat";
+			panic-indicator;
+		};
+	};
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x0 0x0 0x0 0x40000000>;
+	};
+
+	vddio_boot: regulator-vddio-boot {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDIO_BOOT";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	vddao_3v3: regulator-vddao-3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDAO_3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	vddio_ao18: regulator-vddio-ao18 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDIO_AO18";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	vcc_3v3: regulator-vcc-3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC_3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	vcc_5v: regulator-vcc-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC_5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+	};
+
+
+	emmc_pwrseq: emmc-pwrseq {
+		compatible = "mmc-pwrseq-emmc";
+		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
+	};
+
+	wifi32k: wifi32k {
+		compatible = "pwm-clock";
+		#clock-cells = <0>;
+		clock-frequency = <32768>;
+		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
+	};
+
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
+		clocks = <&wifi32k>;
+		clock-names = "ext_clock";
+	};
+
+	sound {
+		compatible = "amlogic,gx-sound-card";
+		model = "MI-AQUAMAN";
+		audio-aux-devs = <&au2>;
+		audio-widgets = "Line", "Lineout";
+		audio-routing = "AU2 INL", "ACODEC LOLN",
+				"AU2 INR", "ACODEC LORN",
+				"Lineout", "AU2 OUTL",
+				"Lineout", "AU2 OUTR";
+		clocks = <&clkc CLKID_MPLL0>,
+			 <&clkc CLKID_MPLL1>,
+			 <&clkc CLKID_MPLL2>;
+
+		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>;
+};
+
+&ethmac {
+	/* No Ethernet connector */
+	status = "disabled";
+};
+
+&internal_phy {
+	pinctrl-0 = <&eth_link_led_pins>, <&eth_act_led_pins>;
+	pinctrl-names = "default";
+};
+
+&ir {
+	/* No IR */
+	status = "disabled";
+};
+
+&hdmi_tx {
+	status = "okay";
+	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
+	pinctrl-names = "default";
+	hdmi-supply = <&vcc_5v>;
+};
+
+&hdmi_tx_tmds_port {
+	hdmi_tx_tmds_out: endpoint {
+		remote-endpoint = <&hdmi_connector_in>;
+	};
+};
+
+&saradc {
+	status = "okay";
+	vref-supply = <&vddio_ao18>;
+};
+
+/* Wireless SDIO Module */
+&sd_emmc_a {
+	status = "disabled";
+	pinctrl-0 = <&sdio_pins>;
+	pinctrl-1 = <&sdio_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	bus-width = <4>;
+	cap-sd-highspeed;
+	max-frequency = <50000000>;
+
+	non-removable;
+	disable-wp;
+
+	/* WiFi firmware requires power to be kept while in suspend */
+	keep-power-in-suspend;
+
+	mmc-pwrseq = <&sdio_pwrseq>;
+
+	vmmc-supply = <&vddao_3v3>;
+	vqmmc-supply = <&vddio_boot>;
+};
+
+/* eMMC */
+&sd_emmc_c {
+	status = "okay";
+	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
+
+	bus-width = <8>;
+	cap-mmc-highspeed;
+	max-frequency = <200000000>;
+	non-removable;
+	disable-wp;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+
+	mmc-pwrseq = <&emmc_pwrseq>;
+	vmmc-supply = <&vcc_3v3>;
+	vqmmc-supply = <&vddio_boot>;
+};
+
+&pwm_ef {
+	status = "okay";
+	pinctrl-0 = <&pwm_e_pins>;
+	pinctrl-names = "default";
+	clocks = <&clkc CLKID_FCLK_DIV4>;
+	clock-names = "clkin0";
+};
+
+/* This is connected to the Bluetooth module: */
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;
+};
+
+&uart_AO {
+	status = "okay";
+	pinctrl-0 = <&uart_ao_a_pins>;
+	pinctrl-names = "default";
+};
+
+&usb {
+	status = "okay";
+	dr_mode = "host";
+};
+
+&usb2_phy0 {
+	phy-supply = <&vcc_5v>;
+};
-- 
2.47.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] Add support for Xiaomi Mi TV Stick
  2025-01-31 20:03 [PATCH 0/2] Add support for Xiaomi Mi TV Stick Ferass El Hafidi
  2025-01-31 20:03 ` [PATCH 1/2] dt-bindings: arm: amlogic: add " Ferass El Hafidi
  2025-01-31 20:03 ` [PATCH 2/2] arm64: dts: amlogic: add support for xiaomi-aquaman/Mi " Ferass El Hafidi
@ 2025-01-31 21:23 ` Rob Herring (Arm)
  2025-02-01 10:14   ` Ferass El Hafidi
  2025-02-01 19:33 ` Ferass El Hafidi
  3 siblings, 1 reply; 11+ messages in thread
From: Rob Herring (Arm) @ 2025-01-31 21:23 UTC (permalink / raw)
  To: Ferass El Hafidi
  Cc: Conor Dooley, linux-amlogic, Neil Armstrong, Jerome Brunet,
	linux-arm-kernel, ~postmarketos/upstreaming, devicetree,
	Krzysztof Kozlowski, Kevin Hilman, linux-kernel, Karl Chan,
	Martin Blumenstingl, Artur Weber


On Fri, 31 Jan 2025 20:03:17 +0000, Ferass El Hafidi wrote:
> From: Ferass El Hafidi <funderscore@postmarketos.org>
> 
> This patch series aims to add initial support for the Xiaomi Mi TV
> Stick.
> 
> Xiaomi Mi TV Stick is a small Amlogic-based Android TV stick released in
> 2020, and known as `xiaomi-aquaman` internally (in the downstream kernel,
> u-boot, ...)
> Its specifications are as follows:
>  * Amlogic S805Y SoC (believed to be mostly identical to S805X)
>  * 8 GB eMMC
>  * 1 GB of RAM
>  * Android TV 9, upgradable to Android TV 10
> 
> There are multiple variants:
>  * 1. Green PCB, manufactured in 2020, known UART pinout (helpfully
>    labeled on the board)
>  * 2. Blue PCB, not much documentation about it, presumably manufactured
>    between 2021 and 2023
>  * 3. Green PCB, manufactured in 2023, known UART pinout, some layout
>    changes compared to the 2020 variant
> 
> Among these variants, there are many boards using multiple different
> Wi-Fi chips.  Supporting all of them is out of scope for this patch
> series.
> 
> As of the time of writing this has only been tested on the 3rd variant.
> It is believed that software-wise all three work mostly the same (if we
> don't count Wi-Fi), but testing on the other variants would still be
> appreciated.
> 
> The devicetree is based on the Amlogic P241 DTS.
> 
> Ferass El Hafidi (2):
>   dt-bindings: arm: amlogic: add Xiaomi Mi TV Stick
>   arm64: dts: amlogic: add support for xiaomi-aquaman/Mi TV Stick
> 
>  .../devicetree/bindings/arm/amlogic.yaml      |   1 +
>  arch/arm64/boot/dts/amlogic/Makefile          |   1 +
>  .../meson-gxl-s805y-xiaomi-aquaman.dts        | 311 ++++++++++++++++++
>  3 files changed, 313 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts
> 
> --
> 2.47.1
> 
> 


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

  pip3 install dtschema --upgrade


New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/amlogic/' for 20250131200319.19996-1-funderscore@postmarketos.org:

arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dtb: pwm@86c0: clock-names: False schema does not allow ['clkin0']
	from schema $id: http://devicetree.org/schemas/pwm/pwm-amlogic.yaml#
arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dtb: leds: led-white:default-state:0: 'heartbeat' is not one of ['on', 'off', 'keep']
	from schema $id: http://devicetree.org/schemas/leds/leds-gpio.yaml#
arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dtb: leds: led-white: Unevaluated properties are not allowed ('default-state' was unexpected)
	from schema $id: http://devicetree.org/schemas/leds/leds-gpio.yaml#






_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] dt-bindings: arm: amlogic: add Xiaomi Mi TV Stick
  2025-01-31 20:03 ` [PATCH 1/2] dt-bindings: arm: amlogic: add " Ferass El Hafidi
@ 2025-02-01  5:45   ` Christian Hewitt
  2025-02-01 10:36     ` Ferass El Hafidi
  0 siblings, 1 reply; 11+ messages in thread
From: Christian Hewitt @ 2025-02-01  5:45 UTC (permalink / raw)
  To: Ferass El Hafidi
  Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel,
	~postmarketos/upstreaming, Artur Weber, Karl Chan

> On 1 Feb 2025, at 12:03 am, Ferass El Hafidi <funderscore@postmarketos.org> wrote:
> 
> From: Ferass El Hafidi <funderscore@postmarketos.org>
> 
> Add support for xiaomi-aquaman.
> 
> Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
> ---
> Documentation/devicetree/bindings/arm/amlogic.yaml | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml
> index 0647851ae..0db7038b9 100644
> --- a/Documentation/devicetree/bindings/arm/amlogic.yaml
> +++ b/Documentation/devicetree/bindings/arm/amlogic.yaml
> @@ -70,6 +70,7 @@ properties:
>           - enum:
>               - amlogic,p241
>               - libretech,aml-s805x-ac
> +              - xiaomi,aquaman

If this is S805Y not S805X, you should add a new binding section for
S805Y devices, and add the board there.

e.g. I did this for S905L (GXLX) devices:
https://patchwork.kernel.org/project/linux-amlogic/patch/20240604084134.3315841-1-christianshewitt@gmail.com/

Christian

>           - const: amlogic,s805x
>           - const: amlogic,meson-gxl
> 
> -- 
> 2.47.1
> 
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] arm64: dts: amlogic: add support for xiaomi-aquaman/Mi TV Stick
  2025-01-31 20:03 ` [PATCH 2/2] arm64: dts: amlogic: add support for xiaomi-aquaman/Mi " Ferass El Hafidi
@ 2025-02-01  6:08   ` Christian Hewitt
  2025-02-01 10:11     ` Ferass El Hafidi
  2025-02-01 11:01   ` Martin Blumenstingl
  1 sibling, 1 reply; 11+ messages in thread
From: Christian Hewitt @ 2025-02-01  6:08 UTC (permalink / raw)
  To: Ferass El Hafidi
  Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel,
	~postmarketos/upstreaming, Artur Weber, Karl Chan

> On 1 Feb 2025, at 12:03 am, Ferass El Hafidi <funderscore@postmarketos.org> wrote:
> 
> From: Ferass El Hafidi <funderscore@postmarketos.org>
> 
> Xiaomi Mi TV Stick is a small Amlogic-based Android TV stick released in 
> 2020.  It is known as `xiaomi-aquaman` internally.  Specifications:
> * Amlogic S805Y SoC
> * Android TV 9, upgradable to Android TV 10
> * 8 GB eMMC
> * 1 GB of RAM
> 
> The devicetree is based on p241's DT, with some changes to better match
> the Mi TV Stick.

Explain the bits that are omitted/different (see comments below).

> 
> Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
> ---
> arch/arm64/boot/dts/amlogic/Makefile          |   1 +
> .../meson-gxl-s805y-xiaomi-aquaman.dts        | 311 ++++++++++++++++++
> 2 files changed, 312 insertions(+)
> create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts
> 
> diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
> index 2fbda8419..0921707f1 100644
> --- a/arch/arm64/boot/dts/amlogic/Makefile
> +++ b/arch/arm64/boot/dts/amlogic/Makefile
> @@ -49,6 +49,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-wetek-hub.dtb
> dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-wetek-play2.dtb
> dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s805x-libretech-ac.dtb
> dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s805x-p241.dtb
> +dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s805y-xiaomi-aquaman.dtb
> dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-libretech-pc.dtb
> dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-mecool-kii-pro.dtb
> dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-p230.dtb
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts
> new file mode 100644
> index 000000000..6b72f054a
> --- /dev/null
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts
> @@ -0,0 +1,311 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright (c) 2025 Ferass El Hafidi <funderscore@postmarketos.org>
> + * Based on meson-gxl-s805x-p241.dtb:
> + *  - Copyright (c) 2018 BayLibre, SAS.
> + *    Author: Neil Armstrong <narmstrong@baylibre.com>
> + *    Author: Jerome Brunet <jbrunet@baylibre.com>

If this was cloned from the p241 file I would retain the Baylibre
Copyright and add myself as an additional author. You’ve extended
their work not created a new one.

> + */
> +
> +/dts-v1/;
> +
> +#include <dt-bindings/input/input.h>
> +#include <dt-bindings/leds/common.h>
> +#include <dt-bindings/sound/meson-aiu.h>
> +
> +#include "meson-gxl-s805x.dtsi"

Amlogic Y variants normally omit CVBS, Ethernet, SD, and sometimes IR,
so you could clone the s805x.dtsi and remove nodes there, then include
an s805y.dtsi file. Perhaps not worth the effort for a single device
at this time, but could be done as future optimisation.

> +
> +/ {
> + compatible = "xiaomi,aquaman", "amlogic,s805x", "amlogic,meson-gxl";

After updating the bindings, use “amlogic,s805y” here.

> + model = "Xiaomi Mi TV Stick (S805Y)";

I’d use “Xiaomi Mi TV Stick (Aquaman)” so the connection between the
binding name and model name is obvious.

> +
> + aliases {
> + serial0 = &uart_AO;
> + serial1 = &uart_A;
> + };
> +
> + au2: analog-amplifier {
> + compatible = "simple-audio-amplifier";
> + sound-name-prefix = "AU2";
> + VCC-supply = <&vcc_5v>;
> + enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +
> + cvbs-connector {
> + /* No CVBS connector */
> + status = "disabled";
> + };
> +
> + emmc_pwrseq: emmc-pwrseq {
> + compatible = "mmc-pwrseq-emmc";
> + reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
> + };
> +
> + hdmi-connector {
> + compatible = "hdmi-connector";
> + type = "a";
> +
> + port {
> + hdmi_connector_in: endpoint {
> + remote-endpoint = <&hdmi_tx_tmds_out>;
> + };
> + };
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + led-white {
> + color = <LED_COLOR_ID_WHITE>;
> + function = LED_FUNCTION_POWER;
> + gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
> + default-state = "heartbeat";
> + panic-indicator;
> + };
> + };
> +
> + memory@0 {
> + device_type = "memory";
> + reg = <0x0 0x0 0x0 0x40000000>;
> + };
> +
> + vddio_boot: regulator-vddio-boot {
> + compatible = "regulator-fixed";
> + regulator-name = "VDDIO_BOOT";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + };
> +
> + vddao_3v3: regulator-vddao-3v3 {
> + compatible = "regulator-fixed";
> + regulator-name = "VDDAO_3V3";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + };
> +
> + vddio_ao18: regulator-vddio-ao18 {
> + compatible = "regulator-fixed";
> + regulator-name = "VDDIO_AO18";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + };
> +
> + vcc_3v3: regulator-vcc-3v3 {
> + compatible = "regulator-fixed";
> + regulator-name = "VCC_3V3";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + };
> +
> + vcc_5v: regulator-vcc-5v {
> + compatible = "regulator-fixed";
> + regulator-name = "VCC_5V";
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + };
> +
> +
> + emmc_pwrseq: emmc-pwrseq {
> + compatible = "mmc-pwrseq-emmc";
> + reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
> + };
> +
> + wifi32k: wifi32k {
> + compatible = "pwm-clock";
> + #clock-cells = <0>;
> + clock-frequency = <32768>;
> + pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
> + };
> +
> + sdio_pwrseq: sdio-pwrseq {
> + compatible = "mmc-pwrseq-simple";
> + reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
> + clocks = <&wifi32k>;
> + clock-names = "ext_clock";
> + };
> +
> + sound {
> + compatible = "amlogic,gx-sound-card";
> + model = "MI-AQUAMAN";

Just “AQUAMAN” ?

> + audio-aux-devs = <&au2>;
> + audio-widgets = "Line", "Lineout";
> + audio-routing = "AU2 INL", "ACODEC LOLN",
> + "AU2 INR", "ACODEC LORN",
> + "Lineout", "AU2 OUTL",
> + "Lineout", "AU2 OUTR";
> + clocks = <&clkc CLKID_MPLL0>,
> + <&clkc CLKID_MPLL1>,
> + <&clkc CLKID_MPLL2>;
> +
> + 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>;
> +};
> +
> +&ethmac {
> + /* No Ethernet connector */
> + status = "disabled";
> +};
> +
> +&internal_phy {
> + pinctrl-0 = <&eth_link_led_pins>, <&eth_act_led_pins>;
> + pinctrl-names = "default";
> +};
> +
> +&ir {
> + /* No IR */
> + status = "disabled";
> +};
> +
> +&hdmi_tx {
> + status = "okay";
> + pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
> + pinctrl-names = "default";
> + hdmi-supply = <&vcc_5v>;
> +};
> +
> +&hdmi_tx_tmds_port {
> + hdmi_tx_tmds_out: endpoint {
> + remote-endpoint = <&hdmi_connector_in>;
> + };
> +};
> +
> +&saradc {
> + status = "okay";
> + vref-supply = <&vddio_ao18>;
> +};
> +
> +/* Wireless SDIO Module */
> +&sd_emmc_a {
> + status = "disabled";
> + pinctrl-0 = <&sdio_pins>;
> + pinctrl-1 = <&sdio_clk_gate_pins>;
> + pinctrl-names = "default", "clk-gate";
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + bus-width = <4>;
> + cap-sd-highspeed;
> + max-frequency = <50000000>;
> +
> + non-removable;
> + disable-wp;
> +
> + /* WiFi firmware requires power to be kept while in suspend */
> + keep-power-in-suspend;
> +
> + mmc-pwrseq = <&sdio_pwrseq>;
> +
> + vmmc-supply = <&vddao_3v3>;
> + vqmmc-supply = <&vddio_boot>;

If you add a generic SDIO node here board variants will have working
WiFi regardless of the module used. The idea is used here:

https://patchwork.kernel.org/project/linux-amlogic/patch/20241127043358.3799737-1-christianshewitt@gmail.com/

> +};
> +
> +/* eMMC */
> +&sd_emmc_c {
> + status = "okay";
> + pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
> + pinctrl-1 = <&emmc_clk_gate_pins>;
> + pinctrl-names = "default", "clk-gate";
> +
> + bus-width = <8>;
> + cap-mmc-highspeed;
> + max-frequency = <200000000>;
> + non-removable;
> + disable-wp;
> + mmc-ddr-1_8v;
> + mmc-hs200-1_8v;
> +
> + mmc-pwrseq = <&emmc_pwrseq>;
> + vmmc-supply = <&vcc_3v3>;
> + vqmmc-supply = <&vddio_boot>;
> +};
> +
> +&pwm_ef {
> + status = "okay";
> + pinctrl-0 = <&pwm_e_pins>;
> + pinctrl-names = "default";
> + clocks = <&clkc CLKID_FCLK_DIV4>;
> + clock-names = "clkin0";
> +};
> +
> +/* This is connected to the Bluetooth module: */
> +&uart_A {
> + status = "okay";
> + pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
> + pinctrl-names = "default";
> + uart-has-rtscts;
> +};
> +
> +&uart_AO {
> + status = "okay";
> + pinctrl-0 = <&uart_ao_a_pins>;
> + pinctrl-names = "default";
> +};
> +
> +&usb {
> + status = "okay";
> + dr_mode = "host";
> +};
> +
> +&usb2_phy0 {
> + phy-supply = <&vcc_5v>;
> +};
> -- 
> 2.47.1
> 
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] arm64: dts: amlogic: add support for xiaomi-aquaman/Mi TV Stick
  2025-02-01  6:08   ` Christian Hewitt
@ 2025-02-01 10:11     ` Ferass El Hafidi
  0 siblings, 0 replies; 11+ messages in thread
From: Ferass El Hafidi @ 2025-02-01 10:11 UTC (permalink / raw)
  To: Christian Hewitt
  Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel,
	~postmarketos/upstreaming, Artur Weber, Karl Chan

On Sat Feb 1, 2025 at 6:08 AM UTC, Christian Hewitt wrote:
<snip>
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts
> > new file mode 100644
> > index 000000000..6b72f054a
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts
> > @@ -0,0 +1,311 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > +/*
> > + * Copyright (c) 2025 Ferass El Hafidi <funderscore@postmarketos.org>
> > + * Based on meson-gxl-s805x-p241.dtb:
> > + *  - Copyright (c) 2018 BayLibre, SAS.
> > + *    Author: Neil Armstrong <narmstrong@baylibre.com>
> > + *    Author: Jerome Brunet <jbrunet@baylibre.com>
>
> If this was cloned from the p241 file I would retain the Baylibre
> Copyright and add myself as an additional author. You’ve extended
> their work not created a new one.
>

I did retain the BayLibre copyright and stated that it is based on the
p241 DT.

> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include <dt-bindings/input/input.h>
> > +#include <dt-bindings/leds/common.h>
> > +#include <dt-bindings/sound/meson-aiu.h>
> > +
> > +#include "meson-gxl-s805x.dtsi"
>
> Amlogic Y variants normally omit CVBS, Ethernet, SD, and sometimes IR,
> so you could clone the s805x.dtsi and remove nodes there, then include
> an s805y.dtsi file. Perhaps not worth the effort for a single device
> at this time, but could be done as future optimisation.
>

I could do it in v2.  Could be worth the effort long-term.

> > +
> > +/ {
> > + compatible = "xiaomi,aquaman", "amlogic,s805x", "amlogic,meson-gxl";
>
> After updating the bindings, use “amlogic,s805y” here.
>
> > + model = "Xiaomi Mi TV Stick (S805Y)";
>
> I’d use “Xiaomi Mi TV Stick (Aquaman)” so the connection between the
> binding name and model name is obvious.
>

I added "(S805Y)" to differenciate from the other, much newer stick also 
known as an "Xiaomi Mi TV Stick", which uses a completely different Amlogic 
SoC and has different specs, though from what I can tell most commonly call 
that completely different stick, a "Xiaomi Mi TV Stick 4K".

> > +
> > + aliases {
> > + serial0 = &uart_AO;
> > + serial1 = &uart_A;
> > + };
> > +
> > + au2: analog-amplifier {
> > + compatible = "simple-audio-amplifier";
> > + sound-name-prefix = "AU2";
> > + VCC-supply = <&vcc_5v>;
> > + enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
> > + };
> > +
> > + chosen {
> > + stdout-path = "serial0:115200n8";
> > + };
> > +
> > + cvbs-connector {
> > + /* No CVBS connector */
> > + status = "disabled";
> > + };
> > +
> > + emmc_pwrseq: emmc-pwrseq {
> > + compatible = "mmc-pwrseq-emmc";
> > + reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
> > + };
> > +
> > + hdmi-connector {
> > + compatible = "hdmi-connector";
> > + type = "a";
> > +
> > + port {
> > + hdmi_connector_in: endpoint {
> > + remote-endpoint = <&hdmi_tx_tmds_out>;
> > + };
> > + };
> > + };
> > +
> > + leds {
> > + compatible = "gpio-leds";
> > +
> > + led-white {
> > + color = <LED_COLOR_ID_WHITE>;
> > + function = LED_FUNCTION_POWER;
> > + gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
> > + default-state = "heartbeat";
> > + panic-indicator;
> > + };
> > + };
> > +
> > + memory@0 {
> > + device_type = "memory";
> > + reg = <0x0 0x0 0x0 0x40000000>;
> > + };
> > +
> > + vddio_boot: regulator-vddio-boot {
> > + compatible = "regulator-fixed";
> > + regulator-name = "VDDIO_BOOT";
> > + regulator-min-microvolt = <1800000>;
> > + regulator-max-microvolt = <1800000>;
> > + };
> > +
> > + vddao_3v3: regulator-vddao-3v3 {
> > + compatible = "regulator-fixed";
> > + regulator-name = "VDDAO_3V3";
> > + regulator-min-microvolt = <3300000>;
> > + regulator-max-microvolt = <3300000>;
> > + };
> > +
> > + vddio_ao18: regulator-vddio-ao18 {
> > + compatible = "regulator-fixed";
> > + regulator-name = "VDDIO_AO18";
> > + regulator-min-microvolt = <1800000>;
> > + regulator-max-microvolt = <1800000>;
> > + };
> > +
> > + vcc_3v3: regulator-vcc-3v3 {
> > + compatible = "regulator-fixed";
> > + regulator-name = "VCC_3V3";
> > + regulator-min-microvolt = <3300000>;
> > + regulator-max-microvolt = <3300000>;
> > + };
> > +
> > + vcc_5v: regulator-vcc-5v {
> > + compatible = "regulator-fixed";
> > + regulator-name = "VCC_5V";
> > + regulator-min-microvolt = <5000000>;
> > + regulator-max-microvolt = <5000000>;
> > + };
> > +
> > +
> > + emmc_pwrseq: emmc-pwrseq {
> > + compatible = "mmc-pwrseq-emmc";
> > + reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
> > + };
> > +
> > + wifi32k: wifi32k {
> > + compatible = "pwm-clock";
> > + #clock-cells = <0>;
> > + clock-frequency = <32768>;
> > + pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
> > + };
> > +
> > + sdio_pwrseq: sdio-pwrseq {
> > + compatible = "mmc-pwrseq-simple";
> > + reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
> > + clocks = <&wifi32k>;
> > + clock-names = "ext_clock";
> > + };
> > +
> > + sound {
> > + compatible = "amlogic,gx-sound-card";
> > + model = "XIAOMI-AQUAMAN";
>
> Just “AQUAMAN” ?
>

I wanted to retain the vendor name, and since there is a 15 char limit,
just to be safe I used `MI` instead of `XIAOMI`. But I guess 
"XIAOMI-AQUAMAN" should be fine after all.

> > + audio-aux-devs = <&au2>;
> > + audio-widgets = "Line", "Lineout";
> > + audio-routing = "AU2 INL", "ACODEC LOLN",
> > + "AU2 INR", "ACODEC LORN",
> > + "Lineout", "AU2 OUTL",
> > + "Lineout", "AU2 OUTR";
> > + clocks = <&clkc CLKID_MPLL0>,
> > + <&clkc CLKID_MPLL1>,
> > + <&clkc CLKID_MPLL2>;
> > +
> > + 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>;
> > +};
> > +
> > +&ethmac {
> > + /* No Ethernet connector */
> > + status = "disabled";
> > +};
> > +
> > +&internal_phy {
> > + pinctrl-0 = <&eth_link_led_pins>, <&eth_act_led_pins>;
> > + pinctrl-names = "default";
> > +};
> > +
> > +&ir {
> > + /* No IR */
> > + status = "disabled";
> > +};
> > +
> > +&hdmi_tx {
> > + status = "okay";
> > + pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
> > + pinctrl-names = "default";
> > + hdmi-supply = <&vcc_5v>;
> > +};
> > +
> > +&hdmi_tx_tmds_port {
> > + hdmi_tx_tmds_out: endpoint {
> > + remote-endpoint = <&hdmi_connector_in>;
> > + };
> > +};
> > +
> > +&saradc {
> > + status = "okay";
> > + vref-supply = <&vddio_ao18>;
> > +};
> > +
> > +/* Wireless SDIO Module */
> > +&sd_emmc_a {
> > + status = "disabled";
> > + pinctrl-0 = <&sdio_pins>;
> > + pinctrl-1 = <&sdio_clk_gate_pins>;
> > + pinctrl-names = "default", "clk-gate";
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + bus-width = <4>;
> > + cap-sd-highspeed;
> > + max-frequency = <50000000>;
> > +
> > + non-removable;
> > + disable-wp;
> > +
> > + /* WiFi firmware requires power to be kept while in suspend */
> > + keep-power-in-suspend;
> > +
> > + mmc-pwrseq = <&sdio_pwrseq>;
> > +
> > + vmmc-supply = <&vddao_3v3>;
> > + vqmmc-supply = <&vddio_boot>;
>
> If you add a generic SDIO node here board variants will have working
> WiFi regardless of the module used. The idea is used here:
>
> https://patchwork.kernel.org/project/linux-amlogic/patch/20241127043358.3799737-1-christianshewitt@gmail.com/
>

But not all modules are supported in mainline at the moment, that's what I 
meant by "out of scope for this patchset".

> > +};
> > +
> > +/* eMMC */
> > +&sd_emmc_c {
> > + status = "okay";
> > + pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
> > + pinctrl-1 = <&emmc_clk_gate_pins>;
> > + pinctrl-names = "default", "clk-gate";
> > +
> > + bus-width = <8>;
> > + cap-mmc-highspeed;
> > + max-frequency = <200000000>;
> > + non-removable;
> > + disable-wp;
> > + mmc-ddr-1_8v;
> > + mmc-hs200-1_8v;
> > +
> > + mmc-pwrseq = <&emmc_pwrseq>;
> > + vmmc-supply = <&vcc_3v3>;
> > + vqmmc-supply = <&vddio_boot>;
> > +};
> > +
> > +&pwm_ef {
> > + status = "okay";
> > + pinctrl-0 = <&pwm_e_pins>;
> > + pinctrl-names = "default";
> > + clocks = <&clkc CLKID_FCLK_DIV4>;
> > + clock-names = "clkin0";
> > +};
> > +
> > +/* This is connected to the Bluetooth module: */
> > +&uart_A {
> > + status = "okay";
> > + pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
> > + pinctrl-names = "default";
> > + uart-has-rtscts;
> > +};
> > +
> > +&uart_AO {
> > + status = "okay";
> > + pinctrl-0 = <&uart_ao_a_pins>;
> > + pinctrl-names = "default";
> > +};
> > +
> > +&usb {
> > + status = "okay";
> > + dr_mode = "host";
> > +};
> > +
> > +&usb2_phy0 {
> > + phy-supply = <&vcc_5v>;
> > +};
> > -- 
> > 2.47.1
> > 
> > 
> > _______________________________________________
> > linux-amlogic mailing list
> > linux-amlogic@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-amlogic


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] Add support for Xiaomi Mi TV Stick
  2025-01-31 21:23 ` [PATCH 0/2] Add support for Xiaomi Mi " Rob Herring (Arm)
@ 2025-02-01 10:14   ` Ferass El Hafidi
  0 siblings, 0 replies; 11+ messages in thread
From: Ferass El Hafidi @ 2025-02-01 10:14 UTC (permalink / raw)
  To: Rob Herring (Arm)
  Cc: Conor Dooley, linux-amlogic, Neil Armstrong, Jerome Brunet,
	linux-arm-kernel, ~postmarketos/upstreaming, devicetree,
	Krzysztof Kozlowski, Kevin Hilman, linux-kernel, Karl Chan,
	Martin Blumenstingl, Artur Weber

Hi!

On Fri Jan 31, 2025 at 9:23 PM UTC, Rob Herring (Arm) wrote:
<snip>
> arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dtb: pwm@86c0: clock-names: False schema does not allow ['clkin0']
> 	from schema $id: http://devicetree.org/schemas/pwm/pwm-amlogic.yaml#

I don't think I touched that bit.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-p241.dts#n279

> arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dtb: leds: led-white:default-state:0: 'heartbeat' is not one of ['on', 'off', 'keep']
> 	from schema $id: http://devicetree.org/schemas/leds/leds-gpio.yaml#
> arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dtb: leds: led-white: Unevaluated properties are not allowed ('default-state' was unexpected)
> 	from schema $id: http://devicetree.org/schemas/leds/leds-gpio.yaml#

I'll fix the rest in a v2, thanks!

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] dt-bindings: arm: amlogic: add Xiaomi Mi TV Stick
  2025-02-01  5:45   ` Christian Hewitt
@ 2025-02-01 10:36     ` Ferass El Hafidi
  0 siblings, 0 replies; 11+ messages in thread
From: Ferass El Hafidi @ 2025-02-01 10:36 UTC (permalink / raw)
  To: Christian Hewitt
  Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel,
	~postmarketos/upstreaming, Artur Weber, Karl Chan

On Sat Feb 1, 2025 at 5:45 AM UTC, Christian Hewitt wrote:
> > On 1 Feb 2025, at 12:03 am, Ferass El Hafidi <funderscore@postmarketos.org> wrote:
> > 
> > From: Ferass El Hafidi <funderscore@postmarketos.org>
> > 
> > Add support for xiaomi-aquaman.
> > 
> > Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
> > ---
> > Documentation/devicetree/bindings/arm/amlogic.yaml | 1 +
> > 1 file changed, 1 insertion(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml
> > index 0647851ae..0db7038b9 100644
> > --- a/Documentation/devicetree/bindings/arm/amlogic.yaml
> > +++ b/Documentation/devicetree/bindings/arm/amlogic.yaml
> > @@ -70,6 +70,7 @@ properties:
> >           - enum:
> >               - amlogic,p241
> >               - libretech,aml-s805x-ac
> > +              - xiaomi,aquaman
>
> If this is S805Y not S805X, you should add a new binding section for
> S805Y devices, and add the board there.

Will do.  Thanks.

>
> e.g. I did this for S905L (GXLX) devices:
> https://patchwork.kernel.org/project/linux-amlogic/patch/20240604084134.3315841-1-christianshewitt@gmail.com/
>
> Christian
>
> >           - const: amlogic,s805x
> >           - const: amlogic,meson-gxl
> > 
> > -- 
> > 2.47.1
> > 
> > 
> > _______________________________________________
> > linux-amlogic mailing list
> > linux-amlogic@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-amlogic


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] arm64: dts: amlogic: add support for xiaomi-aquaman/Mi TV Stick
  2025-01-31 20:03 ` [PATCH 2/2] arm64: dts: amlogic: add support for xiaomi-aquaman/Mi " Ferass El Hafidi
  2025-02-01  6:08   ` Christian Hewitt
@ 2025-02-01 11:01   ` Martin Blumenstingl
  1 sibling, 0 replies; 11+ messages in thread
From: Martin Blumenstingl @ 2025-02-01 11:01 UTC (permalink / raw)
  To: Ferass El Hafidi
  Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-amlogic,
	linux-arm-kernel, devicetree, linux-kernel,
	~postmarketos/upstreaming, Artur Weber, Karl Chan

Hello,

thanks for the patch - I have a few small comments below.

On Fri, Jan 31, 2025 at 9:05 PM Ferass El Hafidi
<funderscore@postmarketos.org> wrote:
[...]
> +       cvbs-connector {
> +               /* No CVBS connector */
> +               status = "disabled";
> +       };
You're inheriting  "meson-gxl-s805x.dtsi" but I can't see that this -
or its parents - define a cvbs-connector node anywhere.
Can we just omit it completely

[...]
> +       vcc_5v: regulator-vcc-5v {
> +               compatible = "regulator-fixed";
> +               regulator-name = "VCC_5V";
> +               regulator-min-microvolt = <5000000>;
> +               regulator-max-microvolt = <5000000>;
> +       };
> +
> +
nit-pick: since you're planning to send a v2 anyways, keep it at one
blank line here

[...]
> +&ethmac {
> +       /* No Ethernet connector */
> +       status = "disabled";
> +};
Similar to the cvbs-connector: status = "disabled" should be the default here

> +&internal_phy {
> +       pinctrl-0 = <&eth_link_led_pins>, <&eth_act_led_pins>;
> +       pinctrl-names = "default";
> +};
why are there Ethernet LED pins if there's no Ethernet connector?

> +&ir {
> +       /* No IR */
> +       status = "disabled";
> +};
This is also disabled by default

[...]
> +&pwm_ef {
> +       status = "okay";
> +       pinctrl-0 = <&pwm_e_pins>;
> +       pinctrl-names = "default";
> +       clocks = <&clkc CLKID_FCLK_DIV4>;
> +       clock-names = "clkin0";
> +};
Please drop clocks and clock-names to make this work with linux-next.
Background: [0] is queued for the next release and it means that the
PWM controller driver will now pick the "best" clock on it's own and
overriding here will likely result in your board not booting.

[...]
> +&usb {
> +       status = "okay";
> +       dr_mode = "host";
> +};
> +
> +&usb2_phy0 {
> +       phy-supply = <&vcc_5v>;
> +};
I'm guilty of this myself and I think you can be better here:
Use vbus-supply = <&vcc_5v>; in the &usb node to correctly describe
where the USB VBUS signal is coming from.
(I believe that the PHY is not internally powered by 5V as the SoC
doesn't take any 5V inputs)


Best regards,
Martin


[0] https://lore.kernel.org/linux-amlogic/20241227212514.1376682-1-martin.blumenstingl@googlemail.com/

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] Add support for Xiaomi Mi TV Stick
  2025-01-31 20:03 [PATCH 0/2] Add support for Xiaomi Mi TV Stick Ferass El Hafidi
                   ` (2 preceding siblings ...)
  2025-01-31 21:23 ` [PATCH 0/2] Add support for Xiaomi Mi " Rob Herring (Arm)
@ 2025-02-01 19:33 ` Ferass El Hafidi
  3 siblings, 0 replies; 11+ messages in thread
From: Ferass El Hafidi @ 2025-02-01 19:33 UTC (permalink / raw)
  To: Ferass El Hafidi, Neil Armstrong, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-amlogic
  Cc: linux-arm-kernel, devicetree, linux-kernel,
	~postmarketos/upstreaming, Artur Weber, Karl Chan

Hi,

On Fri Jan 31, 2025 at 8:03 PM UTC, Ferass El Hafidi wrote:
> From: Ferass El Hafidi <funderscore@postmarketos.org>
>
> This patch series aims to add initial support for the Xiaomi Mi TV
> Stick.
>
> Xiaomi Mi TV Stick is a small Amlogic-based Android TV stick released in 
> 2020, and known as `xiaomi-aquaman` internally (in the downstream kernel,
> u-boot, ...)
> Its specifications are as follows:
>  * Amlogic S805Y SoC (believed to be mostly identical to S805X)
>  * 8 GB eMMC
>  * 1 GB of RAM
>  * Android TV 9, upgradable to Android TV 10
>
> There are multiple variants:
>  * 1. Green PCB, manufactured in 2020, known UART pinout (helpfully 
>    labeled on the board)
>  * 2. Blue PCB, not much documentation about it, presumably manufactured
>    between 2021 and 2023
>  * 3. Green PCB, manufactured in 2023, known UART pinout, some layout
>    changes compared to the 2020 variant
>
> Among these variants, there are many boards using multiple different
> Wi-Fi chips.  Supporting all of them is out of scope for this patch
> series.
>
> As of the time of writing this has only been tested on the 3rd variant.
> It is believed that software-wise all three work mostly the same (if we 
> don't count Wi-Fi), but testing on the other variants would still be
> appreciated.
>
> The devicetree is based on the Amlogic P241 DTS.
>
> Ferass El Hafidi (2):
>   dt-bindings: arm: amlogic: add Xiaomi Mi TV Stick
>   arm64: dts: amlogic: add support for xiaomi-aquaman/Mi TV Stick
>
>  .../devicetree/bindings/arm/amlogic.yaml      |   1 +
>  arch/arm64/boot/dts/amlogic/Makefile          |   1 +
>  .../meson-gxl-s805y-xiaomi-aquaman.dts        | 311 ++++++++++++++++++
>  3 files changed, 313 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxl-s805y-xiaomi-aquaman.dts

Superseded by v2: https://lore.kernel.org/all/20250201193044.28856-1-funderscore@postmarketos.org/

Cheers.

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-02-01 19:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-31 20:03 [PATCH 0/2] Add support for Xiaomi Mi TV Stick Ferass El Hafidi
2025-01-31 20:03 ` [PATCH 1/2] dt-bindings: arm: amlogic: add " Ferass El Hafidi
2025-02-01  5:45   ` Christian Hewitt
2025-02-01 10:36     ` Ferass El Hafidi
2025-01-31 20:03 ` [PATCH 2/2] arm64: dts: amlogic: add support for xiaomi-aquaman/Mi " Ferass El Hafidi
2025-02-01  6:08   ` Christian Hewitt
2025-02-01 10:11     ` Ferass El Hafidi
2025-02-01 11:01   ` Martin Blumenstingl
2025-01-31 21:23 ` [PATCH 0/2] Add support for Xiaomi Mi " Rob Herring (Arm)
2025-02-01 10:14   ` Ferass El Hafidi
2025-02-01 19:33 ` Ferass El Hafidi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox