SPRACD8 June 2019 DRA710 , DRA712 , DRA714 , DRA716 , DRA718 , DRA724 , DRA725 , DRA726 , DRA745 , DRA746 , DRA74P , DRA750 , DRA756 , DRA75P , DRA76P , DRA77P , DRA780 , DRA781 , DRA782 , DRA783 , DRA786 , DRA787 , DRA790 , DRA791 , DRA793 , DRA797 , TDA2EG-17 , TDA2HF , TDA2HG , TDA2HV , TDA2LF , TDA2P-ABZ , TDA2P-ACD , TDA2SA , TDA2SG , TDA2SX
This application report describes how to integrate a new camera with the DRA7xx software ecosystem. It documents all the software changes needed to bring up a new camera on a custom board using DRA7xx running Processor SDK Linux automotive software.
All other trademarks are the property of their respective owners.
The DRA7xxx family of System-on-Chips (SoCs) have Video Input Port (VIP) as one of the essential module used for video capture in automotive use cases. The processor SDK supports a few cameras out of the box on the DRA7xx EVMs, but depending on the customer need, different cameras need to be integrated with the DRA7xx SoCs. Sometimes, the video that needs to be captured may not be directly from a camera; it may be the output of an analog video decoder or an HDMI receiver as well.
The VIP driver supports different types of cameras:
The VIP driver is a V4L2 capture driver that registers /dev/videoX devices in userspace, which are used for performing video capture via standard V4L2 API. The V4L2 specification allows for SoC driver to be written independent of the camera/video source. There is one V4L2 driver for the VIP instance and each camera device may have a separate V4L2 subdevice driver. The camera driver is responsible for configuring the camera as described in the device node and implement some of the media bus operations. Theses operations are often used by the VIP driver whenever the camera needs to perform specific tasks (for example, start/stop camera, get/set fmt, and so forth).
Different camera/video sources have different configuration parameters when interfacing with the VIP video ports. Common interfacing properties like Horizontal Sync (Hsync), Vertical Sync (Vsync), Pclk polarities can be different across different devices. V4L2 endpoint, also known as v4l2_fwnode_endpoint, describes these as part of the device tree definition. This makes the VIP driver generic enough to have no dependency on the camera device. It also provides the flexibility to work with new cameras by doing simple device tree modifications.
The following example showcases the DT entries of VIP device node and its usage when interfacing different video sources.
vip1 {
#address-cells = <1>;
#size-cells = <0>;
ports {
vin1a: port@1A {
reg = <0>;
#address-cells = <1>;
endpoint@0 {
remote-endpoint = <&cam1>;
};
};
vin2a: port@1A {
...
};
...
};
};
The above snippet describes the SoC VIP1 instance. It creates endpoint nodes for each of the video ports available for that instance. By default, all the port nodes are empty, so it is not associated with any cameras. Certain port nodes need to be populated when a new camera gets interfaced to that port. Both endpoint nodes are cross referenced in the device tree.
Table 1 describes exact names of the ports (this also matches the Technical Reference Manual (TRM) terminology) for each instance.
Endpoint Name | VIP Instance | Slice | Port Name |
---|---|---|---|
vin1a | VIP1 | slice0 | port A |
vin1b | VIP1 | slice0 | port B |
vin2a | VIP1 | slice1 | port A |
vin2b | VIP1 | slice1 | port B |
vin3a | VIP1 | slice0 | port A |
vin3b | VIP1 | slice0 | port B |
vin4a | VIP1 | slice1 | port A |
vin4b | VIP1 | slice1 | port B |
vin5a | VIP1 | slice0 | port A |
vin6a | VIP1 | slice1 | port A |
ov10635@35{
compatible = "ovti,ov10633";
reg = <0x35>;
mux-gpios = <&pcf_hdmi 3 GPIO_ACTIVE_LOW>;
...
port {
cam1: endpoint {
remote-endpoint = <&vin1a>;
hsync-active = <1>;
vsync-active = <1>;
pclk-sample = <0>;
bus-width = <8>;
};
};
};
The above snippet describes the camera device. Standard properties about video interface can be described with the endpoint device nodes itself. This minimizes the communication between the SoC driver and the camera driver. This example describes: