From patchwork Fri Jul 19 12:40:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreeya Patel X-Patchwork-Id: 13737312 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB372C3DA59 for ; Fri, 19 Jul 2024 12:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k/pRYWn/NsaZM+uBXU+VsvTYe75BMK6GmVzT/v3pduc=; b=SYEaqKHSPY3sJz 5oPYoLJgdWOCW5grLgurZYvdCCvZabSe9AWEo1c/IgojAFOt/g+hFjENT+lIC++7ne4ujyqS2sGf4 TEak2Ny1FRyiLC5uL/JW1UKs92jWHRsysXT0RlAAlBALAN04G41vrU7Qpdj2+sbxBvoAV6ATphxRR LnSEgB4oTDlnaeb5bIZIpudN2yg2QDIWamgtI9yrXX1yQQDWoX3Nm7SIJTv7+EfjB//PD3fJE+Fv0 4BTfYLpUcl/sRrc2jse2VWOLCyfZNifI2A+j4tr2dswlFLGMWpcHIdXGWUGB7Yi8VQYvzMDrfSJNC EWsDFxo7F4tpMhTe03bA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUmwd-00000002gKP-2PVA; Fri, 19 Jul 2024 12:42:43 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUmvW-00000002frF-2ZGt; Fri, 19 Jul 2024 12:41:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1721392893; bh=dkJBI/WEA7Z2zjS69onvJAqMWQn0HPSur5PVPAjeGPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wCaIv5iIRe2M5QSoQhZpTCAX8UNXGDhObjY6YEvyi6Vzkf7Sh4ZvOyUssK+kB/Ett 16ZLbE36wbQsL1M1pptkT8ud/QjqBDlxjum2U2/TCuFQogCAFNOLwnVkGdwl/M9BBm BZ2ZwSyaGsg9VIkCoxtgQ9AZ8oOsg6Mi45hHZAbhN0IV+sTn8f+RxUFcDTjO8GMfx8 oGkUja+oKg2b40/g9tJMZ5AUfbWHw0s7EQHyqWkC2BHAb+Ptf1tPm8PIfkpRcv8NuQ E/36q4IZTdWKF+F5Lwif3f3lI7mBEG6ggXbO6SAGC59sQfxOgjyH/MPop6LR38wC5C ukfpRHC8ypRCQ== Received: from shreeya.shreeya (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: shreeya) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 61FD937821CE; Fri, 19 Jul 2024 12:41:28 +0000 (UTC) From: Shreeya Patel To: heiko@sntech.de, mchehab@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, jose.abreu@synopsys.com, nelson.costa@synopsys.com, shawn.wen@rock-chips.com, nicolas.dufresne@collabora.com, hverkuil@xs4all.nl, hverkuil-cisco@xs4all.nl Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Shreeya Patel , Dmitry Osipenko Subject: [PATCH v4 3/4] arm64: dts: rockchip: Add device tree support for HDMI RX Controller Date: Fri, 19 Jul 2024 18:10:31 +0530 Message-Id: <20240719124032.26852-4-shreeya.patel@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240719124032.26852-1-shreeya.patel@collabora.com> References: <20240719124032.26852-1-shreeya.patel@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240719_054134_807600_697DBDB2 X-CRM114-Status: GOOD ( 12.79 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Add device tree support for Synopsys DesignWare HDMI RX Controller. Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko Co-developed-by: Dingxian Wen Signed-off-by: Dingxian Wen Signed-off-by: Shreeya Patel --- Changes in v4 :- - Remove DTS changes added to this patch - Remove the HDMI RX pin nodes as it's already present in the rk3588-base-pinctrl.dtsi Changes in v3 :- - Rename cma node and phandle names - Elaborate the comment to explain 160MiB calculation - Move &hdmi_receiver_cma to the rock5b dts file Changes in v2 :- - Fix some of the checkpatch errors and warnings - Rename resets, vo1-grf and HPD - Move hdmirx_cma node to the rk3588.dtsi file .../dts/rockchip/rk3588-base-pinctrl.dtsi | 14 +++++ .../arm64/boot/dts/rockchip/rk3588-extra.dtsi | 56 +++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi index 30db12c4fc82..ca006f5a4c90 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi @@ -594,6 +594,20 @@ hdmim0_tx1_hpd: hdmim0-tx1-hpd { /* hdmim0_tx1_hpd */ <1 RK_PA6 5 &pcfg_pull_none>; }; + + /omit-if-no-ref/ + hdmim1_rx: hdmim1-rx { + rockchip,pins = + /* hdmim1_rx_cec */ + <3 RK_PD1 5 &pcfg_pull_none>, + /* hdmim1_rx_scl */ + <3 RK_PD2 5 &pcfg_pull_none_smt>, + /* hdmim1_rx_sda */ + <3 RK_PD3 5 &pcfg_pull_none_smt>, + /* hdmim1_rx_hpdin */ + <3 RK_PD4 5 &pcfg_pull_none>; + }; + /omit-if-no-ref/ hdmim1_rx_cec: hdmim1-rx-cec { rockchip,pins = diff --git a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi index 0ce0934ec6b7..96f8ce91eaf4 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi @@ -7,6 +7,29 @@ #include "rk3588-extra-pinctrl.dtsi" / { + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* + * The 4k HDMI capture controller works only with 32bit + * phys addresses and doesn't support IOMMU. HDMI RX CMA + * must be reserved below 4GB. + * The size of 160MB was determined as follows: + * (3840 * 2160 pixels) * (4 bytes/pixel) * (2 frames/buffer) / 10^6 = 66MB + * To ensure sufficient support for practical use-cases, + * we doubled the 66MB value. + */ + hdmi_receiver_cma: hdmi-receiver-cma { + compatible = "shared-dma-pool"; + alloc-ranges = <0x0 0x0 0x0 0xffffffff>; + size = <0x0 (160 * 0x100000)>; /* 160MiB */ + no-map; + status = "disabled"; + }; + }; + usb_host1_xhci: usb@fc400000 { compatible = "rockchip,rk3588-dwc3", "snps,dwc3"; reg = <0x0 0xfc400000 0x0 0x400000>; @@ -135,6 +158,39 @@ i2s10_8ch: i2s@fde00000 { status = "disabled"; }; + hdmi_receiver: hdmi_receiver@fdee0000 { + compatible = "rockchip,rk3588-hdmirx-ctrler", "snps,dw-hdmi-rx"; + reg = <0x0 0xfdee0000 0x0 0x6000>; + power-domains = <&power RK3588_PD_VO1>; + rockchip,grf = <&sys_grf>; + rockchip,vo1-grf = <&vo1_grf>; + interrupts = , + , + ; + interrupt-names = "cec", "hdmi", "dma"; + clocks = <&cru ACLK_HDMIRX>, + <&cru CLK_HDMIRX_AUD>, + <&cru CLK_CR_PARA>, + <&cru PCLK_HDMIRX>, + <&cru CLK_HDMIRX_REF>, + <&cru PCLK_S_HDMIRX>, + <&cru HCLK_VO1>; + clock-names = "aclk", + "audio", + "cr_para", + "pclk", + "ref", + "hclk_s_hdmirx", + "hclk_vo1"; + resets = <&cru SRST_A_HDMIRX>, <&cru SRST_P_HDMIRX>, + <&cru SRST_HDMIRX_REF>, <&cru SRST_A_HDMIRX_BIU>; + reset-names = "axi", "apb", "ref", "biu"; + memory-region = <&hdmi_receiver_cma>; + pinctrl-0 = <&hdmim1_rx>; + pinctrl-names = "default"; + status = "disabled"; + }; + pcie3x4: pcie@fe150000 { compatible = "rockchip,rk3588-pcie", "rockchip,rk3568-pcie"; #address-cells = <3>;