From nobody Fri Sep 25 07:22:45 2026 Received: from mail-wm2-f12.google.com (mail-wm2-f12.google.com [74.125.225.140]) (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 8253C4A6890 for ; Tue, 15 Sep 2026 12:28:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789475286; cv=none; b=TWeG+giOyH8whaPDx7RmhsBc6yw157Rsny92K3vjjqv89Yz17gaZy6BDWEtPhI177c9M5zlk3pEUei5BCv6KZl4Jz4HjSh2nD+PtP1qI2WU0zH6gkgZNwB1yIIuAi3hE9E/48iHITyOyECksuUA7wE/28iwLlzoU5NHdNHBKhU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789475286; c=relaxed/simple; bh=z7S+WapOAADt+toUCtbJgKgHGdB3VijwYG1m9opy0vY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jfrqQC7oYj72lHQeosySj6oNyIJjuKtzZtiYBHUaTYyFXC5U2f7wLBEfCS5P+kDzPwLYDCk+d1HkW8PtZggthYKRyqeURI6GaDfN1F1sqYclo1Mx358Z/M7TZSBhbRXUc1A0GZJ8/hGel56ZmIRBG7Nzqz6krR+DPevcscKLM3c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VyTRCyy1; arc=none smtp.client-ip=74.125.225.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VyTRCyy1" Received: by mail-wm2-f12.google.com with SMTP id 5b1f17b1804b1-49cc9f581c4so10885685e9.0 for ; Tue, 15 Sep 2026 05:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789475283; x=1790080083; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=2Hwo4di6s/GiSU94MPQNBdddN+KWlZv54gVo+DuGg1w=; b=VyTRCyy1Qd2b42NXd/vpNKAgVLXeDcK2RmeBuj4AnHcUtdDFME9K9Y1ws0qHTLykEn UuYG9GHIlwkIfPAR02EAB4XNqPs8bNSj2VKh+0HBnDZrq0AWicS4pg7+I4JGRCzQSj/m sKclQcLN26f7/CbzL2YoncmeiCUy795cjnzFKaT5vqC8owJ8fYeOSuHndAlFUbZEqqKe 3uwAvBkTjs5XoeTOCKmYkv6SUfAhv0EitZ6yveCb5fG1ZcgyKcEaLRHvYBgOtNC15JQZ RmqA4N6KMal1pgYCFNPnMzy6+m5jWNWI21AbHDbGjM+T+i+JvsSbzGQmIDvfqy5xAQqZ T1rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789475283; x=1790080083; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2Hwo4di6s/GiSU94MPQNBdddN+KWlZv54gVo+DuGg1w=; b=NS03hTTwVCCHyaFc8yzUDrQJ/l4TUSbH8zuhVrsphT288GuAspt6DY3JmxqeiwC5Fc 9vUSG03PeR1Z6f6Rov3tS7Yi1T17HD59Qz34NucBfcX3VkbHHzQvf6PX81NX3gSROnuO nBDdNN4Nz9iUHIMprNfdhSrF5YEgN8n0Sm21Q97Mx3yfThehVtxiiho986lWH9/l4QrO f4omTZP+GHgAYPfanFH7AdY5g5ybUmbOT3f6Ca3lR4l5Lf/YMnaND6UMDqBteXz6oYSw 55OVPaePLwjprgOiR1qmjXod+PeHFqPJoOJPm78s6XHK27+q7Us5T6vimvxwXP8ZsfnS mO+w== X-Forwarded-Encrypted: i=1; AKwUvBxpLgOaxFtzs06M2O4IctIK+wKYSr5dg+Hz9Fbf2rm+r45GR8xGPXcUYmz39e+MPtHrjqLYyCe57YG3Cn0=@vger.kernel.org X-Gm-Message-State: AFuF++l9AZnNY4enAoCpot7B3gRI2eTiGOL5fZelA3H9NxVskBuLJvFW HBHrCd81WS1SQOXpkRvmX2wCodMNXOl0qg3xJDw+DHOaAzBbDD+5Ev4G X-Gm-Gg: AYBFou18ys93wwvoXSBNlk2n+4kc17jdhfXjIPXiWiJCEz6CRSmBWEnH4jEr5A46RZ2 gpqu1eLVYxJg0PntfDspVom0GxRjPue8POPZFQb0xsYAtqW5+5st1YC0gqVl/iL/L5IdDrA/EBA LMFS+1JWVswlIRkN89G6cfrqH/LGuiuYR3HipkfvRKDY77AJhZI9AGmdHrCpiGy3PDjIWkYYCMP g/pf1EShYgY+sghEBco8QLLPc+Q6WaNEuBe/lQWN1rD1lnG0l3uka96hhWpznmQJXubOijYFtqV 3CWnMnZPvMzNmxBrLi9lRXf2xxzH6aNRvhCqJ5zx/i2kjJ7GlvTE314yvaqd2ywEBy5HVrgOr9R dizxbsqofZG8f1N6nY//ebbS22p6wk1+2p4y/DkZJvII7a1ob/wOL67ckUDD7R0wnKesRxqT2Jf WG/UIPqzUrfs7H7gi8GcKGckXTQKcOP4CuUzsErqzjFJvgCoQkV/wOLSn1BWy/tx1frOXkosmCY ODjyQXOShR0akDbnrHg448TKMxo+1skYuUWjVgKYVoBOYHYfvTfSJ8XZTtOvnhEYOGH X-Received: by 2002:a7b:c044:0:b0:49d:257c:a735 with SMTP id 5b1f17b1804b1-49e7d749462mr31690275e9.11.1789475282404; Tue, 15 Sep 2026 05:28:02 -0700 (PDT) Received: from [127.0.1.1] (2a01cb0007c59900d73f8285c1e647ab.ipv6.abo.wanadoo.fr. [2a01:cb00:7c5:9900:d73f:8285:c1e6:47ab]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e7d6bf4desm83105075e9.15.2026.09.15.05.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 05:28:02 -0700 (PDT) From: Amin Gattout Date: Tue, 15 Sep 2026 14:27:56 +0200 Subject: [PATCH 1/3] media: dt-bindings: add rockchip rk3576 vicap Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260915-vicap-rk3576-v1-1-d3f5eb58a0b5@gmail.com> References: <20260915-vicap-rk3576-v1-0-d3f5eb58a0b5@gmail.com> In-Reply-To: <20260915-vicap-rk3576-v1-0-d3f5eb58a0b5@gmail.com> To: Mehdi Djait , Michael Riesch , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Amin Gattout X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789475280; l=3072; i=amin.gattout@gmail.com; s=20260818; h=from:subject:message-id; bh=z7S+WapOAADt+toUCtbJgKgHGdB3VijwYG1m9opy0vY=; b=IC84XA3mCQXaWFg/4AsAwioBWvYzZmyHQmZ2hIwH3YricEhEp8sgB2ssCuVdWRiOgs4wN+2/4 btCDa2mED+HCDnyf4iis3VYb97FCMIHQsX7Y4yo3U7fbH3x3owlCjf9 X-Developer-Key: i=amin.gattout@gmail.com; a=ed25519; pk=MSIqDPkCOkwtyP8Fns1m+KFU9SgqoDl2mpLe18vL+hQ= Add the compatible for the Video Capture (VICAP) unit of the Rockchip RK3576. This variant features five MIPI CSI-2 ports and a connection to the image signal processor (ISP). The pixel clock of each MIPI port enters the VICAP through a dedicated gate in the clock and reset unit, so the variant takes five interface clocks and five interface resets in addition to the aclk, hclk and dclk of the other variants. Signed-off-by: Amin Gattout Acked-by: Conor Dooley Reviewed-by: Michael Riesch --- .../bindings/media/rockchip,rk3568-vicap.yaml | 46 ++++++++++++++++++= +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/rockchip,rk3568-vicap.= yaml b/Documentation/devicetree/bindings/media/rockchip,rk3568-vicap.yaml index 080b64503b1b..b7dfaf3b378d 100644 --- a/Documentation/devicetree/bindings/media/rockchip,rk3568-vicap.yaml +++ b/Documentation/devicetree/bindings/media/rockchip,rk3568-vicap.yaml @@ -15,6 +15,10 @@ description: the data from camera sensors, video decoders, or other companion ICs and transfers it into system main memory by AXI bus. =20 + The Rockchip RK3576 Video Capture (VICAP) is similar to its RK3568 + counterpart, but features five MIPI CSI-2 ports and an additional + connection to the image signal processor (ISP) block. + The Rockchip RK3588 Video Capture (VICAP) is similar to its RK3568 counterpart, but features six MIPI CSI-2 ports and additional connections to the image signal processor (ISP) blocks. @@ -23,6 +27,7 @@ properties: compatible: enum: - rockchip,rk3568-vicap + - rockchip,rk3576-vicap - rockchip,rk3588-vicap =20 reg: @@ -33,7 +38,7 @@ properties: =20 clocks: minItems: 4 - maxItems: 5 + maxItems: 8 =20 clock-names: items: @@ -42,6 +47,9 @@ properties: - const: dclk - const: iclk - const: iclk1 + - const: iclk2 + - const: iclk3 + - const: iclk4 minItems: 4 =20 iommus: @@ -221,6 +229,40 @@ allOf: =20 port@11: false =20 + - if: + properties: + compatible: + contains: + const: rockchip,rk3576-vicap + then: + properties: + clocks: + minItems: 8 + + clock-names: + minItems: 8 + + resets: + minItems: 8 + maxItems: 8 + + reset-names: + items: + - const: arst + - const: hrst + - const: drst + - const: irst0 + - const: irst1 + - const: irst2 + - const: irst3 + - const: irst4 + + ports: + properties: + port@6: false + + port@11: false + - if: properties: compatible: @@ -230,9 +272,11 @@ allOf: properties: clocks: minItems: 5 + maxItems: 5 =20 clock-names: minItems: 5 + maxItems: 5 =20 resets: minItems: 9 --=20 2.43.0 From nobody Fri Sep 25 07:22:45 2026 Received: from mail-wm2-f13.google.com (mail-wm2-f13.google.com [74.125.225.141]) (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 4AE954A6CDA for ; Tue, 15 Sep 2026 12:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789475288; cv=none; b=g9KDGc7ozXrM6mEOC3mCWCw8h4CDk7j4lwM5gWNQb3InfXBa2Ni2xLwVxt5FNJLOp+aeaK6idgrbzUs9TORYUs8Z9Nxa4S1Ldu2Ur0f3qjYfIOgfF92rnO8KthNm+eKZeCMuP5gmuSIyIu8NdzCDGDAUERK+bAXFbGGLvB19h0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789475288; c=relaxed/simple; bh=vlomE9OJQnIk/T7WypNFrIF6CUk6qxEOxtOkhtxxUag=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MNZ0uaOOAMnvDzsFWvGq+bwEiO+KI7jAiCI/qMKe/JFXurEczKm/7phP1n+t2MCeN8XQpdGviqeGomC6DAAGQz5SJfn0vGACmTEXNrEP06cQcJUFaHYhlOawgUPqO94dF5/L6WkoWhHXM45oMKc/UejXnME5+kKMpDfEaOeDfik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lEEjsgFn; arc=none smtp.client-ip=74.125.225.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lEEjsgFn" Received: by mail-wm2-f13.google.com with SMTP id 5b1f17b1804b1-49e8185e037so2317095e9.3 for ; Tue, 15 Sep 2026 05:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789475284; x=1790080084; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=EETaPt3U6RKbdBRbu2Bk9Q3etPj4cAHdjlyPKaUnyAI=; b=lEEjsgFnwo4xKtnmxZqphydRVSs6Gkl4heUbAtZDzDr/Ql4jvgovZy0+y5N3+UMdad +T1hisiJly960Dy2AsjeZCyw3kQKviNC4bl55ZjvS7sgT3ePQfoKqQTdc900LoLpRN7/ 9CcuLudBwjeZmgZXVm5og6wdEwy/NjZk7Rjd8CrIykUmlZWDYIoix4cSJTZywOSZbC8b ZNpTQ5+RJMw2InEGyXXMJEe80mXhzQnvq7FWhUegurOZ+0xNd7MJmRlk+9tqHKCqmcwY /xKSuQn0Ik+1ZbswZmjXXqAFSGg5v++Wo9bOvVcdNgv+25sbagGdKSJ3jxxPvxsghQoE ExtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789475284; x=1790080084; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=EETaPt3U6RKbdBRbu2Bk9Q3etPj4cAHdjlyPKaUnyAI=; b=JvC3BlXp+WXbeXHg/0x2b0yk4Ia4MsSSH1q3J3Mmown+iWmqwG+ILarjqKeUFod53Z aX9jAJWK2t8vrfjLFhNQ+IJ8igH/h7fRESKM80NavxOPMMdNQyVXid5vZuSQP+eGU6KL v3J00pLZjWI6hfyhe6RaPWqjB60O9Hv7ilxCv8adJwHdHZNUmcGUq3geyljWw+Jzmzz9 N7GO9iQCdGWyTg7ttPfn2fzHoFdg4imi7geuO6H+h2HD6gtupzgcOAaMkuO6BvAdy7YD 1bo58CqDnrJCttk6B5zPM8FkVvuWA1gazMyO4hU+tMB/ice6GTVUuCWvduIgYKArPpvA Qm1w== X-Forwarded-Encrypted: i=1; AKwUvBz4J9XX/JhRb9qzPWfZnvqSHrawzRhVSSQwfgToT6H8LQZISULsO20ltPN7a+TaFOHxp5KXCegA4SJaDiQ=@vger.kernel.org X-Gm-Message-State: AFuF++lgOxbnuvbIUvFskRJA54nEFjkOJKq8NJORk6eO0zjFvKnQMbAT OdF+MrwpwqytmVxzYxVdLM7ip/PdEkXBfpQwTTGNb3eD2NLApKn6Tl6A X-Gm-Gg: AYBFou0lU0+rNGIa9KUTvBm2FinRVUVhfsDRW9TaqWzDLYhP2f11HLr8Q2D2WwZ4icc 3+yeNRml8PFRJJdok7bb/8x3hfJ5QZJeBOLJQ37v3dCiKWX9JLkDdcFHHvHwZhgbeu1s6KAchj0 qphBukX/q4aC/zxbqpFqlwWbZqkjldi734PSSB0o07HQshhDtX92fDAuOdmDS1A/ezarNz3aa/X O1geEmHPs9YY5EuEHnm7Tw2juhkUe1hieIo1Rx8Z+xOV8s0g9ZAn74TEB1Y7K5BZavHDhwLL6EX GKimUJVNkCldPkQcsjLhDNDv0ksDZlcXw0tFA8M4D8rDxPYFrTdh25ftBofvT33E++WDhp4JlKh TRdMid+zXKU3b+irDzpnJFNqctcwoGram+IeFvg7JqYVqvF832ehlVbg9MZIJ4q0nSarygaBEi0 z2OnQuFKtaEbdfcllDPmJYv04PAIN/Gv6hcV9CL2/byHB2J9HpcsksQrNHGh3/ZA9/m3PofSjTJ uXP/H+arcET9gnNj9vGOCqGM8dAmqqfc4Qe0wKR0Mvt0X2Il8yzV9GFsHtYR9aWaaPJ66RAjyvH vg== X-Received: by 2002:a05:600c:a47:b0:49d:16f1:94a5 with SMTP id 5b1f17b1804b1-49e7a677980mr83684085e9.25.1789475284061; Tue, 15 Sep 2026 05:28:04 -0700 (PDT) Received: from [127.0.1.1] (2a01cb0007c59900d73f8285c1e647ab.ipv6.abo.wanadoo.fr. [2a01:cb00:7c5:9900:d73f:8285:c1e6:47ab]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e7d6bf4desm83105075e9.15.2026.09.15.05.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 05:28:03 -0700 (PDT) From: Amin Gattout Date: Tue, 15 Sep 2026 14:27:57 +0200 Subject: [PATCH 2/3] media: rockchip: rkcif: add support for rk3576 vicap mipi capture Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260915-vicap-rk3576-v1-2-d3f5eb58a0b5@gmail.com> References: <20260915-vicap-rk3576-v1-0-d3f5eb58a0b5@gmail.com> In-Reply-To: <20260915-vicap-rk3576-v1-0-d3f5eb58a0b5@gmail.com> To: Mehdi Djait , Michael Riesch , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Amin Gattout X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789475280; l=13360; i=amin.gattout@gmail.com; s=20260818; h=from:subject:message-id; bh=vlomE9OJQnIk/T7WypNFrIF6CUk6qxEOxtOkhtxxUag=; b=S/OBz99BiiFCNvN3554t3gj79ME9sn4KLLn574TqWC7egGry9vAxiE1fl3jJdgeSb9F1q2Ckb IPDqS/uKpNQCZFJXedOlyvZH3CFVMj7yLDVLYsT1YPmGfX49xq/W4xj X-Developer-Key: i=amin.gattout@gmail.com; a=ed25519; pk=MSIqDPkCOkwtyP8Fns1m+KFU9SgqoDl2mpLe18vL+hQ= The RK3576 Video Capture (VICAP) unit features a Digital Video Port (DVP) and five MIPI CSI-2 capture interfaces. Compared to the RK3588 variant, the MIPI register blocks are laid out differently (there is no block at offset 0x200), the ID_CTRL0 bit layout has changed, and the VC/DT filter has moved from ID_CTRL0 to ID_CTRL1. The capture size, which the other variants configure in ID_CTRL1, lives in the new ID_SET_SIZE register. Introduce a mipi_ctrl1 callback and a SET_SIZE register index so that each variant can declare what ID_CTRL1 holds and where the capture size is configured. The RK3568 and RK3588 variants keep their previous behavior. On the RK3576 the pixel clock of each MIPI port enters the VICAP through a dedicated CRU gate (CLK_VICAP_I0CLK to CLK_VICAP_I4CLK), so the variant claims these five clocks in addition to aclk, hclk and dclk. Signed-off-by: Amin Gattout --- .../platform/rockchip/rkcif/rkcif-capture-mipi.c | 155 +++++++++++++++++= +++- .../platform/rockchip/rkcif/rkcif-capture-mipi.h | 1 + .../media/platform/rockchip/rkcif/rkcif-common.h | 4 +- drivers/media/platform/rockchip/rkcif/rkcif-dev.c | 21 +++ drivers/media/platform/rockchip/rkcif/rkcif-regs.h | 1 + 5 files changed, 180 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c b/d= rivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c index bc9518f8db50..53e62d059764 100644 --- a/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c +++ b/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c @@ -30,6 +30,14 @@ #define RK3568_MIPI_CTRL0_CROP_EN BIT(5) #define RK3568_MIPI_CTRL0_WRDDR(type) ((type) << 1) =20 +#define RK3576_MIPI_CTRL0_HIGH_ALIGN BIT(11) +#define RK3576_MIPI_CTRL0_WRDDR(type) ((type) << 8) +#define RK3576_MIPI_CTRL0_PARSE(type) ((type) << 4) +#define RK3576_MIPI_CTRL0_DMA_EN BIT(3) +#define RK3576_MIPI_CTRL0_CROP_EN BIT(1) + +#define RK3576_MIPI_CTRL1_DT(dt) ((dt) << 2) + #define RK3588_MIPI_CTRL0_DMA_EN BIT(28) #define RK3588_MIPI_CTRL0_HIGH_ALIGN BIT(27) #define RK3588_MIPI_CTRL0_WRDDR(type) ((type) << 5) @@ -438,6 +446,7 @@ const struct rkcif_mipi_match_data rkcif_rk3568_vicap_m= ipi_match_data =3D { [RKCIF_MIPI_FRAME1_VLW_Y] =3D 0x38, [RKCIF_MIPI_FRAME1_VLW_UV] =3D 0x40, [RKCIF_MIPI_CROP_START] =3D 0xbc, + [RKCIF_MIPI_SET_SIZE] =3D RKCIF_REGISTER_NOTSUPPORTED, }, [RKCIF_ID1] =3D { [RKCIF_MIPI_CTRL0] =3D 0x08, @@ -451,6 +460,7 @@ const struct rkcif_mipi_match_data rkcif_rk3568_vicap_m= ipi_match_data =3D { [RKCIF_MIPI_FRAME1_VLW_Y] =3D 0x58, [RKCIF_MIPI_FRAME1_VLW_UV] =3D 0x60, [RKCIF_MIPI_CROP_START] =3D 0xc0, + [RKCIF_MIPI_SET_SIZE] =3D RKCIF_REGISTER_NOTSUPPORTED, }, [RKCIF_ID2] =3D { [RKCIF_MIPI_CTRL0] =3D 0x10, @@ -464,6 +474,7 @@ const struct rkcif_mipi_match_data rkcif_rk3568_vicap_m= ipi_match_data =3D { [RKCIF_MIPI_FRAME1_VLW_Y] =3D 0x78, [RKCIF_MIPI_FRAME1_VLW_UV] =3D 0x80, [RKCIF_MIPI_CROP_START] =3D 0xc4, + [RKCIF_MIPI_SET_SIZE] =3D RKCIF_REGISTER_NOTSUPPORTED, }, [RKCIF_ID3] =3D { [RKCIF_MIPI_CTRL0] =3D 0x18, @@ -477,6 +488,7 @@ const struct rkcif_mipi_match_data rkcif_rk3568_vicap_m= ipi_match_data =3D { [RKCIF_MIPI_FRAME1_VLW_Y] =3D 0x98, [RKCIF_MIPI_FRAME1_VLW_UV] =3D 0xa0, [RKCIF_MIPI_CROP_START] =3D 0xc8, + [RKCIF_MIPI_SET_SIZE] =3D RKCIF_REGISTER_NOTSUPPORTED, }, }, .blocks =3D { @@ -486,6 +498,138 @@ const struct rkcif_mipi_match_data rkcif_rk3568_vicap= _mipi_match_data =3D { }, }; =20 +static u32 +rkcif_rk3576_mipi_ctrl0(struct rkcif_stream *stream, + const struct rkcif_output_fmt *active_out_fmt) +{ + u32 ctrl0 =3D RKCIF_MIPI_CTRL0_CAP_EN | RK3576_MIPI_CTRL0_DMA_EN | + RK3576_MIPI_CTRL0_CROP_EN; + + switch (active_out_fmt->mipi.type) { + case RKCIF_MIPI_TYPE_RAW8: + break; + case RKCIF_MIPI_TYPE_RAW10: + ctrl0 |=3D RK3576_MIPI_CTRL0_PARSE(0x1); + if (!active_out_fmt->mipi.compact) + ctrl0 |=3D RK3576_MIPI_CTRL0_WRDDR(0x1); + break; + case RKCIF_MIPI_TYPE_RAW12: + ctrl0 |=3D RK3576_MIPI_CTRL0_PARSE(0x2); + if (!active_out_fmt->mipi.compact) + ctrl0 |=3D RK3576_MIPI_CTRL0_WRDDR(0x1); + break; + case RKCIF_MIPI_TYPE_RGB888: + ctrl0 |=3D RK3576_MIPI_CTRL0_PARSE(0x7); + break; + case RKCIF_MIPI_TYPE_YUV422SP: + ctrl0 |=3D RK3576_MIPI_CTRL0_WRDDR(0x4); + break; + case RKCIF_MIPI_TYPE_YUV420SP: + ctrl0 |=3D RK3576_MIPI_CTRL0_WRDDR(0x5); + break; + case RKCIF_MIPI_TYPE_YUV400: + ctrl0 |=3D RK3576_MIPI_CTRL0_WRDDR(0x3); + break; + default: + break; + } + + return ctrl0; +} + +static u32 +rkcif_rk3576_mipi_ctrl1(struct rkcif_stream *stream, + const struct rkcif_output_fmt *active_out_fmt) +{ + return RK3576_MIPI_CTRL1_DT(active_out_fmt->mipi.dt); +} + +const struct rkcif_mipi_match_data rkcif_rk3576_vicap_mipi_match_data =3D { + .mipi_num =3D 5, + .mipi_ctrl0 =3D rkcif_rk3576_mipi_ctrl0, + .mipi_ctrl1 =3D rkcif_rk3576_mipi_ctrl1, + .regs =3D { + [RKCIF_MIPI_CTRL] =3D 0x20, + [RKCIF_MIPI_INTEN] =3D 0x74, + [RKCIF_MIPI_INTSTAT] =3D 0x78, + }, + .regs_id =3D { + [RKCIF_ID0] =3D { + [RKCIF_MIPI_CTRL0] =3D 0x00, + [RKCIF_MIPI_CTRL1] =3D 0x04, + [RKCIF_MIPI_FRAME0_ADDR_Y] =3D 0x24, + [RKCIF_MIPI_FRAME0_ADDR_UV] =3D 0x2c, + [RKCIF_MIPI_FRAME0_VLW_Y] =3D 0x34, + [RKCIF_MIPI_FRAME0_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_FRAME1_ADDR_Y] =3D 0x28, + [RKCIF_MIPI_FRAME1_ADDR_UV] =3D 0x30, + [RKCIF_MIPI_FRAME1_VLW_Y] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_FRAME1_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_CROP_START] =3D 0x90, + [RKCIF_MIPI_SET_SIZE] =3D 0xa0, + }, + [RKCIF_ID1] =3D { + [RKCIF_MIPI_CTRL0] =3D 0x08, + [RKCIF_MIPI_CTRL1] =3D 0x0c, + [RKCIF_MIPI_FRAME0_ADDR_Y] =3D 0x38, + [RKCIF_MIPI_FRAME0_ADDR_UV] =3D 0x40, + [RKCIF_MIPI_FRAME0_VLW_Y] =3D 0x48, + [RKCIF_MIPI_FRAME0_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_FRAME1_ADDR_Y] =3D 0x3c, + [RKCIF_MIPI_FRAME1_ADDR_UV] =3D 0x44, + [RKCIF_MIPI_FRAME1_VLW_Y] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_FRAME1_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_CROP_START] =3D 0x94, + [RKCIF_MIPI_SET_SIZE] =3D 0xa4, + }, + [RKCIF_ID2] =3D { + [RKCIF_MIPI_CTRL0] =3D 0x10, + [RKCIF_MIPI_CTRL1] =3D 0x14, + [RKCIF_MIPI_FRAME0_ADDR_Y] =3D 0x4c, + [RKCIF_MIPI_FRAME0_ADDR_UV] =3D 0x54, + [RKCIF_MIPI_FRAME0_VLW_Y] =3D 0x5c, + [RKCIF_MIPI_FRAME0_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_FRAME1_ADDR_Y] =3D 0x50, + [RKCIF_MIPI_FRAME1_ADDR_UV] =3D 0x58, + [RKCIF_MIPI_FRAME1_VLW_Y] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_FRAME1_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_CROP_START] =3D 0x98, + [RKCIF_MIPI_SET_SIZE] =3D 0xa8, + }, + [RKCIF_ID3] =3D { + [RKCIF_MIPI_CTRL0] =3D 0x18, + [RKCIF_MIPI_CTRL1] =3D 0x1c, + [RKCIF_MIPI_FRAME0_ADDR_Y] =3D 0x60, + [RKCIF_MIPI_FRAME0_ADDR_UV] =3D 0x68, + [RKCIF_MIPI_FRAME0_VLW_Y] =3D 0x70, + [RKCIF_MIPI_FRAME0_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_FRAME1_ADDR_Y] =3D 0x64, + [RKCIF_MIPI_FRAME1_ADDR_UV] =3D 0x6c, + [RKCIF_MIPI_FRAME1_VLW_Y] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_FRAME1_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, + [RKCIF_MIPI_CROP_START] =3D 0x9c, + [RKCIF_MIPI_SET_SIZE] =3D 0xac, + }, + }, + .blocks =3D { + { + .offset =3D 0x100, + }, + { + .offset =3D 0x300, + }, + { + .offset =3D 0x400, + }, + { + .offset =3D 0x500, + }, + { + .offset =3D 0x600, + }, + }, +}; + static u32 rkcif_rk3588_mipi_ctrl0(struct rkcif_stream *stream, const struct rkcif_output_fmt *active_out_fmt) @@ -549,6 +693,7 @@ const struct rkcif_mipi_match_data rkcif_rk3588_vicap_m= ipi_match_data =3D { [RKCIF_MIPI_FRAME1_VLW_Y] =3D RKCIF_REGISTER_NOTSUPPORTED, [RKCIF_MIPI_FRAME1_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, [RKCIF_MIPI_CROP_START] =3D 0x8c, + [RKCIF_MIPI_SET_SIZE] =3D RKCIF_REGISTER_NOTSUPPORTED, }, [RKCIF_ID1] =3D { [RKCIF_MIPI_CTRL0] =3D 0x08, @@ -562,6 +707,7 @@ const struct rkcif_mipi_match_data rkcif_rk3588_vicap_m= ipi_match_data =3D { [RKCIF_MIPI_FRAME1_VLW_Y] =3D RKCIF_REGISTER_NOTSUPPORTED, [RKCIF_MIPI_FRAME1_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, [RKCIF_MIPI_CROP_START] =3D 0x90, + [RKCIF_MIPI_SET_SIZE] =3D RKCIF_REGISTER_NOTSUPPORTED, }, [RKCIF_ID2] =3D { [RKCIF_MIPI_CTRL0] =3D 0x10, @@ -575,6 +721,7 @@ const struct rkcif_mipi_match_data rkcif_rk3588_vicap_m= ipi_match_data =3D { [RKCIF_MIPI_FRAME1_VLW_Y] =3D RKCIF_REGISTER_NOTSUPPORTED, [RKCIF_MIPI_FRAME1_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, [RKCIF_MIPI_CROP_START] =3D 0x94, + [RKCIF_MIPI_SET_SIZE] =3D RKCIF_REGISTER_NOTSUPPORTED, }, [RKCIF_ID3] =3D { [RKCIF_MIPI_CTRL0] =3D 0x18, @@ -588,6 +735,7 @@ const struct rkcif_mipi_match_data rkcif_rk3588_vicap_m= ipi_match_data =3D { [RKCIF_MIPI_FRAME1_VLW_Y] =3D RKCIF_REGISTER_NOTSUPPORTED, [RKCIF_MIPI_FRAME1_VLW_UV] =3D RKCIF_REGISTER_NOTSUPPORTED, [RKCIF_MIPI_CROP_START] =3D 0x98, + [RKCIF_MIPI_SET_SIZE] =3D RKCIF_REGISTER_NOTSUPPORTED, }, }, .blocks =3D { @@ -741,7 +889,10 @@ static int rkcif_mipi_start_streaming(struct rkcif_str= eam *stream) if (match_data->mipi_ctrl0) ctrl0 =3D match_data->mipi_ctrl0(stream, active_out_fmt); =20 - ctrl1 =3D RKCIF_XY_COORD(width, height); + if (match_data->mipi_ctrl1) + ctrl1 =3D match_data->mipi_ctrl1(stream, active_out_fmt); + else + ctrl1 =3D RKCIF_XY_COORD(width, height); =20 int_mask |=3D RKCIF_MIPI_INT_FRAME0_END(stream->id); int_mask |=3D RKCIF_MIPI_INT_FRAME1_END(stream->id); @@ -759,6 +910,8 @@ static int rkcif_mipi_start_streaming(struct rkcif_stre= am *stream) rkcif_mipi_stream_write(stream, RKCIF_MIPI_FRAME0_VLW_UV, vlw); rkcif_mipi_stream_write(stream, RKCIF_MIPI_FRAME1_VLW_UV, vlw); rkcif_mipi_stream_write(stream, RKCIF_MIPI_CROP_START, 0x0); + rkcif_mipi_stream_write(stream, RKCIF_MIPI_SET_SIZE, + RKCIF_XY_COORD(width, height)); rkcif_mipi_stream_write(stream, RKCIF_MIPI_CTRL1, ctrl1); rkcif_mipi_stream_write(stream, RKCIF_MIPI_CTRL0, ctrl0); =20 diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.h b/d= rivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.h index 7edaca44f653..4e17cbc04b76 100644 --- a/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.h +++ b/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.h @@ -13,6 +13,7 @@ #include "rkcif-common.h" =20 extern const struct rkcif_mipi_match_data rkcif_rk3568_vicap_mipi_match_da= ta; +extern const struct rkcif_mipi_match_data rkcif_rk3576_vicap_mipi_match_da= ta; extern const struct rkcif_mipi_match_data rkcif_rk3588_vicap_mipi_match_da= ta; =20 int rkcif_mipi_register(struct rkcif_device *rkcif); diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-common.h b/drivers= /media/platform/rockchip/rkcif/rkcif-common.h index 4d9211ba9bda..08a213438d34 100644 --- a/drivers/media/platform/rockchip/rkcif/rkcif-common.h +++ b/drivers/media/platform/rockchip/rkcif/rkcif-common.h @@ -27,7 +27,7 @@ #include "rkcif-regs.h" =20 #define RKCIF_DRIVER_NAME "rockchip-cif" -#define RKCIF_CLK_MAX 5 +#define RKCIF_CLK_MAX 8 =20 enum rkcif_format_type { RKCIF_FMT_TYPE_INVALID, @@ -207,6 +207,8 @@ struct rkcif_mipi_match_data { unsigned int regs_id[RKCIF_ID_MAX][RKCIF_MIPI_ID_REGISTER_MAX]; u32 (*mipi_ctrl0)(struct rkcif_stream *stream, const struct rkcif_output_fmt *active_out_fmt); + u32 (*mipi_ctrl1)(struct rkcif_stream *stream, + const struct rkcif_output_fmt *active_out_fmt); struct { unsigned int offset; } blocks[RKCIF_MIPI_MAX - RKCIF_MIPI_BASE]; diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-dev.c b/drivers/me= dia/platform/rockchip/rkcif/rkcif-dev.c index be3a174b9aab..2a5758776b3e 100644 --- a/drivers/media/platform/rockchip/rkcif/rkcif-dev.c +++ b/drivers/media/platform/rockchip/rkcif/rkcif-dev.c @@ -53,6 +53,23 @@ static const struct rkcif_match_data rk3568_vicap_match_= data =3D { .mipi =3D &rkcif_rk3568_vicap_mipi_match_data, }; =20 +static const char *const rk3576_vicap_clks[] =3D { + "aclk", + "hclk", + "dclk", + "iclk", + "iclk1", + "iclk2", + "iclk3", + "iclk4", +}; + +static const struct rkcif_match_data rk3576_vicap_match_data =3D { + .clks =3D rk3576_vicap_clks, + .clks_num =3D ARRAY_SIZE(rk3576_vicap_clks), + .mipi =3D &rkcif_rk3576_vicap_mipi_match_data, +}; + static const char *const rk3588_vicap_clks[] =3D { "aclk", "hclk", @@ -76,6 +93,10 @@ static const struct of_device_id rkcif_plat_of_match[] = =3D { .compatible =3D "rockchip,rk3568-vicap", .data =3D &rk3568_vicap_match_data, }, + { + .compatible =3D "rockchip,rk3576-vicap", + .data =3D &rk3576_vicap_match_data, + }, { .compatible =3D "rockchip,rk3588-vicap", .data =3D &rk3588_vicap_match_data, diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-regs.h b/drivers/m= edia/platform/rockchip/rkcif/rkcif-regs.h index 3cf7ee19de30..0460e963b154 100644 --- a/drivers/media/platform/rockchip/rkcif/rkcif-regs.h +++ b/drivers/media/platform/rockchip/rkcif/rkcif-regs.h @@ -147,6 +147,7 @@ enum rkcif_mipi_id_register_index { RKCIF_MIPI_FRAME1_VLW_Y, RKCIF_MIPI_FRAME1_VLW_UV, RKCIF_MIPI_CROP_START, + RKCIF_MIPI_SET_SIZE, RKCIF_MIPI_ID_REGISTER_MAX }; =20 --=20 2.43.0 From nobody Fri Sep 25 07:22:45 2026 Received: from mail-wm2-f13.google.com (mail-wm2-f13.google.com [74.125.225.141]) (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 284074A99B2 for ; Tue, 15 Sep 2026 12:28:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789475289; cv=none; b=e+QPZcGgtARaZLbkiSK3pMgLaTX9SurFXKlplPWlFS8yPZKWy7nyj3+WJOubs0WGdcw0VlugP+ewYLV4eNGJ0TGh7z73SeyLa/WQbWW3w6emYwy5XI+SoLKupg8yYZEiuJZ02zD/Uh+BZ6gYPa7rO2aOuN+TkeW+dxBHKXlTGuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789475289; c=relaxed/simple; bh=ts6YghVyA/zyzel5doEzGL1L/0VfbhJhUqB26M/V22k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PPCZFA+PkKDuoDotNpcggjcoPEAf93vXC6dk9aH8c9Of8z1IVNEKmJdRfZofXn0MQg1G6GnHRFZ8A1Ndv2kCg3bfpEB1FNiZBrPf5tcfF8b+SuFt+0oK3AJFqLZtapFK/YfJcA4P4pX6ReT9m7X2Qgs0jxtovp8Uuy5SSqdzblQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=geaQb5T6; arc=none smtp.client-ip=74.125.225.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="geaQb5T6" Received: by mail-wm2-f13.google.com with SMTP id 5b1f17b1804b1-49e8185e037so2317155e9.3 for ; Tue, 15 Sep 2026 05:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789475285; x=1790080085; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=fGVlAiXSUMIP2F6e2acD3g4t6CrjKoFWSLsHsqDHE4o=; b=geaQb5T6dK1pxNal0kk5kbZPfJq6M9TPkFg24RvWdLVxJ/zDsO87/G5wga1nAZsn2o vOC3YoQEN1kKB742rnFBCIrsN0Iy2dO7gnFz4wbAha0U1MfjN7WYzNhCc4U9JWb4G/lH pkN+TJ4+OIcaOpLMj7sTCVFjIgw6HxqGdpbDTfIYDLQ2/9I982jpZVNlFjsPlGpQ1soy 9s7sdUbzosILfFEUGSy0rvFhcBwx3nwUrk/ewmkrE67UU4s1Z2+ycnPBwtNHgaSRjCta tJjKspS1CPRWWRkwJLc+kaWyDEPIng19qhTsnSy2bpIMHLefIliNA+FquJI9Ub8qFBqk voTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789475285; x=1790080085; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=fGVlAiXSUMIP2F6e2acD3g4t6CrjKoFWSLsHsqDHE4o=; b=miaBaLtWEdmmw9+qKVv6RGzLchYODRQTVhfqBbdIrsUzU7HgY61ybWZLBLR+G3bEYd wpA5VaJuO3aj/2r0hNfW3lJ/WhghFPywzLiRUmyhBUIjO9ucFeQHT4+lpHn0qHmT3L+w B9p5go0PiN1F3DuWjf6lwqHlBScIBme8XMDbqD1gTNMvwAVTagFLOCFHqt6MpgSU7U8j mwn2JUAit864rRFMvtU+LtkJm2GYA0HGcP2f3UVKUTEZXvIRP2DKHGQ41lM5nPgmRK1D +cqmvLqYyjEi6AF6l9OyaYgQZYB+/bHbSNWsrF+73Tzp3fs5c4NyZluWBt2bIar3YdS6 aFZg== X-Forwarded-Encrypted: i=1; AKwUvBxigAk0+aXmW8Sz/hvVAdkfBdkO+eL6qfhG2ru6Tff/aZRaXK+u881QwSVUTmoVi9dP/HfjrubmALGSXME=@vger.kernel.org X-Gm-Message-State: AFuF++lgTXUEoKFY17H2AxrBYdU4cLDF6JqAZbUJFjZJbE1p4mOTFy1b CX5qY8dVWo2Ui13ZPBpY1U5iycRE/KtTcK9Wcd2+eoPlHpdoNj13WIWR X-Gm-Gg: AYBFou11d+u54GTHqODWbxgY6YjcxZb8Vgsjh47ExjHNbLwm7s7KDH8AYj8yVive637 OrRSvvV33rSBfjayfQV3hNT/YoC+Y1sOAGoqtodwhj7djGP+iJmbWRES94U6ZlT/iLTEJXgzqSu MGR+gon2yfTYUtShH/QSJXvGga3wOwo68b8SlpDdx5qXuMD7ZKNACw7h3lzbO92yfy5odTV47n/ KTirIIuU0E34p2qJtS0ZW3Em5eyvJ1DYk9ZZqY54r1tWJ7IK6xlGWGLcJl3wHoVVLWrMot9QIR6 Pbnjeu0uLjtmvNFbklm0v+JY1I1RRU2CsKTiobkskBGb63h79PuksmovsWtePMuJQV3yKbiusLF uGfhPg4++vgBUmSCIqKatGNmJ02jUT8K5MZWnDt6yPO8qZ4BbTUU8uvIgF8V4FLg2UmtxKq2UfP KH510grPuwpdOM2Hq3zSXvTX0GCU/+NVdrMddi79aVo9R0LU4d31hVxWAyq2pC32xO2Wq7KQrAK FCerc6lfH+08lM1LF+9Nc4IuSjZigKjeROMsvKSE7pCoiwigXLH2SnBq1rtW37M05E= X-Received: by 2002:a05:600c:4f87:b0:49d:93c:d903 with SMTP id 5b1f17b1804b1-49e7a66ac24mr76568825e9.20.1789475284877; Tue, 15 Sep 2026 05:28:04 -0700 (PDT) Received: from [127.0.1.1] (2a01cb0007c59900d73f8285c1e647ab.ipv6.abo.wanadoo.fr. [2a01:cb00:7c5:9900:d73f:8285:c1e6:47ab]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e7d6bf4desm83105075e9.15.2026.09.15.05.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 05:28:04 -0700 (PDT) From: Amin Gattout Date: Tue, 15 Sep 2026 14:27:58 +0200 Subject: [PATCH 3/3] arm64: dts: rockchip: add vicap node to rk3576 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260915-vicap-rk3576-v1-3-d3f5eb58a0b5@gmail.com> References: <20260915-vicap-rk3576-v1-0-d3f5eb58a0b5@gmail.com> In-Reply-To: <20260915-vicap-rk3576-v1-0-d3f5eb58a0b5@gmail.com> To: Mehdi Djait , Michael Riesch , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Amin Gattout X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789475280; l=3278; i=amin.gattout@gmail.com; s=20260818; h=from:subject:message-id; bh=ts6YghVyA/zyzel5doEzGL1L/0VfbhJhUqB26M/V22k=; b=0fgklDILhS6+qpSp5w+qn6nL6tcjMbDA8a1JI/kKqs5AIOzSjV0gLt0i/KY3bs2HtZsfvqwtT u37tMDJ/EqVClUfq89iDRaOQ1FHFpJdy2qmzB5sbxVb9dE217e1xVcs X-Developer-Key: i=amin.gattout@gmail.com; a=ed25519; pk=MSIqDPkCOkwtyP8Fns1m+KFU9SgqoDl2mpLe18vL+hQ= Add the device tree node for the Video Capture (VICAP) unit of the RK3576 and its IOMMU, and connect the VICAP to the two MIPI CSI-2 receivers that are usable with the MIPI D-PHYs in full mode. Signed-off-by: Amin Gattout Reviewed-by: Michael Riesch --- arch/arm64/boot/dts/rockchip/rk3576.dtsi | 83 ++++++++++++++++++++++++++++= ++++ 1 file changed, 83 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3576.dtsi b/arch/arm64/boot/dts= /rockchip/rk3576.dtsi index cbf8b70cc15a..0c46accf5657 100644 --- a/arch/arm64/boot/dts/rockchip/rk3576.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3576.dtsi @@ -1323,6 +1323,81 @@ vdec_mmu: iommu@27b00800 { rockchip,disable-mmu-reset; #iommu-cells =3D <0>; }; + vicap: video-capture@27c10000 { + compatible =3D "rockchip,rk3576-vicap"; + reg =3D <0x0 0x27c10000 0x0 0x800>; + interrupts =3D ; + clocks =3D <&cru ACLK_VICAP>, <&cru HCLK_VICAP>, + <&cru DCLK_VICAP>, + <&cru CLK_VICAP_I0CLK>, <&cru CLK_VICAP_I1CLK>, + <&cru CLK_VICAP_I2CLK>, <&cru CLK_VICAP_I3CLK>, + <&cru CLK_VICAP_I4CLK>; + clock-names =3D "aclk", "hclk", "dclk", + "iclk", "iclk1", "iclk2", "iclk3", "iclk4"; + iommus =3D <&vicap_mmu>; + power-domains =3D <&power RK3576_PD_VI>; + resets =3D <&cru SRST_A_VICAP>, <&cru SRST_H_VICAP>, + <&cru SRST_D_VICAP>, + <&cru SRST_VICAP_I0CLK>, <&cru SRST_VICAP_I1CLK>, + <&cru SRST_VICAP_I2CLK>, <&cru SRST_VICAP_I3CLK>, + <&cru SRST_VICAP_I4CLK>; + reset-names =3D "arst", "hrst", "drst", + "irst0", "irst1", "irst2", "irst3", "irst4"; + status =3D "disabled"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + vicap_dvp: port@0 { + reg =3D <0x0>; + }; + + vicap_mipi0: port@1 { + reg =3D <0x1>; + }; + + vicap_mipi1: port@2 { + reg =3D <0x2>; + + vicap_mipi1_input: endpoint { + remote-endpoint =3D <&csi1_output>; + }; + }; + + vicap_mipi2: port@3 { + reg =3D <0x3>; + }; + + vicap_mipi3: port@4 { + reg =3D <0x4>; + + vicap_mipi3_input: endpoint { + remote-endpoint =3D <&csi3_output>; + }; + }; + + vicap_mipi4: port@5 { + reg =3D <0x5>; + }; + + vicap_toisp0: port@10 { + reg =3D <0x10>; + }; + }; + }; + + vicap_mmu: iommu@27c10800 { + compatible =3D "rockchip,rk3576-iommu", "rockchip,rk3568-iommu"; + reg =3D <0x0 0x27c10800 0x0 0x100>; + interrupts =3D ; + clocks =3D <&cru ACLK_VICAP>, <&cru HCLK_VICAP>; + clock-names =3D "aclk", "iface"; + power-domains =3D <&power RK3576_PD_VI>; + rockchip,disable-mmu-reset; + #iommu-cells =3D <0>; + status =3D "disabled"; + }; =20 csi1: csi@27c90000 { compatible =3D "rockchip,rk3576-mipi-csi2", "rockchip,rk3568-mipi-csi2"; @@ -1346,6 +1421,10 @@ csi1_in: port@0 { =20 csi1_out: port@1 { reg =3D <1>; + + csi1_output: endpoint { + remote-endpoint =3D <&vicap_mipi1_input>; + }; }; }; }; @@ -1372,6 +1451,10 @@ csi3_in: port@0 { =20 csi3_out: port@1 { reg =3D <1>; + + csi3_output: endpoint { + remote-endpoint =3D <&vicap_mipi3_input>; + }; }; }; }; --=20 2.43.0