Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1735826lqs; Sun, 16 Jun 2024 02:18:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVhrPIPiRniFSVYS/IrGhPz2zE9+cLQHL8zheFxXLd4fz7W8bc+ncPdxnFOWfrYxPsT8vZfpAqH/3tS9inm1un+euJJkg3MfPWqaoafYQ== X-Google-Smtp-Source: AGHT+IFKG79KnqtOQTux1hhW+oep+87vMTV+3r/pawofDOx4xs4pKxsgFIf97BoNj8CYY0q/OEki X-Received: by 2002:a50:cd01:0:b0:57c:6832:7b2e with SMTP id 4fb4d7f45d1cf-57cbd4d96admr5366199a12.0.1718529517305; Sun, 16 Jun 2024 02:18:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718529517; cv=pass; d=google.com; s=arc-20160816; b=vjQjvKhgOzmBSGH2nQl5rv2JrNwXKu+pUq6tBq5PFlurGYJmmBqX/KiXumkUrT4U3R l5qGfFz1Kx+442Afa67+IkabtcQf9QIe33mt2z6Qz2OnGri84IyQtWrVOLfDsUVIkyNJ SS1SihCjqAn4fNCHhGFij45eZPD0uparijfHUCbJwIrmN0W2mwR7lctCAIz+nvbmKeIs DYoFoYDIlrHKqvs4UBngUPYanlyyAD25QqiskVbgxXNEgjKNLU5ltT4PIZvzfflITOH7 7AaXelVGiyVhtZZrtGJxbZSSme6i7f4HhY92nwCmgmdnW3IOjAyBcEf47PQVv81BnNv3 PoUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=quuud/7bt9D8sRiX3GKp+NZMy2JyHR57uIHev3qjeFs=; fh=TCNZ/GcxMWzrOnyCmANFVmx4sQPcMNb9FXNr8UdcVQ4=; b=uWnZHPynwYR8Q0Uz5uqqgdjC9k3pCS4Ctw2t/9vKWqICetXigTb/03AG0ldAOtTums hD0r3zHecqLwacMJq3KtBdC+CKc1x+uyad+LTSMt4qDn8mOyQwuECtN/NavJCZlFos8n ArAaXBLmjj9LT95whz41QRqyc9QGAWxeZpshch3+v+7sbDWgnEggJOxLZjY5oEHqdL0L OIr//94XgCOVFixI7xG0lhzlV+3AN+nVih5xfvYsFbG4TrIeBKzn6WZQOzDfmlW14ZQE 2KSGdonm4ERWuL0exp5Z2lQFnBNeBKV7HtqsEmY88bba2HEqb5oEa2hzzJBUgZMqmhri cJ3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kwiboo.se header.s=fe-e1b5cab7be header.b=Ltf3uKcD; arc=pass (i=1 spf=pass spfdomain=fe-bounces.kwiboo.se dkim=pass dkdomain=kwiboo.se dmarc=pass fromdomain=kwiboo.se); spf=pass (google.com: domain of linux-kernel+bounces-216214-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216214-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kwiboo.se Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cb745aa86si3565559a12.488.2024.06.16.02.18.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jun 2024 02:18:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-216214-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kwiboo.se header.s=fe-e1b5cab7be header.b=Ltf3uKcD; arc=pass (i=1 spf=pass spfdomain=fe-bounces.kwiboo.se dkim=pass dkdomain=kwiboo.se dmarc=pass fromdomain=kwiboo.se); spf=pass (google.com: domain of linux-kernel+bounces-216214-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216214-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kwiboo.se 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 am.mirrors.kernel.org (Postfix) with ESMTPS id D44281F21395 for ; Sun, 16 Jun 2024 09:18:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB55D181D1F; Sun, 16 Jun 2024 09:18:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="Ltf3uKcD" Received: from smtp.forwardemail.net (smtp.forwardemail.net [167.172.40.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A7054D8CC for ; Sun, 16 Jun 2024 09:18:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=167.172.40.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718529506; cv=none; b=JF64m1XvUoanjJUDLH4GCGHg9c0A57jOvsGhKGv0XlQLqwQSvzszc2uzDV+SRIxGj7/tAmBBOacOQM/FsHOtTLcv0+BTFNyqluWPKp3FEK7DzPJ/op+borwsKrUtUu4bGgDEChA7pX3CsDIrtVA49x0uoWQbc/G5/MdyGZ2+svg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718529506; c=relaxed/simple; bh=ag+2nKDejAdKP/tTF6EOOl6aEisffVKXG/FrSiyZcn0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=J+XblQlwd1MhA/TFu9EOk00mJ94e2uWSEaDnxFci/E9+s3hFAAxtzrEEih0ejyRvbBcn2/+Q22tuuX6PiiXXfHCASIfJSRmcHnn2x0L7kIHzs27FloUKZXvqi3Q09D6XO0e81wpIhSa0cZiB13nUXg5dA0drR4Ect+a7xhceYNA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=Ltf3uKcD; arc=none smtp.client-ip=167.172.40.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: From: References: Cc: To: Subject: MIME-Version: Date: Message-ID; q=dns/txt; s=fe-e1b5cab7be; t=1718529464; bh=quuud/7bt9D8sRiX3GKp+NZMy2JyHR57uIHev3qjeFs=; b=Ltf3uKcDhpLdLINdUS93ApD3HN3oob/51s/ZiX/u/dVjy5WTI9cCiwS8+OFbKZkopaRX/IBXJ 1lq3I1Z3kt4aLFg4NwUXDDLdNVhw8TXtYNtAQiTSElKV5uv565YcJoHEuf4RuSH53VbK5n0Vkov nD6vJXQW7KdJ6BhHDtCf2+DCjyN/x9yUH/2Xkr1RiXB6g81hs+4aOGVLjjdgSSBFDirxgCQzH1r ULoE1g8DQUFbLmGmttQbtsxsoVsEB/eCT4+HotfxIk4eTfG2qgASjEynF+Xeg9V0zuLVKa8TeOW jgiuzmCDClcKLm+QCVxNq39N/2ZWmBhOG5F5iNOsXCJw== Message-ID: Date: Sun, 16 Jun 2024 11:17:31 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] arm64: dts: rockchip: Add rkvdec2 Video Decoder on rk3588(s) To: Detlev Casanova Cc: linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , "Greg Kroah-Hartman" , Sebastian Reichel , Dragan Simic , Alexey Charkov , Cristian Ciocaltea , Diederik de Haas , Andy Yan , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev References: <20240615015734.1612108-1-detlev.casanova@collabora.com> <20240615015734.1612108-4-detlev.casanova@collabora.com> <944c4296-8dd2-4ffd-b430-1839ff3a3ed2@kwiboo.se> <3666279.iZASKD2KPV@arisu> Content-Language: en-US From: Jonas Karlman In-Reply-To: <3666279.iZASKD2KPV@arisu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 666eadb2b23880544d1fe7f5 Hi Detlev, On 2024-06-15 21:55, Detlev Casanova wrote: > On Saturday, June 15, 2024 4:25:27 A.M. EDT Jonas Karlman wrote: >> Hi Detlev, >> >> On 2024-06-15 03:56, Detlev Casanova wrote: >>> Add the rkvdec2 Video Decoder to the RK3588s devicetree. >>> >>> Signed-off-by: Detlev Casanova >>> --- >>> >>> .../boot/dts/rockchip/rk3588-rock-5b.dts | 4 ++++ >>> .../boot/dts/rockchip/rk3588s-orangepi-5.dts | 4 ++++ >>> arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 19 +++++++++++++++++++ >>> 3 files changed, 27 insertions(+) >>> >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts >>> b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts index >>> c551b676860c..965322c24a65 100644 >>> --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts >>> +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts >>> @@ -503,6 +503,10 @@ &pwm1 { >>> >>> status = "okay"; >>> >>> }; >>> >>> +&rkvdec0 { >>> + status = "okay"; >>> +}; >> >> Enable of rkvdec0 should probably be split out from the patch that adds >> the rkvdec0 node to soc dtsi. > > Ack > >> Also why is rkvdec0 only enabled on rock-5b and orangepi-5? > > I only could test on those two but I can enable it on all rk3588 devices. Because the decoder is an integrated part of the SoC the default should probably be that the IP is enabled, i.e. no status prop required for the vdec and related mmu nodes in rk3588s.dtsi. > >>> + >>> >>> &saradc { >>> >>> vref-supply = <&avcc_1v8_s0>; >>> status = "okay"; >>> >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts >>> b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts index >>> feea6b20a6bf..2828fb4c182a 100644 >>> --- a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts >>> +++ b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts >>> @@ -321,6 +321,10 @@ typec5v_pwren: typec5v-pwren { >>> >>> }; >>> >>> }; >>> >>> +&rkvdec0 { >>> + status = "okay"; >>> +}; >>> + >>> >>> &saradc { >>> >>> vref-supply = <&avcc_1v8_s0>; >>> status = "okay"; >>> >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi >>> b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index >>> 0fecbf46e127..09672636dcea 100644 >>> --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi >>> +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi >>> @@ -3034,6 +3034,9 @@ system_sram2: sram@ff001000 { >>> >>> ranges = <0x0 0x0 0xff001000 0xef000>; >>> #address-cells = <1>; >>> #size-cells = <1>; >> >> Blank line is missing. >> >>> + rkvdec0_sram: rkvdec-sram@0 { >>> + reg = <0x0 0x78000>; >>> + }; >>> >>> }; >>> >>> pinctrl: pinctrl { >>> >>> @@ -3103,6 +3106,22 @@ gpio4: gpio@fec50000 { >>> >>> #interrupt-cells = <2>; >>> >>> }; >>> >>> }; >>> >>> + >>> + rkvdec0: video-decoder@fdc38100 { To match prior generations the symbol should probably be called vdec0. >>> + compatible = "rockchip,rk3588-vdec2"; >>> + reg = <0x0 0xfdc38100 0x0 0x500>; >>> + interrupts = ; >>> + clocks = <&cru ACLK_RKVDEC0>, <&cru HCLK_RKVDEC0>, > <&cru >>> CLK_RKVDEC0_CORE>, + <&cru > CLK_RKVDEC0_CA>, <&cru >>> CLK_RKVDEC0_HEVC_CA>; >>> + clock-names = "axi", "ahb", "core", >>> + "cabac", "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>; >>> + power-domains = <&power RK3588_PD_RKVDEC0>; >> >> iommus and resets should probably be added. >> >>> + status = "disabled"; >>> + }; >> >> The iommu node for rkvdec0_mmu seem to be missing, is it not required to >> be able to use memory >4GiB as decoding buffers? > > I need to check if the current rockchip iommu driver will work for this > decoder. I remember that the iommu code for AV1 was a bit different, not sure > about this rkvdec. The device tree should describe the HW not what drivers are capable of. If there are substantial differences in iommu IP a new compatible should probably be added for that iommu. > >> I would also consider adding the rkvdec1 node(s), if I am understanding >> correctly they can both be used in a cluster or completely independent. > > They can be used independently, yes. I'll add rkvdec1 for rk3588 devices > (rk3588s only has 1 core) I do not think that is true, the rk3588s variant should also include two decoder and two encoder cores. However, the rk3582/rk3583 variants (rk3588s with one or more bad cores) may have 0-2 cores working for the decoder and/or encoder. E.g on my rk3582 boards I have following different ip-state in otp: - 1 bad cpu core (ip-state: 10 00 00) - 1 bad decoder core (ip-state: 00 80 00) - 1 bad encoder core (ip-state: 00 00 04) The general idea is that bootloader will disable or delete the offending nodes in the device tree to correctly describe the HW for the OS. Regards, Jonas > > Regards, > Detlev. > >> Also on RK3582/RK3583 one (or both) of the decoder cores may be marked >> as bad, yet the remaining one can still be used independently. The idea >> will be that bootloader fixup the DT and disabled/delete-node the bad >> core(s). >> >> Regards, >> Jonas >> >>> }; >>> >>> #include "rk3588s-pinctrl.dtsi" >