Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp84919lqh; Wed, 27 Mar 2024 15:53:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/yPRlcxuJiwbt6Fd9Ki979aTCOvEK6M2RsYfF83/oMxFClgHWJz4TtvYmsV8oq5iUtW7qRWDfcW7Xw/OzXcSB/85hUzUKfO/SbpGXhw== X-Google-Smtp-Source: AGHT+IG9IgY75UU0I3BBLfdlKfv5uGJOIAftkMgtAGrd8bnQwuC/B1IHF1+6NQUBb/Xh0rOMTs9B X-Received: by 2002:a05:6a20:e607:b0:1a3:c6aa:ec7d with SMTP id my7-20020a056a20e60700b001a3c6aaec7dmr892098pzb.16.1711579986725; Wed, 27 Mar 2024 15:53:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711579986; cv=pass; d=google.com; s=arc-20160816; b=iwWLD1nBem/2ZQIiLVjj2sKKgnJXkn596T9bAucKfIcQY06+tGkzqXJz3gH12LdIK+ wJQsNOIkFqtiHjwiGtP8FBcb1KEcIUXyBoKbLbvY3ZA6cHF3XzgedBCnQe3h7lMI1cQw 7qpaOFtNUkwDJS2kKJ1Wc1zz9ARHBwoHk8zRoYDLIekTGS/SZp2sx2Vc4vCnrTI+/CeH tctdGth1K/i9gNK65INqWywWbSETpIzT8ryGSRVL17fJcomwyBACV1AgmPa0DXFzAE7X Zr0BGfDofvJ2sNWRlQexyRWsTbpkZlWU0cCJYUNJCgW+V7vu2vseZ7q2yM5tKry3xuFG B3wA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=t2UHbRSDMo9/5e0JAM+2+ufNST9SCoUcNN3UkNyDLyM=; fh=QA5GnWCQuqA2GqyjXywW3psLrdeBWRu2yH7eTZJTW+A=; b=wBvTWg/pyn86h2XLZw1+M3ipX4UFbwZAN2GHMY6cykJ0IXapJECsdg5PP+m82I57jN 13Hj/i0979geCiXH6FAmwrv+PVlDgGokcTsF2FIy3LKXTKc50yOG+GaA+ZYmLDxiUzLZ +aK6lA2a1MGcVT71b1buvkviFauVH0fMzkdHuzvpr18Ao4tPys2/+1KhaCwvwecuSUNt BrvqJ5KcwghKybDwwk0hL3A3o0EmzOz2w4ZWgddlfBVntHEIAtof6UBbkWeAVA84LNK2 h42+bKHE4HJxa8Om0mHbWhYD/UEKd9deWLrCXofejgSVLo4qur50F7ah6F8+t91nPmn5 Mupg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=B19C45zt; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-122120-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122120-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x36-20020a056a0018a400b006e6bc8de586si149768pfh.133.2024.03.27.15.53.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 15:53:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122120-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=B19C45zt; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-122120-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122120-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6371F299CEE for ; Wed, 27 Mar 2024 22:53:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FF2E15442B; Wed, 27 Mar 2024 22:52:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="B19C45zt" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBDBC153BE3; Wed, 27 Mar 2024 22:52:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711579957; cv=none; b=MGe5td6JYunL90xgjP9zdY6A3OGEBeqnUhfyXF7qqWiQXFlcHiaDZHH6xPBPV8gNuknBWJm4oS8barsXY1551P/YxXrcYsz25d+nnPE3TeoyVLveNbhymh+RbykyOPPIzErOZgtKgg00NyooufBFDzPr8zZK0Z1ocFNGuhYSloc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711579957; c=relaxed/simple; bh=rwhs272FowK95SxyC91CTrbbo09Um+krIKee4Vn5TJg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BbVHM0DLrOZVt4C2z7o/E5TCp8ubqofwT2yuC1eaaH2TT6YS2/6ANcaVNckPh8UCbTfCt0ooyORRb3mFkaLofIzEfSqI7AOwKgaL7p0CSYrm3H9YKzDF6Wuzwq+p0xllMWmcIQ2v4HK1XuIXMu3hwkLPTApUH1CZQSJjlu09fxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=B19C45zt; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1711579954; bh=rwhs272FowK95SxyC91CTrbbo09Um+krIKee4Vn5TJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B19C45ztFV0AJt+YTkr6+YDXLX1CmjdgfbOO2aE/qBCw3p2P1DhImc9aPe70/deDj R/1e6B/i4kbrbH7HWR+VxQaazoBzkz/a/ezcjpGlTKxQOd4LQAbQu1602F7tFQktJs cyvhQnbE9y7jsPrRYV1mVoSKli+QGf8DtcN2wGtsbXkpN3OKHu/3Bmawj1Phk7835N DN8RpaMrL9TdJCeftz3QW+4bnrfiQHS9qMnvO0YmctNPKoU7f3j5YV5oqMZAw4wqCK dpZQ5pj0nOwq7WjQTZPfP2THL7hv1A8ZhzVHb68/kUSwKJrnyzPvRa23qz8dPpKjAQ a/0H7wPG8eJSQ== Received: from shreeya.shreeya (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 4C6233782111; Wed, 27 Mar 2024 22:52:21 +0000 (UTC) From: Shreeya Patel To: heiko@sntech.de, mchehab@kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, jose.abreu@synopsys.com, nelson.costa@synopsys.com, dmitry.osipenko@collabora.com, sebastian.reichel@collabora.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, linux-clk@vger.kernel.org, linux-arm@lists.infradead.org, Shreeya Patel Subject: [PATCH v3 4/6] arm64: dts: rockchip: Add device tree support for HDMI RX Controller Date: Thu, 28 Mar 2024 04:20:55 +0530 Message-Id: <20240327225057.672304-5-shreeya.patel@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240327225057.672304-1-shreeya.patel@collabora.com> References: <20240327225057.672304-1-shreeya.patel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 .../boot/dts/rockchip/rk3588-pinctrl.dtsi | 41 ++++++++++++++ .../boot/dts/rockchip/rk3588-rock-5b.dts | 19 +++++++ arch/arm64/boot/dts/rockchip/rk3588.dtsi | 56 +++++++++++++++++++ 3 files changed, 116 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-pinctrl.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-pinctrl.dtsi index 244c66faa161..4fbe194d96b1 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-pinctrl.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-pinctrl.dtsi @@ -169,6 +169,47 @@ hdmim0_tx1_sda: hdmim0-tx1-sda { /* hdmim0_tx1_sda */ <2 RK_PB4 4 &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 = + /* hdmim1_rx_cec */ + <3 RK_PD1 5 &pcfg_pull_none>; + }; + + /omit-if-no-ref/ + hdmim1_rx_hpdin: hdmim1-rx-hpdin { + rockchip,pins = + /* hdmim1_rx_hpdin */ + <3 RK_PD4 5 &pcfg_pull_none>; + }; + + /omit-if-no-ref/ + hdmim1_rx_scl: hdmim1-rx-scl { + rockchip,pins = + /* hdmim1_rx_scl */ + <3 RK_PD2 5 &pcfg_pull_none>; + }; + + /omit-if-no-ref/ + hdmim1_rx_sda: hdmim1-rx-sda { + rockchip,pins = + /* hdmim1_rx_sda */ + <3 RK_PD3 5 &pcfg_pull_none>; + }; }; i2c0 { diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts index 1fe8b2a0ed75..b96ed7dea39a 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts @@ -180,6 +180,18 @@ &cpu_l3 { cpu-supply = <&vdd_cpu_lit_s0>; }; +&hdmi_receiver { + status = "okay"; + hpd-gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&hdmim1_rx_cec &hdmim1_rx_hpdin &hdmim1_rx_scl + &hdmim1_rx_sda &hdmirx_5v_detection>; + pinctrl-names = "default"; +}; + +&hdmi_receiver_cma { + status = "okay"; +}; + &i2c0 { pinctrl-names = "default"; pinctrl-0 = <&i2c0m2_xfer>; @@ -303,6 +315,13 @@ &pcie3x4 { }; &pinctrl { + + hdmirx { + hdmirx_5v_detection: hdmirx-5v-detection { + rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + hym8563 { hym8563_int: hym8563-int { rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; diff --git a/arch/arm64/boot/dts/rockchip/rk3588.dtsi b/arch/arm64/boot/dts/rockchip/rk3588.dtsi index 5519c1430cb7..51b04d826e8f 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588.dtsi @@ -7,6 +7,29 @@ #include "rk3588-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"; + }; + }; + pcie30_phy_grf: syscon@fd5b8000 { compatible = "rockchip,rk3588-pcie3-phy-grf", "syscon"; reg = <0x0 0xfd5b8000 0x0 0x10000>; @@ -85,6 +108,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>; -- 2.39.2