From mboxrd@z Thu Jan 1 00:00:00 1970 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 C9E76C27C79 for ; Thu, 20 Jun 2024 13:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=08lCG8iRSgA0wElASn6YvBTdiZfzeFAEalw0JDGOOuw=; b=4NxCrHtLadQ0i92CA8Z97mbZJZ 01Rgt1BhD3DPVfPksAj5tdwE5LEvuPa/7nf6wxOftnlusOVnhbeKTxb/HouFo3Y6wsE5cI4VUoQWj JNx3P4RF0j/btssry9fhKtuvzijip+c2MAHVlbArkWQxI/IpY6ijGepA1VbKbPM4/1tBGPLb+ZXtB O4uEXmMlOcBrqX2TgoY/OmntsK4P0jHUqcoX7zypv9dhVsY12INNdlMg4FN6BtPmxDpY0Q+WM/FDy sjkzm3oU5P3VpLNHhaCQLN+SF/TG+bQwruapJoIEw1SCFJqS29RqCKh5Zb1K5EFnXdPIlxEFXlSEQ V8LlNpWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKHtY-00000005Czo-2YZs; Thu, 20 Jun 2024 13:32:08 +0000 Received: from madrid.collaboradmins.com ([2a00:1098:ed:100::25]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKHtS-00000005CvG-14Gn; Thu, 20 Jun 2024 13:32:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718890319; bh=uqG9px9whCOW7Gcy1yIYPJjONlTNDqAYB6qYXXu9HbU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xZuAGHw+/sI4LMWxddUXw71RUXUUW5iDMoOe+CTqIlhfHc/9NXB+X/DRa3sDOg+NE +WNZt7g71jn1kcvimEt0riEq99o3Of0ELJQb4++nds7q2O9Aj0kEBhU9xBwt5j/y1c G1b+ChjqCbqhf3x107WrDksKHFoCJ2iFl552kM0vEiVHuAQnWz4XKnhx2uiNsfvzwL oH4Bw9vDynmeLpd/yabwU6L/LPSgDkTCcRqOb4NQgAN+ahln9cdT/ZIQ3ve+LzINb4 w+x7kCQuEnfjn238wLIOECS7AjNrWjFXDUuZbf+VubHw0sVez9e7jAltdA/CemY4ZH zoPv0zkMFd5iQ== Received: from arisu.localnet (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: detlev) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 543853782039; Thu, 20 Jun 2024 13:31:56 +0000 (UTC) From: Detlev Casanova To: Alex Bee , Jonas Karlman Cc: Ezequiel Garcia , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Greg Kroah-Hartman , Sebastian Reichel , Dragan Simic , Diederik de Haas , Andy Yan , Boris Brezillon , Hans Verkuil , Daniel Almeida , Paul Kocialkowski , Nicolas Dufresne , Benjamin Gaignard , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] arm64: dts: rockchip: Add rkvdec2 Video Decoder on rk3588(s) Date: Thu, 20 Jun 2024 09:31:27 -0400 Message-ID: <5790441.DvuYhMxLoT@arisu> Organization: Collabora In-Reply-To: References: <20240619150029.59730-1-detlev.casanova@collabora.com> <052f2ea7-2ded-4d39-a513-3a47fee1bf02@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6055362.lOV4Wx5bFT"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240620_063204_118892_3DC857A2 X-CRM114-Status: GOOD ( 34.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --nextPart6055362.lOV4Wx5bFT Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Detlev Casanova To: Alex Bee , Jonas Karlman Date: Thu, 20 Jun 2024 09:31:27 -0400 Message-ID: <5790441.DvuYhMxLoT@arisu> Organization: Collabora In-Reply-To: MIME-Version: 1.0 Hi Jonas, Alex, On Wednesday, June 19, 2024 2:06:40 P.M. EDT Jonas Karlman wrote: > Hi Alex, > > On 2024-06-19 19:19, Alex Bee wrote: > > Am 19.06.24 um 17:28 schrieb Jonas Karlman: > >> Hi Detlev, > >> > >> On 2024-06-19 16:57, Detlev Casanova wrote: > >>> Add the rkvdec2 Video Decoder to the RK3588s devicetree. > >>> > >>> Signed-off-by: Detlev Casanova > >>> --- > >>> > >>> arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 50 +++++++++++++++++++++++ > >>> 1 file changed, 50 insertions(+) > >>> > >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi > >>> b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index > >>> 6ac5ac8b48ab..7690632f57f1 100644 > >>> --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi > >>> +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi > >>> @@ -2596,6 +2596,16 @@ system_sram2: sram@ff001000 { > >>> > >>> ranges = <0x0 0x0 0xff001000 0xef000>; > >>> #address-cells = <1>; > >>> #size-cells = <1>; > >>> > >>> + > >>> + vdec0_sram: rkvdec-sram@0 { > >>> + reg = <0x0 0x78000>; > >>> + pool; > >>> + }; > >>> + > >>> + vdec1_sram: rkvdec-sram@1 { > >>> + reg = <0x78000 0x77000>; > >>> + pool; > >>> + }; > >>> > >>> }; > >>> > >>> pinctrl: pinctrl { > >>> > >>> @@ -2665,6 +2675,46 @@ gpio4: gpio@fec50000 { > >>> > >>> #interrupt-cells = <2>; > >>> > >>> }; > >>> > >>> }; > >>> > >>> + > >>> + vdec0: video-decoder@fdc38100 { > >>> + compatible = "rockchip,rk3588-vdec"; > >>> + reg = <0x0 0xfdc38100 0x0 0x500>; > >>> + interrupts = ; > >>> + clocks = <&cru ACLK_RKVDEC0>, <&cru HCLK_RKVDEC0>, <&cru > >>> CLK_RKVDEC0_CA>, + <&cru CLK_RKVDEC0_CORE>, <&cru > >>> CLK_RKVDEC0_HEVC_CA>; > >>> + clock-names = "axi", "ahb", "cabac", "core", "hevc_cabac"; > >>> + assigned-clocks = <&cru ACLK_RKVDEC0>, <&cru CLK_RKVDEC0_CORE>, > >>> + <&cru CLK_RKVDEC0_CA>, <&cru CLK_RKVDEC0_HEVC_CA>; > >>> + assigned-clock-rates = <800000000>, <600000000>, > >>> + <600000000>, <1000000000>; > >>> + resets = <&cru SRST_A_RKVDEC0>, <&cru SRST_H_RKVDEC0>, <&cru > >>> SRST_RKVDEC0_CA>, + <&cru SRST_RKVDEC0_CORE>, <&cru > >>> SRST_RKVDEC0_HEVC_CA>; > >>> + reset-names = "rst_axi", "rst_ahb", "rst_cabac", > >>> + "rst_core", "rst_hevc_cabac"; > >>> + power-domains = <&power RK3588_PD_RKVDEC0>; > >>> + sram = <&vdec0_sram>; > >>> + status = "okay"; > >>> + }; > >>> + > >>> + vdec1: video-decoder@fdc40100 { > >>> + compatible = "rockchip,rk3588-vdec"; > >>> + reg = <0x0 0xfdc40100 0x0 0x500>; > >>> + interrupts = ; > >>> + clocks = <&cru ACLK_RKVDEC1>, <&cru HCLK_RKVDEC1>, <&cru > >>> CLK_RKVDEC1_CA>, + <&cru CLK_RKVDEC1_CORE>, <&cru > >>> CLK_RKVDEC1_HEVC_CA>; > >>> + clock-names = "axi", "ahb", "cabac", "core", "hevc_cabac"; > >>> + assigned-clocks = <&cru ACLK_RKVDEC1>, <&cru CLK_RKVDEC1_CORE>, > >>> + <&cru CLK_RKVDEC1_CA>, <&cru CLK_RKVDEC1_HEVC_CA>; > >>> + assigned-clock-rates = <800000000>, <600000000>, > >>> + <600000000>, <1000000000>; > >>> + resets = <&cru SRST_A_RKVDEC1>, <&cru SRST_H_RKVDEC1>, <&cru > >>> SRST_RKVDEC1_CA>, + <&cru SRST_RKVDEC1_CORE>, <&cru > >>> SRST_RKVDEC1_HEVC_CA>; > >>> + reset-names = "rst_axi", "rst_ahb", "rst_cabac", > >>> + "rst_core", "rst_hevc_cabac"; > >>> + power-domains = <&power RK3588_PD_RKVDEC1>; > >>> + sram = <&vdec1_sram>; > >>> + status = "okay"; > >>> + }; > >> > >> This is still missing the iommus, please add the iommus, they should be > >> > >> supported/same as the one used for e.g. VOP2: > >> compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu"; > >> > >> The VOP2 MMUs does have one extra mmu_cfg_mode flag in AUTO_GATING, > >> compared to the VDPU381 MMUs, however only the AV1D MMU should be > >> special on RK3588. > >> > >> Please add the iommus :-) > > > > When looking add the vendor DT/iommu driver I'm seeing serval quirks > > applied for vdec's iommus. Since it's rightly frowned upon adding such > > boolean-quirk-properties to upstream devicetrees, we'd at least need > > additional (fallback-) compatibles, even if it works with the iommu driver > > as is (what I doubt, but haven't tested). We need to be able to apply > > those > > quirks later without changing the devicetree (as usual) and I'm sure RK > > devs haven't added these quirks for the personal amusement. > > Based on what I investigated the hw should work similar, and the quirks > mostly seem related to optimizations and sw quirks, like do not zap each > line, keep it alive even when pm runtime say it is not in use and other > quirks that seem to be more of sw nature on how to best utilize the hw. I did some testing with the IOMMU but unfortunately, I'm only getting page fault errors. This may be something I'm doing wrong, but it clearly needs more investigation. > > If Detlev says > > iommu is out of scope for this series (which is valid), I'd say it's fine > > to leave them out for now (as no binding exists) and the HW works > > (obviously) fine without them. > > Sure, use of MMU can be added later. I'd rather go for that for now. I'll add that IMMU support is missing in the TODO file. > Regards, > Jonas > > >> Regards, > >> Jonas > >> > >>> }; > >>> > >>> #include "rk3588s-pinctrl.dtsi" --nextPart6055362.lOV4Wx5bFT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEonF9IvGrXNkDg+CX5EFKUk4x7bYFAmZ0Ly8ACgkQ5EFKUk4x 7baECAgAjk5js2JpB7x6DfY5moW2stChHufZtF9r0C0I5LGQ79O2WMm00iKy9+Fc BTaXnm+kcaVHAlnWEySwoY6Rtt+Mcqvcn868s97s0NsgOuI79haxGPDAviqTmN+Y dzxMxeskaNTBwutUHnbmRe6Te0e2LdqOSciANdXlPwnukKPB26fDJYNMc26wrZ+n Mk/nkU6GGqrNl9xATPy6CnR8+gzCcqsnQRqHXGuhX1aKhzEa7PX2OFIcAoti+5qM HoFR5ptStD7+Ea2+xeM/JRuZegTAEzf9J3DstBkSYP/YCfuLMvGb4Miii/d89wn+ 3E6az4GaUoiEwBv/cr0uTnWhC0v0fQ== =znvp -----END PGP SIGNATURE----- --nextPart6055362.lOV4Wx5bFT--