DVP Use
Board Resource
There is a DVP camera interface on the Firefly-RK3288-Reload
development board. This article will introduce how to make the camera
work properly, using OV5640 as an example.
Relevant Code Directory
The code directories of camera are shown as followed:
Android:
`- hardware/rockchip/camera
|- Config
| `- cam_board.xml # Parameter Configuration
|- CameraHal # HAL source code
`- SiliconImage # ISP library, including driver source code of all supported modules.
`- isi/drv/OV5640 # Driver source code of OV5640 module.
`- calib/OV5640.xml # Calibration parameter of OV5640 module.
Kernel:
|- kernel/drivers/media/video/rk_camsys // CamSys driver source code
`- kernel/include/media/camsys_head.h
Configuration Theory
What you need to configure the camera is to make the pins and clock
work properly.
According to the schematic diagram below, you need to provide:
VCC28_DVP、VCC18_DVP、VCCIO_YUV、PWDN(FLASH0_CLE)、RESET and XCLK1.
RST controled by PDN1
PWDN、RST are connected to GPIO3_B4、GPIO2_B7
Android Layer Configuration
Edit hardware/rockchip/camera/Config/cam_board_rk3288.xml to
configure the camera:
You can modify these contents:
Sensor Name
This name must match the name of the sensor driver, which has the
following format: libisp_isi_drv_OV5640.so
This driver file will be created in directory "
out/target/product/rk3288_box/system/lib/hw/" after an Android build.
Sensor Software ID
The ID must be unique among the camera drivers.You can fill with the
following values:
CAMSYS_DEVID_SENSOR_1A
CAMSYS_DEVID_SENSOR_1B
CAMSYS_DEVID_SENSOR_2
Collector Name
Currently only support:
CAMSYS_DEVID_MARVIN
I2C channel number
You can get the number via schematic or datasheet of RK3288.
Length of Register Address (in bytes)
Clock of I2C (in Hz)
MCLK of Camera (in Hz)
PMU LDO Name Connected to AVDD. Set to NC if not connected.
PMU LDO Name Connected to DOVDD
Set to NC if not connected to PMU. Value of min and max must be
specified, which determinte the voltage of the IO pins.
PMU LDO Name Connected to DVDD
Set to NC if not connected to PMU.
PowerDown Pin
Fill in the GPIO's name and active level.
Reset Pin
Fill in the GPIO's name and active level.
Power Pin
Fill in the GPIO's name and active level.
Facing Value
Set the value as "front" or "back".
Camera Interface Type
The following values are valid:
CCIR601
CCIR656
MIPI
SMIA
Mirror Flip
This is not supported at the moment.
Orientation
Hardware Interface DVP
phyMode: Sensor hardware interface type, set to "CamSys_Phy_Cif" if it
is a DVP sensor.
sensor_d0_to_cif_d: The data number of the SoC DVP interface, which is
connected with output data D0 of sensor DVP.
cif_num: The interface number of the SoC DVP, which is connected with
sensor DVP.
sensorFmt:Data format of sensor output. Only "CamSys_Fmt_Raw_10b"
is supported.
Compile Kernel
Build "drivers\media\video\rk_camsys" driver into kernel, with
following configuration instructions:
Run in the kernel source directory:
make menuconfig
Select the following configuration items:
Device Drivers --->
<*>Multimedia support --->
<*>camsys driver
RockChip camera system driver --->
<*> camsys driver for marvin isp
< > camsys driver for cif
Finally, run:
make firefly-rk3288-reload.img
which will start the kernel compilation.