IMX6 QuadPlus CSI0 Test Mode Drivers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX6 QuadPlus CSI0 Test Mode Drivers

1,166 Views
mcergun
Contributor III

I have to start by saying that I'm new to Linux Programming.

Currently I am on a project to write a driver for a custom imaging device but before that I am trying to write a CSI0 Test Driver to see the Chess Board Image to test with my gstreamer pipelines.

I am reading "I.MX BSP Porting Guide 03/2016" Section 7 for guidelines but some parts are not clear for me:

When you set the TEST_GEN_MODE register, the device is in test mode, which is used

for debugging. The CSI generates a frame automatically and sends it to one of the

destination units. The sent frame is a chess board composed of black and configured

color squares. The configured color is set with the registers PG_B_VALUE,

PG_G_VALUE, and PG_R_VALUE. The data can be sent in different frequencies

according to the configuration of DIV_RATIO register.

When CSI is in test mode, configure the CSI unit with a similar configuration to the

described settings in the following table. Call ipu_csi_init_interface() to configure the

CSI interface protocol, formats, and features.

This paragraph directs me to set a register but doesn't tell me how to do that. Following the same documents it leads me to think that to set the mentioned register, I need to make a new file in a folder that I can't really find in my project and implement some functions. The closest directory that I found was "{BUILDDIR}/tmp/work-shared/imx6qpsabresd/kernel-source/drivers/media/platform/mxc/capture/"

To add a new camera sensor entry on the Kconfig camera file, perform the following

steps:

1. Enter the following command into the display specific folder:

$ cd linux/drivers/media/video/mxc/capture

2. Open the Kconfig file:

$ gedit Kconfig &

3. Add the entry where you want it to appear:

config MXC_IPUV3_CSI0_TEST_MODE

tristate "IPUv3 CSI0 test mode camera support"

depends on !VIDEO_MXC_EMMA_CAMERA

---help---

If you plan to use the IPUv3 CSI0 in test mode with your MXC

system, say Y here.

Again, following the document.

Create a file with the required panel-specific functions in the following path:

linux/drivers/media/video/mxc/capture/

The camera file-ipuv3_csi0_chess.c-must include the functions described in table below

and may include additional functions and macros required for your driver.

And it gives me a list of functions without giving information about their implementation.

Also after creating the test mode driver. I understand that I'm supposed to modify Kconfig files and make files. After doing these steps how will I compile the kernel?

Labels (2)
3 Replies

555 Views
mcergun
Contributor III

Update: I found another CSI Test driver written for MX53 and used that file as a guide for my driver for MX6QP. I modified Kconfig and Makefile according to the document and used git to produce a patch. I added patch file to a bbappend file in my layer and referenced my layer in bblayers.conf. But I still see old config options in menuconfig.

0 Kudos

555 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello mert can ergun,

Are you making a clean operation before testing the patch? Yocto generally does not trace changes on already built files so changes may not be reflected unless you force it by cleaning up first.

I would recommend also looking at the layer priority to make sure the append is considered with a higher priority than the layers it depends from. The path for the append on your new layer should also mimic the path of the original recipe on its own layer so bitbake can find it.

I hope this help! Please let us know of your findings!

Regards,

555 Views
mcergun
Contributor III

i make sure that i cleansstate (also tried full clean) and compile with -f. I am not so sure about the layer question, though. What do you mean by mimicking original recipe path?

my .bbappend file is as follows:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

SRC_URI += "file://0001-added-ipuv3-csi0-chess-board-test-driver.patch"

SRC_URI += "file://0002-updated-Kconfig-for-chess-board-test-driver.patch"

SRC_URI += "file://0003-updated-makefile-for-chess-board-test-driver.patch"

3 files I edited are Kconfig Makefile and ipuv3_csi0_chess.c, each patch file changes or creates one file. My layer file system is like "meta-mtcam/linux-platform-drivers/linux-platform-drivers_0.1.bbappend"

0 Kudos