From patchwork Tue Apr 18 14:55:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karl Chan X-Patchwork-Id: 675327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C19ADC6FD18 for ; Tue, 18 Apr 2023 14:56:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231888AbjDRO4z (ORCPT ); Tue, 18 Apr 2023 10:56:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230423AbjDRO4s (ORCPT ); Tue, 18 Apr 2023 10:56:48 -0400 Received: from new-shark9.inbox.lv (new-shark9.inbox.lv [194.152.32.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4483B1445D; Tue, 18 Apr 2023 07:56:40 -0700 (PDT) Received: from shark3.inbox.lv (shark3 [10.0.1.83]) by new-shark9.inbox.lv (Postfix) with ESMTP id 08106480B44; Tue, 18 Apr 2023 17:55:55 +0300 (EEST) Received: from shark3.inbox.lv (localhost [127.0.0.1]) by shark3-out.inbox.lv (Postfix) with ESMTP id EA421280190; Tue, 18 Apr 2023 17:55:54 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=inbox.lv; s=p20220324; t=1681829755; x=1681831555; bh=ckr+7S+AWmFP5xH8nvjhWaAJn1ssE+IC9MJBNAHU/xs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:X-ESPOL: From:Date:To:Cc:Message-ID:Subject:Reply-To; b=GwIemuoYTR4T+5usu+Yn+8q0rHE8ReRdb1/pXiO61KAhblXUadS1MzFUo0twoTEP0 KNYAGxJ/oOqZz02lV2pDGL/f8YPqBjFVKKG9JG0+bCgMzJxTEuSdUynDRjvF8aSjAG EkztrzRppt00Tx2fBBkz9GSPwI3zNcOcxoyl75ks= Received: from localhost (localhost [127.0.0.1]) by shark3-in.inbox.lv (Postfix) with ESMTP id E359E28017B; Tue, 18 Apr 2023 17:55:54 +0300 (EEST) Received: from shark3.inbox.lv ([127.0.0.1]) by localhost (shark3.inbox.lv [127.0.0.1]) (spamfilter, port 35) with ESMTP id jSx4nGDyTP0R; Tue, 18 Apr 2023 17:55:54 +0300 (EEST) Received: from mail.inbox.lv (pop1 [127.0.0.1]) by shark3-in.inbox.lv (Postfix) with ESMTP id 6AFA3280158; Tue, 18 Apr 2023 17:55:54 +0300 (EEST) From: Karl Chan To: linux-amlogic@lists.infradead.org Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, neil.armstrong@linaro.org, khilman@baylibre.com, jbrunet@baylibre.com, martin.blumenstingl@googlemail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Karl Chan" , Karl Chan Subject: [PATCH v4 2/2] arm64: dts: meson-gxl: add support for Xiaomi Mi box 3 Date: Tue, 18 Apr 2023 22:55:15 +0800 Message-Id: <20230418145515.19547-3-exkcmailist@inbox.lv> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230418145515.19547-1-exkcmailist@inbox.lv> References: <20230418145515.19547-1-exkcmailist@inbox.lv> MIME-Version: 1.0 X-Virus-Scanned: OK X-ESPOL: AJqEQ3sB+w1Luca2K41p5eDjx8rAJVdbxjuDrrAx6HtHtLDGrdd2bmeUB/eRFELmMmLD Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: "Karl Chan" The Xiaomi Mi box 3 is a TV box based on the Amlogic S905X chipset. There are two variants: - 2 GiB/8GIB - 1 GiB/4GIB Both variants come with: - 802.11a/b/g/n/ac wifi (BCM4345) - HDMI , AV (CVBS) and S/PDIF optical output - 1x USB (utilizing both USB ports provided by the SoC) Signed-off-by: Karl Chan --- arch/arm64/boot/dts/amlogic/Makefile | 1 + .../amlogic/meson-gxl-s905x-xiaomi-mibox3.dts | 138 ++++++++++++++++++ list | 1 + 3 files changed, 140 insertions(+) create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-xiaomi-mibox3.dts create mode 100644 list diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile index ccf1ba57fa87..774e7c3638bb 100644 --- a/arch/arm64/boot/dts/amlogic/Makefile +++ b/arch/arm64/boot/dts/amlogic/Makefile @@ -48,6 +48,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc-v2.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc.dtb 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-xiaomi-mibox3.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxm-gt1-ultimate.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxm-mecool-kiii-pro.dtb diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-xiaomi-mibox3.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-xiaomi-mibox3.dts new file mode 100644 index 000000000000..acc4b12ffe0f --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-xiaomi-mibox3.dts @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2016 Endless Computers, Inc. + * Author: Carlo Caione + * Copyright (c) 2023 Karl Chan + */ + +/dts-v1/; + +#include "meson-gxl-s905x-p212.dtsi" +#include + +/ { + compatible = "xiaomi,mibox3", "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-MIBOX3"; + 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>; + }; +}; + +ðmac { + status = "disabled"; +}; + +&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>; + }; +}; + +/* This UART is brought out to the uart pad on upper left of the pcb */ +&uart_AO { + status = "okay"; +}; +