SAMA7G5 Image Acquisition Pipeline
Introduction
This page serves as a complete reference for the SAMA7G5 image acquisition pipeline capabilities, with a focus on the associated software.
SAMA7G5 can capture an image from either a serial sensor using the MIPI CSI-2® interface or from a parallel sensor using the Parallel Input/Output (PIO) parallel interface. The MIPI CSI-2 pipeline is a way of capturing an image from a sensor using a serial interface, named CSI-2 (Camera Serial Interface 2), which is standardized by the MIPI Alliance.
Previous MPU products had a simple parallel pipeline, in which there was a parallel sensor (like ov2640, ov7740) connected directly through I/O pins to the MPU to the Image Sensor Controller (ISC) or Image Sensor Interface (ISI) hardware block.
SAMA7G5 still supports a parallel sensor connection, with slight changes (the csi2dc hardware block as described below). SAMA7G5 pipeline configuration requires media controller pipeline and media controller user space configuration. For the media controller tutorial, check the "Media Controller Pipeline for Image Acquisition and SAM MPU Products" page.
Drivers
This is a summary of the drivers required for SAMA7G5 image acquisition.
Microchip eXtended Image Sensor Controller (XISC)
This driver is for the ISC, the top video driver (root video driver) that is the direct interface with the user. The XISC is the component that can convert pixels into data in memory, which can be saved into a file.
Driver can be enabled in menuconfig:

The XISC, once probed correctly, will prepare a device, /dev/video0, and a device, /dev/media0, into the devfs. (It can be /dev/video1 or /dev/video2, for example, if you have another camera driver loaded like a USB camera).
The /dev/video is called the video node, and /dev/media0 is called the media controller node.
Microchip CSI2 Demux Controller (CSI2DC)
This driver is a demux controller that controls the input into XISC. It is positioned between a possible PHY and the XISC.
Driver can be enabled in menuconfig:

The CSI2DC will register a subdevice node into devfs, /dev/v4l-subdev1 (not mandatory to be number 1).
Synopsys DWC CSI2HOST
This driver is a CSI2 Host controller interface. It is used only if the pipeline includes a serial CSI2 MIPI sensor. This sensor is connected to the CSI2 PHY, and this PHY is connected to the CSI2HOST. If one connects a parallel sensor to the XISC I/O pins, this block is unused.
Driver can be enabled in menuconfig:

The CSI2HOST will register a subdevice node into devfs, /dev/v4l-subdev2 (not mandatory to be number 2).
Synopsys DWC CSI2 D-PHY
This is a driver for the Synopsys CSI2 D-PHY. It is used only if the pipeline includes a serial CSI2 MIPI sensor. The sensor is directly connected to this PHY. The connections include the MIPI data lanes and clock lane (D0+, D0-, D1+, D1-, CLK+, CLK-). The PHY maintains the required electrical levels for MIPI CSI2 communication. The PHY is unidirectional, from the sensor to the D-PHY. There is no possible communication from the D-PHY back to the sensor.
The driver can be enabled in menuconfig:

The PHY does not register a subdevice node in /dev, and thus it cannot be accessed from userspace. It is fully transparent to the user.
Sensors
The de facto sensor for this platform is the Sony IMX219 MIPI CSI2 sensor.
Sony IMX219
Also known as Raspberry Pi® camera module v2.1, the Sony® IMX219 is a MIPI CSI-2 sensor with 10-bit precision that can stream data in Raw BAYER format with a resolution up to 8 Mpix, at 3280x2464. Communication with the sensor is done via the I2C bus. The D-PHY is used to capture pixels, but sensor initialization, start/stop, and configuration are done via the I2C bus.
The driver can be enabled in menuconfig:

The sensor driver will register a subdevice node as /dev/v4l-subdev3 (not mandatory to be number 3).
The IMX219 is used as an example in the media controller tutorial. Check the specific page for examples of how to configure the pipeline with this sensor.
Sony IMX274
This Sony sensor is a 4-lane MIPI CSI2 serial sensor with 10/12 bits precision that can stream data in Raw BAYER format with a resolution up to 8.59 Mpix at 3840x2160 (wide). Communication with the sensor is done via the I2C bus. The D-PHY is used to capture pixels, but sensor initialization, start/stop, and configuration are done via the I2C bus.
The driver can be enabled in menuconfig:

The sensor driver will register a subdevice node as /dev/v4l-subdev3 (not mandatory to be number 3).
Omnivision OV7740
This Omnivision sensor is a parallel 8-bit Raw BAYER sensor with a resolution up to 640x480 (VGA). It can also stream direct YUYV format. Communication with the sensor is done via the I2C bus. The parallel lines are used to capture pixels, but sensor initialization, start/stop, and configuration are done via the I2C bus.
The driver can be enabled in menuconfig:

The sensor driver will register a subdevice node as /dev/v4l-subdev3 (not mandatory to be number 3).
Related Topics
Boards
Components
Linux® Kernel
Linux 5.15
Linux 6.1
Linux 6.6
Summary
Detailed explanation of the SAMA7G5 image acquisition pipeline