From patchwork Mon Mar 18 15:49:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13595498 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 6BBE7C54E58 for ; Mon, 18 Mar 2024 15:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=u/R+cVXY5r+paKOF9g0OSV4l/RuL/HQXOsNimm36xV4=; b=40FVzTck0QQKFR 1b8Fi5qYOu34w+nMn6zU5/A+eBbACpUrm4i5xJrpcuAlOPsFTja8MwOhIfoW6V6fU+LtP/LJEdgpj xq4jjxDoD3mwktIzbpfFgKW9GItdxNzbYDC0W5GLkGGNcoHIEBYC/RSVigZGa0KNM3dCt5FXOuDmF gR6QZPw4z9wsYrsZq7lkeXVXXfrI9t1RIDsLuhOwIfZ6KVLTDBS2JH4FS2rxUY+O2Uu9+kS1LSJQT Sai7m8E5PiR19c80/D+4owpnNTEV39pMHr6o6ht9j8mhtQyOWkBqc2FRx0s0xh2OmVzEkdDJauQ01 lr+8NtN9AzeEfkIRkewA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmFGc-000000096JU-1IU5; Mon, 18 Mar 2024 15:51:15 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmFGY-000000096HQ-3A4M; Mon, 18 Mar 2024 15:51:12 +0000 Received: from [127.0.1.1] (91-154-34-181.elisa-laajakaista.fi [91.154.34.181]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DB39A2A5; Mon, 18 Mar 2024 16:50:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1710777040; bh=ey41zW7cilaZHFny2QLte4eGi7mCyvfDTnx7ZAEyFhE=; h=From:Subject:Date:To:Cc:From; b=wQaAlgF7cY0I9zK93ZQa4Rktbs7LfywXjXsKlDwydEnjKpoDkMIOdNMeK/oZh8wds 0VwZOil91ypK/Tpmv0bKrjm9I3BOSKonnijJVP+eePH2k6xzD52+WOdBU9c2UoKCxg ueCntxev0sd6yWydjKbPq2SSAQymG1Ftf5LrC/uQ= From: Tomi Valkeinen Subject: [PATCH 0/4] media: raspberrypi: Support RPi5's CFE Date: Mon, 18 Mar 2024 17:49:55 +0200 Message-Id: <20240318-rp1-cfe-v1-0-ac6d960ff22d@ideasonboard.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAKRi+GUC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDY0MT3aICQ93ktFRdQxOjJDMjiyRzI0MTJaDqgqLUtMwKsEnRsbW1AEf iHdVZAAAA To: Mauro Carvalho Chehab , Raspberry Pi Kernel Maintenance , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Naushir Patuck , Laurent Pinchart , Sakari Ailus , Jacopo Mondi , Kieran Bingham , Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3886; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=ey41zW7cilaZHFny2QLte4eGi7mCyvfDTnx7ZAEyFhE=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBl+GLkN3N05QSjcuydlBFJSye5DaOwL1ujsQmNl 8VxrTRncxuJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZfhi5AAKCRD6PaqMvJYe 9UMGD/9u9kAGm9u2EwcGdtyVt+G+RrFu7OcujX8GwWlJ5BM2U3ocWxaIlW7E/hU5MIJ2UuCk1RV gbEGLaRubgXTd1iUhIDdvrhRK9u3twOM5jC6VERSSPCI87a20UIsdjnGuy/1lUni2hnyz3wuXWR TJoVJgCT7nxQvfmB2iuKSXUH06ai4HH8G1jiZbuUVtwDjwHdi2RNziiQpF2WzQcIhQZrHn2bTHS E0e4kyNCxTT8/iHB7cWNO2L0XYkQ3cpkLwDBwvw1fi4dRy14n6vPB34xjTn0uhrjSBF8gQx7oMT LS8BmM95F4f4jE56eiRmnK8QxoEaRIjgFPCKzHAXl5IeWhUPjbPOms7BL6pOFNbzI0x4fmn91sI c6G+ruQ0I7JXf2EGBmh03fbwGLAoUsBXQPRgDWdyyWaRIxvlQJqgzXm5XYaFcBYWLWfD7lEvner ngwmOJcQHkwqiTL4DFGgLtQ2/b9vnwDuQPOOScgL7U0GgX88/BlpB+eVuDB5BiCJZmPfOk4d19e sBFLnBLHu9FEIKUfvDESMS0jLhbh1IFU4MIS0PSONbW1zsHzvDO2M0I6X95m0hhDO8Rqvkz3Zl8 QhjOkr2BNlQOifXACNetze/3xhXFgiEo/GSnmTNynB+z+uz+3V/6/tdqy0wHgmWv+WXHX6CFbls F7F2oLAPYBwdIKA== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240318_085111_113919_AADC5125 X-CRM114-Status: GOOD ( 15.05 ) 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 This series adds support to the CFE hardware block on RaspberryPi 5. The CFE (Camera Front End) contains a CSI-2 receiver and Front End, a small ISP. This series is currently based on multiple other serieses: - Sakari's "[PATCH v8 00/38] Generic line based metadata support, internal pads" for metadata support - Laurent's "[PATCH 00/15] media: Add driver for the Raspberry Pi <5 CSI-2 receiver" for a few new pixel formats and imx219 (for testing). - Jacopo's "[PATCH v5 0/9] media: raspberrypi: Add support for PiSP Back End" for some shared uapi headers. And to run this, one of course needs the basic RPi5 kernel support plus relevant dts changes to enable the cfe and camera. So at the moment we cannot merge this driver, but hopefully the dependencies will get merged before the reviews on this one are done. A few notes about the patches: - The original work was done by RaspberryPi, mostly by Naushir Patuck. - The second video node only sets V4L2_CAP_META_CAPTURE instead of both V4L2_CAP_META_CAPTURE and V4L2_CAP_META_CAPTURE like the other nodes. This is a temporary workaround for userspace (libcamera), and hopefully can be removed soon. - The compatible string is set to "raspberrypi,rpi5-rp1-cfe". I added the "rpi5" part as versioning, as there's no clear CFE hardware version defined. I'm open to other suggestions on the versioning scheme. I have tested this with: - A single IMX219 sensor connected to the RPi5's CSI-2 port - Arducam's UB960 FPD-Link board with four imx219 sensors connected I have pushed my branch, with all the dependencies and everything needed to run this, to: git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git rp1-cfe Tomi Signed-off-by: Tomi Valkeinen --- Tomi Valkeinen (4): media: uapi: Add meta formats for PiSP FE config and stats dt-bindings: media: Add bindings for raspberrypi,rp1-cfe media: raspberrypi: Add support for RP1-CFE media: admin-guide: Document the Raspberry Pi CFE (rp1-cfe) .../admin-guide/media/raspberrypi-rp1-cfe.dot | 27 + .../admin-guide/media/raspberrypi-rp1-cfe.rst | 78 + Documentation/admin-guide/media/v4l-drivers.rst | 1 + .../bindings/media/raspberrypi,rp1-cfe.yaml | 103 + .../userspace-api/media/v4l/meta-formats.rst | 1 + .../userspace-api/media/v4l/metafmt-pisp-fe.rst | 39 + MAINTAINERS | 8 + drivers/media/platform/raspberrypi/Kconfig | 1 + drivers/media/platform/raspberrypi/Makefile | 1 + drivers/media/platform/raspberrypi/rp1-cfe/Kconfig | 14 + .../media/platform/raspberrypi/rp1-cfe/Makefile | 6 + .../media/platform/raspberrypi/rp1-cfe/cfe-fmts.h | 330 +++ .../media/platform/raspberrypi/rp1-cfe/cfe-trace.h | 196 ++ drivers/media/platform/raspberrypi/rp1-cfe/cfe.c | 2526 ++++++++++++++++++++ drivers/media/platform/raspberrypi/rp1-cfe/cfe.h | 43 + drivers/media/platform/raspberrypi/rp1-cfe/csi2.c | 579 +++++ drivers/media/platform/raspberrypi/rp1-cfe/csi2.h | 89 + drivers/media/platform/raspberrypi/rp1-cfe/dphy.c | 175 ++ drivers/media/platform/raspberrypi/rp1-cfe/dphy.h | 27 + .../media/platform/raspberrypi/rp1-cfe/pisp-fe.c | 581 +++++ .../media/platform/raspberrypi/rp1-cfe/pisp-fe.h | 53 + drivers/media/v4l2-core/v4l2-ioctl.c | 2 + .../uapi/linux/media/raspberrypi/pisp_fe_config.h | 273 +++ .../linux/media/raspberrypi/pisp_fe_statistics.h | 64 + include/uapi/linux/videodev2.h | 2 + 25 files changed, 5219 insertions(+) --- base-commit: d87156e95652bc6463f86b25149f75cc3b8742eb change-id: 20240314-rp1-cfe-142b628b7214 Best regards,