[PATCH v5 1/2] Add support for mt9p031 Aptina (Micron) sensor.

This patch adds basic support (no controls) for
mt9p031 sensor. It applies on kernel 2.6.39.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>

Since isp clocks have not been exposed yet, this patch
includes a temporal solution for testing mt9p031 driver
in Beagleboard xM.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>

There should probably a if (cpu_is_omap3630()) {} wrapped around that, so the camera doesn't get initted on a 3530 beagle.

regards,

Koen

root@beagleboardxMC:~# yavta -f SGRBG8 -s 320x240 -n 4 --capture=10 --skip 3 -F `media-ctl -e "OMAP3 ISP CCDC output"`
Device /dev/video2 opened.
Device `OMAP3 ISP CCDC output' on `media' is a video capture device.
Video format set: SGRBG8 (47425247) 320x240 buffer size 76800
Video format: SGRBG8 (47425247) 320x240 buffer size 76800
4 buffers requested.
length: 76800 offset: 0
Buffer 0 mapped at address 0x402cf000.
length: 76800 offset: 77824
Buffer 1 mapped at address 0x402fe000.
length: 76800 offset: 155648
Buffer 2 mapped at address 0x40362000.
length: 76800 offset: 233472
Buffer 3 mapped at address 0x40416000.
0 (0) [-] 4294967295 76800 bytes 167.403289 1306829219.931121 0.002 fps
1 (1) [-] 4294967295 76800 bytes 167.633148 1306829220.160980 4.350 fps
2 (2) [-] 4294967295 76800 bytes 167.744506 1306829220.272308 8.980 fps
3 (3) [-] 4294967295 76800 bytes 167.855865 1306829220.383667 8.980 fps
4 (0) [-] 4294967295 76800 bytes 167.967193 1306829220.495025 8.982 fps
5 (1) [-] 4294967295 76800 bytes 168.078552 1306829220.606384 8.980 fps
6 (2) [-] 4294967295 76800 bytes 168.189910 1306829220.717742 8.980 fps
7 (3) [-] 4294967295 76800 bytes 168.301269 1306829220.829071 8.980 fps
8 (0) [-] 4294967295 76800 bytes 168.412597 1306829220.940429 8.982 fps
9 (1) [-] 4294967295 76800 bytes 168.523956 1306829221.051788 8.980 fps
Captured 10 frames in 1.254212 seconds (7.973134 fps, 612336.670356 B/s).
4 buffers released.

So that seems to be working! I haven't checked the frames yet, but is isn't throwing ISP errors anymore.

Great!
Do you have a monochrome version of the same sensor?

...speaking of which - if multiarch kernels are supported by OMAP3 you
probably want to use something like

  if (!machine_is_omap3_beagle() || !cpu_is_omap3630())
    return;

Thanks
Guennadi

I think I only have the colour version, I got it with my leopard355 board way back.

So what can I do with an unpatched mediactl and unpatched yavta? Is it already possible to point something like mplayer or gstreamer to a v4l2 node and see something? I lost the track of which patch goes where :slight_smile:

regards,

Koen

I don't know, I haven't tried.
I'm still using old yavta + Guennadi's patch to enable stdoutput and
"nc" to view images in my PC with mplayer.

If you're a lucky owner of an LCD on your bb-xM;) you might be able to do
something similar, to what's described here

http://download.open-technology.de/BeagleBoard_xM-MT9P031/BBxM-MT9P031.txt

but both yavta and mplayer on the board, while short-circuiting the
network;) I.e., pipe yavta output directly to mplayer.

Thanks
Guennadi

Shouldn't you check the Beagleboard version instead? The OMAP3530 has an ISP,
so there's nothing wrong with it per-se.

No idea whatsoever - in that part I'm just repeating, what the previous
poster has said:)

Thanks
Guennadi

It has an ISP, but the pins aren't brought out, so you will never be able to use it. We could check the version, but that will look like:

if (omap3_beagle_get_rev() = OMAP3BEAGLE_BOARD_XM || omap3_beagle_get_rev() = OMAP3BEAGLE_BOARD_XMC || omap3_beagle_get_rev() = OMAP3BEAGLE_BOARD_XMD )

or check if you're not on OMAP3BEAGLE_BOARD_AXBX, OMAP3BEAGLE_BOARD_C1_3 or OMAP3BEAGLE_BOARD_C4. I find the 3630 check a lot simpler :slight_smile:

regards,

Koen

regards,

Koen

I tried that and I can say that shining a light into the sensor changes the picture on the screen, but that's about it. Which part needs changing (subdev, isp, mt9p031, beagle-camera, etc) to enable 'standard' access? E.g. opening cheese in gnome.

regards,

Koen

This is what I see with the 5M and the command that worked for you:

root@beagleboard:~# yavta -f SGRBG8 -s 320x240 -n 4 --capture=10 --
skip 3 -F `media-ctl -e "OMAP3 ISP CCDC output"`
Device /dev/video2 opened.
Device `OMAP3 ISP CCDC output' on `media' is a video capture device.
Video format set: SGRBG8 (47425247) 320x240 buffer size 76800
Video format: SGRBG8 (47425247) 320x240 buffer size 76800
4 buffers requested.
length: 76800 offset: 0
Buffer 0 mapped at address 0x40248000.
length: 76800 offset: 77824
Buffer 1 mapped at address 0x40265000.
length: 76800 offset: 155648
Buffer 2 mapped at address 0x402ce000.
length: 76800 offset: 233472
Buffer 3 mapped at address 0x40334000.
Unable to start streaming: 22.

-ENOTENOUGHINFO

did you run the other commands (e.g. the mediactl ones) as well?

Hi Koen,