From nobody Sat Oct 4 09:37:17 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7F7E51F1932; Mon, 18 Aug 2025 23:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755560387; cv=none; b=uF1wqUj/cRmlxSMMKqO1/LiecAHeqEXywJroty/Q6A6hXXLKVEQ2RQxuSRYOdU8mMVWnyiuIojor0TlVtC5P878a47hlEBmaAEIbm2Ex93cTNFNbHnJD7a7wllYJzkLf7QrOXt9Uk4F6SRHFPAhpcC/583CQlJiAPReHMrJO1/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755560387; c=relaxed/simple; bh=dvCa/wf1v2052Op0afoeFDkDpmqF6NOXoVScRmcaSO4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QgEglDKi0SY8L5hRdS1uYfyODNZFtsfcJe37VDKpGal4MEMSzuoN4y6POT60mxmf48wP+8314Wh8a1Fa7kPVpoWyLq1UoWnp9c1zaGBLVjHR30fM6ggE0DHNXS98LkCDYXHG8euZWPesRciqDa3bG3EfIg5EewNIMsu2ewwPuTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ovVUBatp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ovVUBatp" Received: by smtp.kernel.org (Postfix) with ESMTPS id 22F25C116B1; Mon, 18 Aug 2025 23:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755560387; bh=dvCa/wf1v2052Op0afoeFDkDpmqF6NOXoVScRmcaSO4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ovVUBatp1ohrBJ/4pjoK0LVaoW4X7y7v5KdBpAum5lLl1zp9OvIjWNISPoiYPBW8/ Ag3TeYVn3nsQK0ewU0ZNvw7dmB2g9R6UiEgWFLoBNoiwqI7LSC/u6IgbE0dthYJQSg C/elJqZlvpIeMWs3VQdBHmGK0T9ZPkZtms3d+BgEg6oSI8N8c04EXkywsbPHDdilSt SMG6IjMr9UFoCVG+CaxwLDqOhLjoZR3TgSq1o5k8iDPD9VG/PGJB+h3PSpKJM3mRFu 58dE8vRsG7jeBuNaTXWDUM4CCxCjf4+F8oVVeTHzVr7PH3MH5dHoqVnX/tsdFVjSSU oyCjY6+xM49Cg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BC55CA0EE4; Mon, 18 Aug 2025 23:39:47 +0000 (UTC) From: Michael Riesch via B4 Relay Date: Tue, 19 Aug 2025 01:25:53 +0200 Subject: [PATCH v10 01/13] Documentation: admin-guide: media: add rockchip camera interface 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: <20240220-rk3568-vicap-v10-1-62d8a7b209b4@collabora.com> References: <20240220-rk3568-vicap-v10-0-62d8a7b209b4@collabora.com> In-Reply-To: <20240220-rk3568-vicap-v10-0-62d8a7b209b4@collabora.com> To: Mehdi Djait , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Lebrun?= , Thomas Petazzoni , Gerald Loacker , Bryan O'Donoghue , Markus Elfring , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Kever Yang , Nicolas Dufresne , Sebastian Reichel , Collabora Kernel Team , Paul Kocialkowski , Alexander Shiyan , Val Packett , Rob Herring , Philipp Zabel , Sakari Ailus Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Michael Riesch , Michael Riesch X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1755559554; l=7244; i=michael.riesch@collabora.com; s=20250410; h=from:subject:message-id; bh=V80ukGfKBYIS6sJMMUc3DC+BSXqJ9FDIBO1EG13WzHU=; b=efULPs5MmLndc0mIN5wOjVdsvS4gQNeSuE8QJKLyGdFKRWwZ8Bs9rWDH2W/bu+zsT9S6G7F7D TjsrUcGF7qqAMO1vdbasuAaV+2oFxxLYHG9egxd48/Bl0x3NTld4Xrd X-Developer-Key: i=michael.riesch@collabora.com; a=ed25519; pk=+MWX1fffLFZtTPG/I6XdYm/+OSvpRE8D9evQaWbiN04= X-Endpoint-Received: by B4 Relay for michael.riesch@collabora.com/20250410 with auth_id=371 X-Original-From: Michael Riesch Reply-To: michael.riesch@collabora.com From: Michael Riesch Add a document that describes the different variants of the Rockchip Camera Interface (CIF), their hardware layout, as well as their representation in the media controller centric rkcif device driver, which is located under drivers/media/platform/rockchip/rkcif. Reviewed-by: Heiko Stuebner Signed-off-by: Michael Riesch --- .../admin-guide/media/rkcif-rk3568-vicap.dot | 21 ++++++ Documentation/admin-guide/media/rkcif.rst | 83 ++++++++++++++++++= ++++ Documentation/admin-guide/media/v4l-drivers.rst | 1 + MAINTAINERS | 7 ++ 4 files changed, 112 insertions(+) diff --git a/Documentation/admin-guide/media/rkcif-rk3568-vicap.dot b/Docum= entation/admin-guide/media/rkcif-rk3568-vicap.dot new file mode 100644 index 000000000000..02340135a2ac --- /dev/null +++ b/Documentation/admin-guide/media/rkcif-rk3568-vicap.dot @@ -0,0 +1,21 @@ +digraph board { + rankdir=3DTB + n00000001 [label=3D"{{ 0} | rkcif-dvp0\n/dev/v4l-subdev0 | = { 1}}", shape=3DMrecord, style=3Dfilled, fillcolor=3Dgreen] + n00000001:port1 -> n00000004 + n00000004 [label=3D"rkcif-dvp0-id0\n/dev/video0", shape=3Dbox, sty= le=3Dfilled, fillcolor=3Dyellow] + n0000000a [label=3D"{{ 0} | rkcif-mipi0\n/dev/v4l-subdev1 |= { 1}}", shape=3DMrecord, style=3Dfilled, fillcolor=3Dgreen] + n0000000a:port1 -> n0000000d + n0000000a:port1 -> n00000013 [style=3Ddashed] + n0000000a:port1 -> n00000019 [style=3Ddashed] + n0000000a:port1 -> n0000001f [style=3Ddashed] + n0000000d [label=3D"rkcif-mipi0-id0\n/dev/video1", shape=3Dbox, st= yle=3Dfilled, fillcolor=3Dyellow] + n00000013 [label=3D"rkcif-mipi0-id1\n/dev/video2", shape=3Dbox, st= yle=3Dfilled, fillcolor=3Dyellow] + n00000019 [label=3D"rkcif-mipi0-id2\n/dev/video3", shape=3Dbox, st= yle=3Dfilled, fillcolor=3Dyellow] + n0000001f [label=3D"rkcif-mipi0-id3\n/dev/video4", shape=3Dbox, st= yle=3Dfilled, fillcolor=3Dyellow] + n00000025 [label=3D"{{} | it6801 2-0048\n/dev/v4l-subdev2 | { 0}}", shape=3DMrecord, style=3Dfilled, fillcolor=3Dgreen] + n00000025:port0 -> n00000001:port0 + n00000029 [label=3D"{{ 0} | rockchip-mipi-csi fdfb0000.csi\= n/dev/v4l-subdev3 | { 1}}", shape=3DMrecord, style=3Dfilled, fillcol= or=3Dgreen] + n00000029:port1 -> n0000000a:port0 + n0000002e [label=3D"{{} | imx415 4-001a\n/dev/v4l-subdev4 | { 0}}", shape=3DMrecord, style=3Dfilled, fillcolor=3Dgreen] + n0000002e:port0 -> n00000029:port0 +} diff --git a/Documentation/admin-guide/media/rkcif.rst b/Documentation/admi= n-guide/media/rkcif.rst new file mode 100644 index 000000000000..f35f644a54a0 --- /dev/null +++ b/Documentation/admin-guide/media/rkcif.rst @@ -0,0 +1,83 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Rockchip Camera Interface (CIF) +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Introduction +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The Rockchip Camera Interface (CIF) is featured in many Rockchip SoCs in +different variants. +The different variants are combinations of common building blocks, such as + +* INTERFACE blocks of different types, namely + + * the Digital Video Port (DVP, a parallel data interface) + * the interface block for the MIPI CSI-2 receiver + +* CROP units + +* MIPI CSI-2 receiver (not available on all variants): This unit is referr= ed + to as MIPI CSI HOST in the Rockchip documentation. + Technically, it is a separate hardware block, but it is strongly coupled= to + the CIF and therefore included here. + +* MUX units (not available on all variants) that pass the video data to an + image signal processor (ISP) + +* SCALE units (not available on all variants) + +* DMA engines that transfer video data into system memory using a + double-buffering mechanism called ping-pong mode + +* Support for four streams per INTERFACE block (not available on all + variants), e.g., for MIPI CSI-2 Virtual Channels (VCs) + +This document describes the different variants of the CIF, their hardware +layout, as well as their representation in the media controller centric rk= cif +device driver, which is located under drivers/media/platform/rockchip/rkci= f. + +Variants +=3D=3D=3D=3D=3D=3D=3D=3D + +Rockchip PX30 Video Input Processor (VIP) +----------------------------------------- + +The PX30 Video Input Processor (VIP) features a digital video port that ac= cepts +parallel video data or BT.656. +Since these protocols do not feature multiple streams, the VIP has one DMA +engine that transfers the input video data into system memory. + +The rkcif driver represents this hardware variant by exposing one V4L2 sub= device +(the DVP INTERFACE/CROP block) and one V4L2 device (the DVP DMA engine). + +Rockchip RK3568 Video Capture (VICAP) +------------------------------------- + +The RK3568 Video Capture (VICAP) unit features a digital video port and a = MIPI +CSI-2 receiver that can receive video data independently. +The DVP accepts parallel video data, BT.656 and BT.1120. +Since the BT.1120 protocol may feature more than one stream, the RK3568 VI= CAP +DVP features four DMA engines that can capture different streams. +Similarly, the RK3568 VICAP MIPI CSI-2 receiver features four DMA engines = to +handle different Virtual Channels (VCs). + +The rkcif driver represents this hardware variant by exposing up to three = V4L2 +subdevices: + +* rkcif-dvp0: INTERFACE/CROP block for the DVP +* rockchip-mipi-csi fdfb0000.csi: MIPI CSI-2 receiver +* rkcif-mipi0: INTERFACE/CROP block for the MIPI CSI-2 receiver + +and up to five V4L2 devices: + +* rkcif-dvp0-id0: The support for multiple streams on the DVP is not yet + implemented, as it is hard to find test hardware. Thus, this video device + represents the first DMA engine of the RK3568 DVP. +* rkcif-mipi0-id[0...3]: The four DMA engines of the RK3568 MIPI CSI-2 + receiver. Each DMA engine can capture a certain MIPI CSI-2 Virtual Chann= el. + +.. kernel-figure:: rkcif-rk3568-vicap.dot + :alt: Topology of the RK3568 Video Capture (VICAP) unit + :align: center diff --git a/Documentation/admin-guide/media/v4l-drivers.rst b/Documentatio= n/admin-guide/media/v4l-drivers.rst index 3bac5165b134..694fad685ff5 100644 --- a/Documentation/admin-guide/media/v4l-drivers.rst +++ b/Documentation/admin-guide/media/v4l-drivers.rst @@ -25,6 +25,7 @@ Video4Linux (V4L) driver-specific documentation qcom_camss raspberrypi-pisp-be rcar-fdp1 + rkcif rkisp1 raspberrypi-rp1-cfe saa7134 diff --git a/MAINTAINERS b/MAINTAINERS index fe168477caa4..0d2adf483426 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21762,6 +21762,13 @@ S: Maintained F: Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml F: drivers/net/can/rockchip/ =20 +ROCKCHIP CAMERA INTERFACE (RKCIF) DRIVER +M: Mehdi Djait +M: Michael Riesch +L: linux-media@vger.kernel.org +S: Maintained +F: Documentation/admin-guide/media/rkcif* + ROCKCHIP CRYPTO DRIVERS M: Corentin Labbe L: linux-crypto@vger.kernel.org --=20 2.39.5