This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5728: Unable to get correct capture with ov5640 (green/pink screen issue)

Part Number: AM5728


Hello,

I have a custom board based on TI's AM5728 EVM. I am using the latest Linux PSDK 6.03 on it. I have ported the OV5640 Camera on the custom board. 

I am trying to capture using yavta test but I am failing to do so. The capture file is producing incorrect output.

Following are device tree entries that I have used -

clk_ov5640_fixed: clk_ov5640_fixed {
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
                        clock-frequency = <24000000>;
                };
clk_ov5640: clk_ov5640 {
                        compatible = "gpio-gate-clock";
                        #clock-cells = <0>;
                        clocks = <&clk_ov5640_fixed>;
                        enable-gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
                };

&vin3a {
        vin3a_ep: endpoint {
                remote-endpoint = <&cam>;
                slave-mode;
        };
};

&vip2 {
        status = "okay";
};

&i2c3 {
        status = "okay";
        clock-frequency = <400000>;

        ov5640@3c {
                compatible = "ovti,ov5640";
                reg = <0x3c>;
                clock-names = "xclk";
                clocks = <&clk_ov5640>;
                powerdown-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;

                port {
                        cam: endpoint {
                                bus-width = <8>;
                                data-shift = <2>;
                                hsync-active = <1>;
                                vsync-active = <1>;
                                pclk-sample = <1>;
                                remote-endpoint = <&vin3a_ep>;
                        };
                };
        };
};

I have enabled ov5640 driver in the kernel and I am taking care of all its dependencies as well. I am using the same driver code which is present in Linux 6.03 PSDK. Path for the driver is -  

~./ti-processor-sdk-linux-am57xx-evm-06.03.00.106/board-support/linux-4.19.94+gitAUTOINC+be5389fd85-gbe5389fd85/drivers/media/i2c/ov5640.c

After booting to the kernel with the above changes, I am getting -

1. Camera device detected at i2c

root@am57xx-evm:~# i2cdetect -y -r 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU 
70: -- -- -- -- -- -- -- --   

2. video devices getting registered 

root@am57xx-evm:~# dmesg | grep vpe
[    8.201657] vpe 489d0000.vpe: loading firmware vpdma-1b8.bin
[    8.351831] vpe 489d0000.vpe: Device registered as /dev/video0
root@am57xx-evm:~# 
root@am57xx-evm:~# 
root@am57xx-evm:~# dmesg | grep vip
[    9.275527] vip 48990000.vip: loading firmware vpdma-1b8.bin
[    9.302388] vip 48990000.vip: VPDMA firmware loaded
root@am57xx-evm:~# 
root@am57xx-evm:~# 
root@am57xx-evm:~# dmesg | grep ov5640
[    1.676556] gpio-clk clk_ov5640: GPIO lookup for consumer enable
[    1.676563] gpio-clk clk_ov5640: using device tree for GPIO lookup
[    1.676591] of_get_named_gpiod_flags: parsed 'enable-gpios' property of node '/clk_ov5640[0]' - status (0)
[    7.796208] ov5640 2-003c: GPIO lookup for consumer powerdown
[    7.796215] ov5640 2-003c: using device tree for GPIO lookup
[    7.796239] of_get_named_gpiod_flags: parsed 'powerdown-gpios' property of node '/ocp/i2c@48060000/ov5640@3c[0]' - status (0)
[    7.796260] ov5640 2-003c: GPIO lookup for consumer reset
[    7.796265] ov5640 2-003c: using device tree for GPIO lookup
[    7.796275] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/i2c@48060000/ov5640@3c[0]'
[    7.796285] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/i2c@48060000/ov5640@3c[0]'
[    7.796291] ov5640 2-003c: using lookup tables for GPIO lookup
[    7.796296] ov5640 2-003c: No GPIO consumer reset found
[    7.804753] ov5640 2-003c: 2-003c supply DOVDD not found, using dummy regulator
[    7.816059] ov5640 2-003c: Linked as a consumer to regulator.0
[    7.827176] ov5640 2-003c: 2-003c supply AVDD not found, using dummy regulator
[    7.837283] ov5640 2-003c: 2-003c supply DVDD not found, using dummy regulator
[    9.310109] vin3a: Port A: Using subdev ov5640 2-003c for capture
root@am57xx-evm:~# 
root@am57xx-evm:~# 
root@am57xx-evm:~# 
root@am57xx-evm:~# 
root@am57xx-evm:~# ls -lart /dev/video*
crw-rw----    1 root     video      81,   0 Apr 19 02:13 /dev/video11
crw-rw----    1 root     video      81,   1 Apr 19 02:13 /dev/video10
crw-rw----    1 root     video      81,   3 Apr 19 02:13 /dev/video1
crw-rw----    1 root     video      81,   2 Apr 19 02:13 /dev/video0

3. v4l2-ctl able to print complete sensor information

root@am57xx-evm:~# v4l2-ctl -d /dev/video1 --all
Driver Info:
        Driver name      : vip
        Card type        : vip
        Bus info         : platform:vip2:vin3a:stream0
        Driver version   : 4.19.94
        Capabilities     : 0x85200001
                Video Capture
                Read/Write
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x05200001
                Video Capture
                Read/Write
                Streaming
                Extended Pix Format
Priority: 2
Video input : 0 (camera 1: ok)
Video Standard = 0x00ffb0ff
        PAL-B/B1/G/H/I/D/D1/K
        NTSC-M/M-JP/M-KR
        SECAM-B/D/G/H/K/K1/L/Lc
Format Video Capture:
        Width/Height      : 640/480
        Pixel Format      : 'NV12' (Y/CbCr 4:2:0)
        Field             : None
        Bytes per Line    : 640
        Size Image        : 460800
        Colorspace        : SMPTE 170M
        Transfer Function : Default (maps to Rec. 709)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Limited Range)
        Flags             : 
Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 640, Height 480
        Default     : Left 0, Top 0, Width 640, Height 480
        Pixel Aspect: 1/1
Crop Capability Video Output:
        Bounds      : Left 0, Top 0, Width 640, Height 480
        Default     : Left 0, Top 0, Width 640, Height 480
        Pixel Aspect: 1/1
Selection Video Capture: crop, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Capture: crop_default, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Capture: compose, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Capture: compose_default, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Capture: compose_bounds, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Output: crop, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Output: crop_default, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Output: crop_bounds, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Output: compose, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Output: compose_default, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Output: compose_bounds, Left 0, Top 0, Width 640, Height 480, Flags: 
Streaming Parameters Video Capture:
        Capabilities     : timeperframe
        Frames per second: 30.000 (30/1)
        Read buffers     : 4

User Controls

                       contrast 0x00980901 (int)    : min=0 max=255 step=1 default=0 value=0 flags=slider
                     saturation 0x00980902 (int)    : min=0 max=255 step=1 default=64 value=64 flags=slider
                            hue 0x00980903 (int)    : min=0 max=359 step=1 default=0 value=0 flags=slider
        white_balance_automatic 0x0098090c (bool)   : default=1 value=1 flags=update
                    red_balance 0x0098090e (int)    : min=0 max=4095 step=1 default=0 value=0 flags=inactive, slider
                   blue_balance 0x0098090f (int)    : min=0 max=4095 step=1 default=0 value=0 flags=inactive, slider
                       exposure 0x00980911 (int)    : min=0 max=65535 step=1 default=0 value=1770 flags=inactive, volatile
                 gain_automatic 0x00980912 (bool)   : default=1 value=1 flags=update
                           gain 0x00980913 (int)    : min=0 max=1023 step=1 default=0 value=704 flags=inactive, volatile
                horizontal_flip 0x00980914 (bool)   : default=0 value=0
                  vertical_flip 0x00980915 (bool)   : default=0 value=0
           power_line_frequency 0x00980918 (menu)   : min=0 max=3 default=1 value=1
                                0: Disabled
                                1: 50 Hz
                                2: 60 Hz
                                3: Auto

Camera Controls

                  auto_exposure 0x009a0901 (menu)   : min=0 max=1 default=0 value=0 flags=update
                                0: Auto Mode
                                1: Manual Mode

Image Processing Controls

                     pixel_rate 0x009f0902 (int64)  : min=0 max=2147483647 step=1 default=55969920 value=55969920 flags=read-only
                   test_pattern 0x009f0903 (menu)   : min=0 max=1 default=0 value=0
                                0: Disabled
                                1: Color bars
root@am57xx-evm:~# 
root@am57xx-evm:~# 
root@am57xx-evm:~# 
root@am57xx-evm:~# 
root@am57xx-evm:~# v4l2-ctl -d /dev/video1 --list-formats                                                                                                                                           
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'NV12' (Y/CbCr 4:2:0)
        [1]: 'UYVY' (UYVY 4:2:2)
        [2]: 'YUYV' (YUYV 4:2:2)
        [3]: 'VYUY' (VYUY 4:2:2)
        [4]: 'YVYU' (YVYU 4:2:2)
        [5]: 'RGB3' (24-bit RGB 8-8-8)
        [6]: 'RGB4' (32-bit A/XRGB 8-8-8-8)
        [7]: 'BGR3' (24-bit BGR 8-8-8)
        [8]: 'BGR4' (32-bit BGRA/X 8-8-8-8)

PROBLEM -

I am trying to run yavta test and capture the stream in a file. When I try to play the file on my PC using ffplay, I am getting a complete green screen or pink screen on the player.

I am using the following command to capture the stream -

root@am57xx-evm:~# yavta -c60 -fYUYV -Fsample.yuv -s640x480 /dev/video1
Device /dev/video1 opened.
Device `vip' on `platform:vip2:vin3a:stream0' is a video output (without mplanes) device.
Video format set: YUYV (56595559) 640x480 (stride 1280) field none buffer size 614400
Video format: YUYV (56595559) 640x480 (stride 1280) field none buffer size 614400
8 buffers requested.
length: 614400 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0xb6d77000.
length: 614400 offset: 614400 timestamp type/source: mono/EoF
Buffer 1/0 mapped at address 0xb6ce1000.
length: 614400 offset: 1228800 timestamp type/source: mono/EoF
Buffer 2/0 mapped at address 0xb6c4b000.
length: 614400 offset: 1843200 timestamp type/source: mono/EoF
Buffer 3/0 mapped at address 0xb6bb5000.
length: 614400 offset: 2457600 timestamp type/source: mono/EoF
Buffer 4/0 mapped at address 0xb6b1f000.
length: 614400 offset: 3072000 timestamp type/source: mono/EoF
Buffer 5/0 mapped at address 0xb6a89000.
length: 614400 offset: 3686400 timestamp type/source: mono/EoF
Buffer 6/0 mapped at address 0xb69f3000.
length: 614400 offset: 4300800 timestamp type/source: mono/EoF
Buffer 7/0 mapped at address 0xb695d000.
0 (0) [-] top 0 614400 B 657.437839 657.437878 2.906 fps ts mono/EoF
1 (1) [-] top 1 614400 B 657.779121 657.779173 2.930 fps ts mono/EoF
2 (2) [-] top 2 614400 B 658.120407 658.120464 2.930 fps ts mono/EoF
3 (3) [-] top 3 614400 B 658.461686 658.461724 2.930 fps ts mono/EoF
4 (4) [-] top 4 614400 B 658.802970 658.803023 2.930 fps ts mono/EoF
5 (5) [-] top 5 614400 B 659.144251 659.144288 2.930 fps ts mono/EoF
6 (6) [-] top 6 614400 B 659.485532 659.485569 2.930 fps ts mono/EoF
7 (7) [-] top 7 614400 B 659.826816 659.826871 2.930 fps ts mono/EoF
8 (0) [-] top 8 614400 B 660.168097 660.168136 2.930 fps ts mono/EoF
9 (1) [-] top 9 614400 B 660.509379 660.509414 2.930 fps ts mono/EoF
10 (2) [-] top 10 614400 B 660.850660 660.850695 2.930 fps ts mono/EoF
11 (3) [-] top 11 614400 B 661.191948 661.191989 2.930 fps ts mono/EoF
12 (4) [-] top 12 614400 B 661.533226 661.533260 2.930 fps ts mono/EoF
13 (5) [-] top 13 614400 B 661.874507 661.874543 2.930 fps ts mono/EoF
14 (6) [-] top 14 614400 B 662.215794 662.215850 2.930 fps ts mono/EoF
15 (7) [-] top 15 614400 B 662.557072 662.557124 2.930 fps ts mono/EoF
16 (0) [-] top 16 614400 B 662.898358 662.898392 2.930 fps ts mono/EoF
17 (1) [-] top 17 614400 B 663.239637 663.239676 2.930 fps ts mono/EoF
18 (2) [-] top 18 614400 B 663.580919 663.580956 2.930 fps ts mono/EoF
19 (3) [-] top 19 614400 B 663.922201 663.922234 2.930 fps ts mono/EoF
20 (4) [-] top 20 614400 B 664.263484 664.263520 2.930 fps ts mono/EoF
21 (5) [-] top 21 614400 B 664.604769 664.604821 2.930 fps ts mono/EoF
22 (6) [-] top 22 614400 B 664.946048 664.946083 2.930 fps ts mono/EoF
23 (7) [-] top 23 614400 B 665.287331 665.287370 2.930 fps ts mono/EoF
24 (0) [-] top 24 614400 B 665.628616 665.628670 2.930 fps ts mono/EoF
25 (1) [-] top 25 614400 B 665.969895 665.969933 2.930 fps ts mono/EoF
26 (2) [-] top 26 614400 B 666.311181 666.311237 2.930 fps ts mono/EoF
27 (3) [-] top 27 614400 B 666.652459 666.652496 2.930 fps ts mono/EoF
28 (4) [-] top 28 614400 B 666.993741 666.993777 2.930 fps ts mono/EoF
29 (5) [-] top 29 614400 B 667.335027 667.335081 2.930 fps ts mono/EoF
30 (6) [-] top 30 614400 B 667.676306 667.676343 2.930 fps ts mono/EoF
31 (7) [-] top 31 614400 B 668.017591 668.017643 2.930 fps ts mono/EoF
32 (0) [-] top 32 614400 B 668.358871 668.358908 2.930 fps ts mono/EoF
33 (1) [-] top 33 614400 B 668.700153 668.700187 2.930 fps ts mono/EoF
34 (2) [-] top 34 614400 B 669.041439 669.041473 2.930 fps ts mono/EoF
35 (3) [-] top 35 614400 B 669.382718 669.382755 2.930 fps ts mono/EoF
36 (4) [-] top 36 614400 B 669.724003 669.724054 2.930 fps ts mono/EoF
37 (5) [-] top 37 614400 B 670.065281 670.065315 2.930 fps ts mono/EoF
38 (6) [-] top 38 614400 B 670.406564 670.406601 2.930 fps ts mono/EoF
39 (7) [-] top 39 614400 B 670.747850 670.747901 2.930 fps ts mono/EoF
40 (0) [-] top 40 614400 B 671.089130 671.089169 2.930 fps ts mono/EoF
41 (1) [-] top 41 614400 B 671.430411 671.431623 2.930 fps ts mono/EoF
42 (2) [-] top 42 614400 B 671.771694 671.771730 2.930 fps ts mono/EoF
43 (3) [-] top 43 614400 B 672.112980 672.113029 2.930 fps ts mono/EoF
44 (4) [-] top 44 614400 B 672.454258 672.454290 2.930 fps ts mono/EoF
45 (5) [-] top 45 614400 B 672.795539 672.795581 2.930 fps ts mono/EoF
46 (6) [-] top 46 614400 B 673.136825 673.136857 2.930 fps ts mono/EoF
47 (7) [-] top 47 614400 B 673.478103 673.478132 2.930 fps ts mono/EoF
48 (0) [-] top 48 614400 B 673.819389 673.819421 2.930 fps ts mono/EoF
49 (1) [-] top 49 614400 B 674.160669 674.160695 2.930 fps ts mono/EoF
50 (2) [-] top 50 614400 B 674.501950 674.501976 2.930 fps ts mono/EoF
51 (3) [-] top 51 614400 B 674.843232 674.843261 2.930 fps ts mono/EoF
52 (4) [-] top 52 614400 B 675.184516 675.184546 2.930 fps ts mono/EoF
53 (5) [-] top 53 614400 B 675.525801 675.525851 2.930 fps ts mono/EoF
54 (6) [-] top 54 614400 B 675.867080 675.867107 2.930 fps ts mono/EoF
55 (7) [-] top 55 614400 B 676.208362 676.208390 2.930 fps ts mono/EoF
56 (0) [-] top 56 614400 B 676.549648 676.549684 2.930 fps ts mono/EoF
57 (1) [-] top 57 614400 B 676.890928 676.890965 2.930 fps ts mono/EoF
58 (2) [-] top 58 614400 B 677.232213 677.232262 2.930 fps ts mono/EoF
59 (3) [-] top 59 614400 B 677.573490 677.573518 2.930 fps ts mono/EoF
Captured 60 frames in 20.479839 seconds (2.929710 fps, 1800014.106820 B/s).
8 buffers released.

Also, I don't get why I am getting 2.930 fps in the output of yavta command. I am setting fps to 30 as default in the probe() function of the driver code (attached below). 

fmt = &sensor->fmt;
fmt->code = MEDIA_BUS_FMT_YUYV8_2X8;
fmt->colorspace = V4L2_COLORSPACE_SRGB;
fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace);
fmt->quantization = V4L2_QUANTIZATION_FULL_RANGE;
fmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(fmt->colorspace);
fmt->width = 640;
fmt->height = 480;
fmt->field = V4L2_FIELD_NONE;
sensor->frame_interval.numerator = 1;
sensor->frame_interval.denominator = ov5640_framerates[OV5640_30_FPS];
sensor->current_fr = OV5640_30_FPS;
sensor->current_mode =
&ov5640_mode_data[OV5640_MODE_VGA_640_480];
sensor->last_mode = sensor->current_mode;

sensor->ae_target = 52;

I am using the following command to play the steam on my PC -

ffplay -pixel_format yvyu422 -video_size 640x480 -i yuyvOLD.yuv 
ffplay version 4.2.4-1ubuntu0.1 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[rawvideo @ 0x7fe9ac000bc0] Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from 'yuyvOLD.yuv':
  Duration: 00:00:02.40, start: 0.000000, bitrate: 122880 kb/s
    Stream #0:0: Video: rawvideo (YVYU / 0x55595659), yvyu422, 640x480, 122880 kb/s, 25 tbr, 25 tbn, 25 tbc

Also, the output I am getting is completely green and pink images on the player.

Please note that I don't have any display device connected to the custom board as of now. Hence, I am first capturing the stream in a file and then playing it on PC.

Kindly suggest why I am getting the incorrect output. Also, is there any other utility by which I can capture correctly from the camera device?

 

Regards,

Devashish

  • Hello TI Experts,

    This is a gentle reminder that I am awaiting your reply to this post. 

    Kindly acknowledge.

    Regards,

    Devashish

  • Hi Devashish,

    From the output, I can see that your capture is working fine but the data is not correct.

    I believe this may happen in case you pinmux is not setup correctly.

    You can confirm this by doing a hexdump of the generated file to see if all the bytes are same.

    Also refer to the appnote https://www.ti.com/lit/an/spracd3/spracd3.pdf that may be of help in debugging

    Specially the section 4.1.2 about checking if  pinmux is correct. You can verify if all the data lines are

    toggling or not.

    I used 7yuv tool on the PC to easily visualize the captured frames.

    You may find it useful.

    Regards,

    Nikhil Devshatwar

  • Hi Nikhil,

    I took the hexdump of a capture file and I can see that all bytes are not the same in the output.

    Here's the PINMUX configuration that I am using for the custom board.

    const struct pad_conf_entry core_padconf_array_essential_x15[] = {
    	{GPMC_AD0, (M2 | PIN_INPUT | MANUAL_MODE)},	/* M6 gpmc_ad0.vin3a_d0 */
    	{GPMC_AD1, (M2 | PIN_INPUT | MANUAL_MODE)},	/* M2 gpmc_ad1.vin3a_d1 */
    	{GPMC_AD2, (M2 | PIN_INPUT | MANUAL_MODE)},	/* L5 gpmc_ad2.vin3a_d2 */
    	{GPMC_AD3, (M2 | PIN_INPUT | MANUAL_MODE)},	/* M1 gpmc_ad3.vin3a_d3 */
    	{GPMC_AD4, (M2 | PIN_INPUT | MANUAL_MODE)},	/* L6 gpmc_ad4.vin3a_d4 */
    	{GPMC_AD5, (M2 | PIN_INPUT | MANUAL_MODE)},	/* L4 gpmc_ad5.vin3a_d5 */
    	{GPMC_AD6, (M2 | PIN_INPUT | MANUAL_MODE)},	/* L3 gpmc_ad6.vin3a_d6 */
    	{GPMC_AD7, (M2 | PIN_INPUT | MANUAL_MODE)},	/* L2 gpmc_ad7.vin3a_d7 */
    	{GPMC_AD8, (M2 | PIN_INPUT | MANUAL_MODE)},	/* L1 gpmc_ad8.vin3a_d8 */
    	{GPMC_AD9, (M2 | PIN_INPUT | MANUAL_MODE)},	/* K2 gpmc_ad9.vin3a_d9 */
    	{GPMC_AD10, (M2 | PIN_INPUT | MANUAL_MODE)},	/* J1 gpmc_ad10.vin3a_d10 */
    	{GPMC_A8, (M2 | PIN_INPUT | MANUAL_MODE)},	/* N7 gpmc_a8.vin3a_hsync0 */
    	{GPMC_A9, (M2 | PIN_INPUT | MANUAL_MODE)},	/* R4 gpmc_a9.vin3a_vsync0 */
    	{GPMC_A10, (M2 | PIN_INPUT | MANUAL_MODE)},	/* N9 gpmc_a10.vin3a_de0 */
    	{GPMC_A16, (M14 | PIN_INPUT)},	/* U1 gpmc_a16.gpio2_6 */
    	{GPMC_A19, (M1 | PIN_INPUT_PULLUP)},	/* K7 gpmc_a19.mmc2_dat4 */
    	{GPMC_A20, (M1 | PIN_INPUT_PULLUP)},	/* M7 gpmc_a20.mmc2_dat5 */
    	{GPMC_A21, (M1 | PIN_INPUT_PULLUP)},	/* J5 gpmc_a21.mmc2_dat6 */
    	{GPMC_A22, (M1 | PIN_INPUT_PULLUP)},	/* K6 gpmc_a22.mmc2_dat7 */
    	{GPMC_A23, (M1 | PIN_INPUT_PULLUP)},	/* J7 gpmc_a23.mmc2_clk */
    	{GPMC_A24, (M1 | PIN_INPUT_PULLUP)},	/* J4 gpmc_a24.mmc2_dat0 */
    	{GPMC_A25, (M1 | PIN_INPUT_PULLUP)},	/* J6 gpmc_a25.mmc2_dat1 */
    	{GPMC_A26, (M1 | PIN_INPUT_PULLUP)},	/* H4 gpmc_a26.mmc2_dat2 */
    	{GPMC_A27, (M1 | PIN_INPUT_PULLUP)},	/* H5 gpmc_a27.mmc2_dat3 */
    	{GPMC_CS1, (M1 | PIN_INPUT_PULLUP)},	/* H6 gpmc_cs1.mmc2_cmd */
    	{GPMC_CS3, (M2 | PIN_INPUT | MANUAL_MODE)},	/* P1 gpmc_cs3.vin3a_clk0 */
    	{VIN1A_DE0, (M14 | PIN_INPUT)},	/* AD9 vin1a_de0.gpio3_0 */
    	{VIN1A_FLD0, (M14 | PIN_INPUT)},	/* AF9 vin1a_fld0.gpio3_1 */
    	{VIN1A_D3, (M14 | PIN_INPUT)},	/* AH6 vin1a_d3.gpio3_7 */
    	{VIN1A_D4, (M14 | PIN_INPUT)},	/* AH3 vin1a_d4.gpio3_8 */
    	{VIN1A_D5, (M14 | PIN_INPUT)},	/* AH5 vin1a_d5.gpio3_9 */
    	{VIN1A_D6, (M14 | PIN_INPUT)},	/* AG6 vin1a_d6.gpio3_10 */
    	{VIN1A_D9, (M9 | PIN_INPUT_PULLUP)},	/* AG2 vin1a_d9.kbd_row3 */
    	{VIN1A_D15, (M9 | PIN_OUTPUT)},	/* AF4 vin1a_d15.kbd_col0 */
    	{VIN1A_D17, (M9 | PIN_OUTPUT)},	/* AE3 vin1a_d17.kbd_col2 */
    	{VIN1A_D18, (M9 | PIN_OUTPUT)},	/* AE5 vin1a_d18.kbd_col3 */
    	{VIN2A_VSYNC0, (M10 | PIN_OUTPUT)},	/* G6 vin2a_vsync0.ehrpwm1A */
    	{VIN2A_D2, (M14 | PIN_INPUT)},	/* D1 vin2a_d2.gpio4_3 */
    	{VIN2A_D4, (M14 | PIN_INPUT)},	/* D2 vin2a_d4.gpio4_5 */
    	{VIN2A_D6, (M14 | PIN_INPUT)},	/* C1 vin2a_d6.gpio4_7 */
    	{VIN2A_D8, (M14 | PIN_INPUT)},	/* F5 vin2a_d8.gpio4_9 */
    	{VIN2A_D12, (M3 | PIN_OUTPUT | MANUAL_MODE)},	/* D5 vin2a_d12.rgmii1_txc */
    	{VIN2A_D13, (M3 | PIN_OUTPUT | MANUAL_MODE)},	/* C2 vin2a_d13.rgmii1_txctl */
    	{VIN2A_D14, (M3 | PIN_OUTPUT | MANUAL_MODE)},	/* C3 vin2a_d14.rgmii1_txd3 */
    	{VIN2A_D15, (M3 | PIN_OUTPUT | MANUAL_MODE)},	/* C4 vin2a_d15.rgmii1_txd2 */
    	{VIN2A_D16, (M3 | PIN_OUTPUT | MANUAL_MODE)},	/* B2 vin2a_d16.rgmii1_txd1 */
    	{VIN2A_D17, (M3 | PIN_OUTPUT | MANUAL_MODE)},	/* D6 vin2a_d17.rgmii1_txd0 */
    	{VIN2A_D18, (M3 | PIN_INPUT | MANUAL_MODE)},	/* C5 vin2a_d18.rgmii1_rxc */
    	{VIN2A_D19, (M3 | PIN_INPUT | MANUAL_MODE)},	/* A3 vin2a_d19.rgmii1_rxctl */
    	{VIN2A_D20, (M3 | PIN_INPUT | MANUAL_MODE)},	/* B3 vin2a_d20.rgmii1_rxd3 */
    	{VIN2A_D21, (M3 | PIN_INPUT | MANUAL_MODE)},	/* B4 vin2a_d21.rgmii1_rxd2 */
    	{VIN2A_D22, (M3 | PIN_INPUT | MANUAL_MODE)},	/* B5 vin2a_d22.rgmii1_rxd1 */
    	{VIN2A_D23, (M3 | PIN_INPUT | MANUAL_MODE)},	/* A4 vin2a_d23.rgmii1_rxd0 */
    	{MDIO_MCLK, (M0 | PIN_OUTPUT | SLEWCONTROL)},	/* V1 mdio_mclk.mdio_mclk */
    	{MDIO_D, (M0 | PIN_INPUT | SLEWCONTROL)},	/* U4 mdio_d.mdio_d */
    	{RMII_MHZ_50_CLK, (M14 | PIN_INPUT)},	/* U3 RMII_MHZ_50_CLK.gpio5_17 */
    	{UART3_RXD, (M14 | PIN_INPUT | SLEWCONTROL)},	/* V2 uart3_rxd.gpio5_18 */
    	{RGMII0_TXC, (M0 | PIN_OUTPUT | MANUAL_MODE)},	/* W9 rgmii0_txc.rgmii0_txc */
    	{RGMII0_TXCTL, (M0 | PIN_OUTPUT | MANUAL_MODE)},	/* V9 rgmii0_txctl.rgmii0_txctl */
    	{RGMII0_TXD3, (M0 | PIN_OUTPUT | MANUAL_MODE)},	/* V7 rgmii0_txd3.rgmii0_txd3 */
    	{RGMII0_TXD2, (M0 | PIN_OUTPUT | MANUAL_MODE)},	/* U7 rgmii0_txd2.rgmii0_txd2 */
    	{RGMII0_TXD1, (M0 | PIN_OUTPUT | MANUAL_MODE)},	/* V6 rgmii0_txd1.rgmii0_txd1 */
    	{RGMII0_TXD0, (M0 | PIN_OUTPUT | MANUAL_MODE)},	/* U6 rgmii0_txd0.rgmii0_txd0 */
    	{RGMII0_RXC, (M0 | PIN_INPUT | MANUAL_MODE)},	/* U5 rgmii0_rxc.rgmii0_rxc */
    	{RGMII0_RXCTL, (M0 | PIN_INPUT | MANUAL_MODE)},	/* V5 rgmii0_rxctl.rgmii0_rxctl */
    	{RGMII0_RXD3, (M0 | PIN_INPUT | MANUAL_MODE)},	/* V4 rgmii0_rxd3.rgmii0_rxd3 */
    	{RGMII0_RXD2, (M0 | PIN_INPUT | MANUAL_MODE)},	/* V3 rgmii0_rxd2.rgmii0_rxd2 */
    	{RGMII0_RXD1, (M0 | PIN_INPUT | MANUAL_MODE)},	/* Y2 rgmii0_rxd1.rgmii0_rxd1 */
    	{RGMII0_RXD0, (M0 | PIN_INPUT | MANUAL_MODE)},	/* W2 rgmii0_rxd0.rgmii0_rxd0 */
    	{USB1_DRVVBUS, (M0 | PIN_OUTPUT | SLEWCONTROL)},	/* AB10 usb1_drvvbus.usb1_drvvbus */
    	{USB2_DRVVBUS, (M0 | PIN_OUTPUT_PULLDOWN | SLEWCONTROL)},	/* AC10 usb2_drvvbus.usb2_drvvbus */
    	{XREF_CLK0, (M9 | PIN_OUTPUT_PULLDOWN)},	/* D18 xref_clk0.clkout2 */
    	{XREF_CLK1, (M14 | PIN_INPUT)},	/* E17 xref_clk1.gpio6_18 */
    	{MCASP1_ACLKX, (M10 | PIN_INPUT_PULLUP)},	/* C14 mcasp1_aclkx.i2c3_sda */
    	{MCASP1_FSX, (M10 | PIN_INPUT_PULLUP | SLEWCONTROL)},	/* D14 mcasp1_fsx.i2c3_scl */
    	{MCASP1_ACLKR, (M10 | PIN_INPUT)},	/* B14 mcasp1_aclkr.i2c4_sda */
    	{MCASP1_FSR, (M14 | PIN_INPUT)},	/* J14 mcasp1_fsr.gpio5_1 */
    	{MCASP1_AXR7, (M14 | PIN_INPUT)},	/* D12 mcasp1_axr7.gpio5_9 */
    	{MCASP1_AXR8, (M14 | PIN_INPUT | SLEWCONTROL)},	/* B12 mcasp1_axr8.gpio5_10 */
    	{MCASP1_AXR9, (M14 | PIN_INPUT | SLEWCONTROL)},	/* A11 mcasp1_axr9.gpio5_11 */
    	{MCASP1_AXR10, (M14 | PIN_INPUT | SLEWCONTROL)},	/* B13 mcasp1_axr10.gpio5_12 */
    	{MCASP2_AXR2, (M1 | PIN_INPUT | SLEWCONTROL)},	/* C15 mcasp2_axr2.mcasp3_axr2 */
    	{MCASP2_AXR3, (M1 | PIN_INPUT | SLEWCONTROL)},	/* A16 mcasp2_axr3.mcasp3_axr3 */
    	{MCASP2_AXR7, (M14 | PIN_INPUT)},	/* A17 mcasp2_axr7.gpio1_5 */
    	{MCASP3_ACLKX, (M0 | PIN_INPUT)},	/* B18 mcasp3_aclkx.mcasp3_aclkx */
    	{MCASP3_FSX, (M0 | PIN_INPUT | SLEWCONTROL)},	/* F15 mcasp3_fsx.mcasp3_fsx */
    	{MCASP3_AXR0, (M0 | PIN_INPUT | SLEWCONTROL)},	/* B19 mcasp3_axr0.mcasp3_axr0 */
    	{MCASP3_AXR1, (M0 | PIN_INPUT | SLEWCONTROL)},	/* C17 mcasp3_axr1.mcasp3_axr1 */
    	{MCASP4_FSX, (M4 | PIN_INPUT)},	/* A21 mcasp4_fsx.i2c4_scl */
    	{MCASP5_ACLKX, (M4 | PIN_INPUT_PULLUP)},	/* AA3 mcasp5_aclkx.i2c5_sda */
    	{MCASP5_FSX, (M4 | PIN_INPUT_PULLUP)},	/* AB9 mcasp5_fsx.i2c5_scl */
    	{MMC1_CLK, (M0 | PIN_INPUT_PULLUP)},	/* W6 mmc1_clk.mmc1_clk */
    	{MMC1_CMD, (M0 | PIN_INPUT_PULLUP)},	/* Y6 mmc1_cmd.mmc1_cmd */
    	{MMC1_DAT0, (M0 | PIN_INPUT_PULLUP)},	/* AA6 mmc1_dat0.mmc1_dat0 */
    	{MMC1_DAT1, (M0 | PIN_INPUT_PULLUP)},	/* Y4 mmc1_dat1.mmc1_dat1 */
    	{MMC1_DAT2, (M0 | PIN_INPUT_PULLUP)},	/* AA5 mmc1_dat2.mmc1_dat2 */
    	{MMC1_DAT3, (M0 | PIN_INPUT_PULLUP)},	/* Y3 mmc1_dat3.mmc1_dat3 */
    	{MMC1_SDCD, (M0 | PIN_INPUT_PULLUP | SLEWCONTROL)},	/* W7 mmc1_sdcd.mmc1_sdcd */
    	{MMC3_CMD, (M10 | PIN_INPUT)},	/* AC4 mmc3_cmd.eCAP2_in_PWM2_out */
    	{SPI1_D1, (M14 | PIN_INPUT)},	/* F16 spi1_d1.gpio7_8 */
    	{SPI1_CS1, (M14 | PIN_INPUT)},	/* A22 spi1_cs1.gpio7_11 */
    	{SPI1_CS2, (M14 | PIN_INPUT | SLEWCONTROL)},	/* B21 spi1_cs2.gpio7_12 */
    	{SPI1_CS3, (M14 | PIN_INPUT | SLEWCONTROL)},	/* B20 spi1_cs3.gpio7_13 */
    	{SPI2_SCLK, (M14 | PIN_INPUT)},	/* A26 spi2_sclk.gpio7_14 */
    	{SPI2_D1, (M14 | PIN_INPUT | SLEWCONTROL)},	/* B22 spi2_d1.gpio7_15 */
    	{SPI2_D0, (M14 | PIN_INPUT | SLEWCONTROL)},	/* G17 spi2_d0.gpio7_16 */
    	{SPI2_CS0, (M14 | PIN_INPUT | SLEWCONTROL)},	/* B24 spi2_cs0.gpio7_17 */
    	{DCAN1_TX, (M14 | PIN_INPUT | SLEWCONTROL)},	/* G20 dcan1_tx.gpio1_14 */
    	{UART1_RXD, (M0 | PIN_INPUT_PULLUP | SLEWCONTROL)},	/* B27 uart1_rxd.uart1_rxd */
    	{UART1_TXD, (M0 | PIN_OUTPUT | SLEWCONTROL)},	/* C26 uart1_txd.uart1_txd */
    	{UART1_CTSN, (M14 | PIN_INPUT)},	/* E25 uart1_ctsn.gpio7_24 */
    	{UART1_RTSN, (M14 | PIN_INPUT)},	/* C27 uart1_rtsn.gpio7_25 */
    	{UART2_CTSN, (M2 | PIN_INPUT)},	/* D27 uart2_ctsn.uart3_rxd */
    	{UART2_RTSN, (M1 | PIN_OUTPUT)},	/* C28 uart2_rtsn.uart3_txd */
    	{I2C1_SDA, (M0 | PIN_INPUT_PULLUP)},	/* C21 i2c1_sda.i2c1_sda */
    	{I2C1_SCL, (M0 | PIN_INPUT_PULLUP)},	/* C20 i2c1_scl.i2c1_scl */
    	{I2C2_SDA, (M0 | PIN_INPUT_PULLUP)},	/* C25 i2c2_sda.i2c2_sda */
    	{I2C2_SCL, (M0 | PIN_INPUT_PULLUP)},	/* F17 i2c2_scl.i2c2_scl */
    	{WAKEUP0, (M0 | PIN_INPUT)},	/* AD17 Wakeup0.Wakeup0 */
    	{WAKEUP3, (M0 | PIN_INPUT)},	/* AC16 Wakeup3.Wakeup3 */
    	{ON_OFF, (M0 | PIN_OUTPUT)},	/* Y11 on_off.on_off */
    	{RTC_PORZ, (M0 | PIN_INPUT)},	/* AB17 rtc_porz.rtc_porz */
    	{TMS, (M0 | PIN_INPUT_PULLUP)},	/* F18 tms.tms */
    	{TDI, (M0 | PIN_INPUT_PULLUP | SLEWCONTROL)},	/* D23 tdi.tdi */
    	{TDO, (M0 | PIN_OUTPUT)},	/* F19 tdo.tdo */
    	{TCLK, (M0 | PIN_INPUT_PULLDOWN)},	/* E20 tclk.tclk */
    	{TRSTN, (M0 | PIN_INPUT)},	/* D20 trstn.trstn */
    	{RTCK, (M0 | PIN_OUTPUT)},	/* E18 rtck.rtck */
    	{EMU0, (M0 | PIN_INPUT)},	/* G21 emu0.emu0 */
    	{EMU1, (M0 | PIN_INPUT)},	/* D24 emu1.emu1 */
    	{RESETN, (M0 | PIN_INPUT)},	/* E23 resetn.resetn */
    	{NMIN_DSP, (M0 | PIN_INPUT)},	/* D21 nmin_dsp.nmin_dsp */
    	{RSTOUTN, (M0 | PIN_OUTPUT)},	/* F23 rstoutn.rstoutn */
    };
    
    const struct pad_conf_entry core_padconf_array_delta_x15_sr2_0[] = {
    	{VOUT1_CLK, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* D11 vout1_clk.vout1_clk */
    	{VOUT1_DE, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* B10 vout1_de.vout1_de */
    	{VOUT1_HSYNC, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* C11 vout1_hsync.vout1_hsync */
    	{VOUT1_VSYNC, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* E11 vout1_vsync.vout1_vsync */
    	{VOUT1_D0, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* F11 vout1_d0.vout1_d0 */
    	{VOUT1_D1, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* G10 vout1_d1.vout1_d1 */
    	{VOUT1_D2, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* F10 vout1_d2.vout1_d2 */
    	{VOUT1_D3, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* G11 vout1_d3.vout1_d3 */
    	{VOUT1_D4, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* E9 vout1_d4.vout1_d4 */
    	{VOUT1_D5, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* F9 vout1_d5.vout1_d5 */
    	{VOUT1_D6, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* F8 vout1_d6.vout1_d6 */
    	{VOUT1_D7, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* E7 vout1_d7.vout1_d7 */
    	{VOUT1_D8, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* E8 vout1_d8.vout1_d8 */
    	{VOUT1_D9, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* D9 vout1_d9.vout1_d9 */
    	{VOUT1_D10, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* D7 vout1_d10.vout1_d10 */
    	{VOUT1_D11, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* D8 vout1_d11.vout1_d11 */
    	{VOUT1_D12, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* A5 vout1_d12.vout1_d12 */
    	{VOUT1_D13, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* C6 vout1_d13.vout1_d13 */
    	{VOUT1_D14, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* C8 vout1_d14.vout1_d14 */
    	{VOUT1_D15, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* C7 vout1_d15.vout1_d15 */
    	{VOUT1_D16, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* B7 vout1_d16.vout1_d16 */
    	{VOUT1_D17, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* B8 vout1_d17.vout1_d17 */
    	{VOUT1_D18, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* A7 vout1_d18.vout1_d18 */
    	{VOUT1_D19, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* A8 vout1_d19.vout1_d19 */
    	{VOUT1_D20, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* C9 vout1_d20.vout1_d20 */
    	{VOUT1_D21, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* A9 vout1_d21.vout1_d21 */
    	{VOUT1_D22, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* B9 vout1_d22.vout1_d22 */
    	{VOUT1_D23, (M0 | PIN_OUTPUT | SLEWCONTROL | MANUAL_MODE)},	/* A10 vout1_d23.vout1_d23 */
    };
    
    
    /* iodelay */
    
    const struct iodelay_cfg_entry iodelay_cfg_array_x15_sr2_0[] = {
    	{0x0120, 2435, 411},	/* CFG_GPMC_A10_IN */
    	{0x024C, 2430, 656},	/* CFG_GPMC_A8_IN */
    	{0x0258, 2465, 850},	/* CFG_GPMC_A9_IN */
    	{0x0264, 2316, 301},	/* CFG_GPMC_AD0_IN */
    	{0x0270, 2324, 406},	/* CFG_GPMC_AD10_IN */
    	{0x02B8, 2440, 70},	/* CFG_GPMC_AD1_IN */
    	{0x02C4, 2404, 446},	/* CFG_GPMC_AD2_IN */
    	{0x02D0, 2343, 212},	/* CFG_GPMC_AD3_IN */
    	{0x02DC, 2355, 322},	/* CFG_GPMC_AD4_IN */
    	{0x02E8, 2337, 192},	/* CFG_GPMC_AD5_IN */
    	{0x02F4, 2270, 314},	/* CFG_GPMC_AD6_IN */
    	{0x0300, 2339, 259},	/* CFG_GPMC_AD7_IN */
    	{0x030C, 2308, 577},	/* CFG_GPMC_AD8_IN */
    	{0x0318, 2334, 166},	/* CFG_GPMC_AD9_IN */
    	{0x0378, 0, 0},	/* CFG_GPMC_CS3_IN */
    	{0x06F0, 260, 0},	/* CFG_RGMII0_RXC_IN */
    	{0x06FC, 0, 1412},	/* CFG_RGMII0_RXCTL_IN */
    	{0x0708, 123, 1047},	/* CFG_RGMII0_RXD0_IN */
    	{0x0714, 139, 1081},	/* CFG_RGMII0_RXD1_IN */
    	{0x0720, 195, 1100},	/* CFG_RGMII0_RXD2_IN */
    	{0x072C, 239, 1216},	/* CFG_RGMII0_RXD3_IN */
    	{0x0740, 89, 0},	/* CFG_RGMII0_TXC_OUT */
    	{0x074C, 15, 125},	/* CFG_RGMII0_TXCTL_OUT */
    	{0x0758, 339, 162},	/* CFG_RGMII0_TXD0_OUT */
    	{0x0764, 146, 94},	/* CFG_RGMII0_TXD1_OUT */
    	{0x0770, 0, 27},	/* CFG_RGMII0_TXD2_OUT */
    	{0x077C, 291, 205},	/* CFG_RGMII0_TXD3_OUT */
    	{0x0A70, 0, 0},	/* CFG_VIN2A_D12_OUT */
    	{0x0A7C, 219, 101},	/* CFG_VIN2A_D13_OUT */
    	{0x0A88, 92, 58},	/* CFG_VIN2A_D14_OUT */
    	{0x0A94, 135, 100},	/* CFG_VIN2A_D15_OUT */
    	{0x0AA0, 154, 101},	/* CFG_VIN2A_D16_OUT */
    	{0x0AAC, 78, 27},	/* CFG_VIN2A_D17_OUT */
    	{0x0AB0, 411, 0},	/* CFG_VIN2A_D18_IN */
    	{0x0ABC, 0, 382},	/* CFG_VIN2A_D19_IN */
    	{0x0AD4, 320, 750},	/* CFG_VIN2A_D20_IN */
    	{0x0AE0, 192, 836},	/* CFG_VIN2A_D21_IN */
    	{0x0AEC, 294, 669},	/* CFG_VIN2A_D22_IN */
    	{0x0AF8, 50, 700},	/* CFG_VIN2A_D23_IN */
    	{0x0B9C, 0, 706},	/* CFG_VOUT1_CLK_OUT */
    	{0x0BA8, 2313, 0},	/* CFG_VOUT1_D0_OUT */
    	{0x0BB4, 2199, 0},	/* CFG_VOUT1_D10_OUT */
    	{0x0BC0, 2266, 0},	/* CFG_VOUT1_D11_OUT */
    	{0x0BCC, 3159, 0},	/* CFG_VOUT1_D12_OUT */
    	{0x0BD8, 2100, 0},	/* CFG_VOUT1_D13_OUT */
    	{0x0BE4, 2229, 0},	/* CFG_VOUT1_D14_OUT */
    	{0x0BF0, 2202, 0},	/* CFG_VOUT1_D15_OUT */
    	{0x0BFC, 2084, 0},	/* CFG_VOUT1_D16_OUT */
    	{0x0C08, 2195, 0},	/* CFG_VOUT1_D17_OUT */
    	{0x0C14, 2342, 0},	/* CFG_VOUT1_D18_OUT */
    	{0x0C20, 2463, 0},	/* CFG_VOUT1_D19_OUT */
    	{0x0C2C, 2439, 0},	/* CFG_VOUT1_D1_OUT */
    	{0x0C38, 2304, 0},	/* CFG_VOUT1_D20_OUT */
    	{0x0C44, 2103, 0},	/* CFG_VOUT1_D21_OUT */
    	{0x0C50, 2145, 0},	/* CFG_VOUT1_D22_OUT */
    	{0x0C5C, 1932, 0},	/* CFG_VOUT1_D23_OUT */
    	{0x0C68, 2200, 0},	/* CFG_VOUT1_D2_OUT */
    	{0x0C74, 2355, 0},	/* CFG_VOUT1_D3_OUT */
    	{0x0C80, 3215, 0},	/* CFG_VOUT1_D4_OUT */
    	{0x0C8C, 2314, 0},	/* CFG_VOUT1_D5_OUT */
    	{0x0C98, 2238, 0},	/* CFG_VOUT1_D6_OUT */
    	{0x0CA4, 2381, 0},	/* CFG_VOUT1_D7_OUT */
    	{0x0CB0, 2138, 0},	/* CFG_VOUT1_D8_OUT */
    	{0x0CBC, 2383, 0},	/* CFG_VOUT1_D9_OUT */
    	{0x0CC8, 1984, 0},	/* CFG_VOUT1_DE_OUT */
    	{0x0CE0, 1947, 0},	/* CFG_VOUT1_HSYNC_OUT */
    	{0x0CEC, 2739, 0},	/* CFG_VOUT1_VSYNC_OUT */
    };

    I stumbled upon this app note (https://www.ti.com/lit/an/spracd3/spracd3.pdf) earlier and I ran iodelay-config utility on host/PC to generate vin3a-probe.sh script.  

    While running vin3a-probe.sh on the custom board. I could see that data lines are not toggling.

    But then I also ran this same script on the TI AM5728 EVM and I got the same output. The data lines are not toggling even on EVM. The capture, however, works on AM5728 EVM. Note that the camera module on AM5728 EVM is different (OV10635).

    I also tried to run a capture and then probe the data lines simultaneously but still got nothing on the custom board and EVM. I am attaching the script and its output below.

    ###########################################
    # Read VIN3A signals using GPIO sysfs
    ###########################################
    
    VIN3A_data=(
            CLK0:0x4a0034e0:GPIO2_31:63:0x48055138:31
            D0:0x4a003534:GPIO3_20:84:0x48057138:20
            D1:0x4a003538:GPIO3_21:85:0x48057138:21
            D2:0x4a00353c:GPIO3_22:86:0x48057138:22
            D3:0x4a003540:GPIO3_23:87:0x48057138:23
            D4:0x4a003544:GPIO3_24:88:0x48057138:24
            D5:0x4a003548:GPIO3_25:89:0x48057138:25
            D6:0x4a00354c:GPIO3_26:90:0x48057138:26
            D7:0x4a003550:GPIO3_27:91:0x48057138:27
            HSYNC0:0x4a0035c0:GPIO4_30:126:0x48059138:30
            VSYNC0:0x4a0035c4:GPIO4_31:127:0x48059138:31
    )
    
    echo; echo Probing VIN3A signals
    
    for data in ${VIN3A_data[@]}
    do
        pin=`echo $data | cut -d ':' -f1`
        pad=`echo $data | cut -d ':' -f2`
        ngpio=`echo $data | cut -d ':' -f4`
        echo $ngpio > /sys/class/gpio/export 2>/dev/null
        omapconf set bit $pad 18 1>/dev/null 2>/dev/null
        printf "%8s" $pin
    done
    echo
    
    while true;
    do
        for data in ${VIN3A_data[@]}
        do
    #       pin=`echo $data | cut -d ':' -f1`
    #        pad=`echo $data | cut -d ':' -f2`
    #       gpio=`echo $data | cut -d ':' -f3`
            ngpio=`echo $data | cut -d ':' -f4`
    #       addr=`echo $data | cut -d ':' -f5`
    #       bit=`echo $data | cut -d ':' -f6`
            val=`cat /sys/class/gpio/gpio$ngpio/value`
            printf %8d $val
        done
        echo
    done
    

    root@am57xx-evm:~# ./vin3a-probe.sh 
    
    Probing VIN3A signals
        CLK0      D0      D1      D2      D3      D4      D5      D6      D7  HSYNC0  VSYNC0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
           0       0       0       0       0       0       0       0       0       0       0
    

    Also, I would like to update you that I have changed data-shift to <0> from <2> after discussing with my hardware counterpart, in case it matters.

    Regards,

    Devashish

  • Hi ,

    I would like to update you on the new observations. The script I was running earlier did not have the correct values of GPIO and pad addresses. On changing, the values of GPIO, I could now see that the data lines are toggling whenever I start a capture.

    The script I am running is as follows -

    ###########################################
    # Read VIN3A signals using GPIO sysfs
    ###########################################
    
    VIN3A_data=(
            CLK0:0x4a0034bc:GPIO2_21:53:0x48055138:31
            D0:0x4a003400:GPIO1_6:6:0x48057138:20
            D1:0x4a003404:GPIO1_7:7:0x48057138:21
            D2:0x4a003408:GPIO1_8:8:0x48057138:22
            D3:0x4a00340c:GPIO1_9:9:0x48057138:23
            D4:0x4a003410:GPIO1_10:10:0x48057138:24
            D5:0x4a003414:GPIO1_11:11:0x48057138:25
            D6:0x4a003418:GPIO1_12:12:0x48057138:26
            D7:0x4a00341c:GPIO1_13:13:0x48057138:27
            HSYNC0:0x4a003460:GPIO1_30:30:0x48059138:30
            VSYNC0:0x4a003464:GPIO1_31:31:0x48059138:31
    )
    
    
    
    echo; echo Probing VIN3A signals
    
    for data in ${VIN3A_data[@]}
    do
        pin=`echo $data | cut -d ':' -f1`
        pad=`echo $data | cut -d ':' -f2`
        ngpio=`echo $data | cut -d ':' -f4`
        echo $ngpio > /sys/class/gpio/export 2>/dev/null
        omapconf set bit $pad 18 1>/dev/null 2>/dev/null
        printf "%8s" $pin
    done
    echo
    
    while true;
    do
        for data in ${VIN3A_data[@]}
        do
    #       pin=`echo $data | cut -d ':' -f1`
    #        pad=`echo $data | cut -d ':' -f2`
    #       gpio=`echo $data | cut -d ':' -f3`
            ngpio=`echo $data | cut -d ':' -f4`
    #       addr=`echo $data | cut -d ':' -f5`
    #       bit=`echo $data | cut -d ':' -f6`
            val=`cat /sys/class/gpio/gpio$ngpio/value`
            printf %8d $val
        done
        echo
    done
    

    OBSERVATIONS -

    1. Running the script when capture is not started -

    root@am57xx-evm:~# ./vin3a-probe.sh
    
    Probing VIN3A signals
        CLK0      D0      D1      D2      D3      D4      D5      D6      D7  HSYNC0  VSYNC0
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
           1       1       1       1       1       1       1       1       1       1       1
    

    2. Running the script while capturing -

    root@am57xx-evm:~# ./vin3a-probe.sh
    
    Probing VIN3A signals
        CLK0      D0      D1      D2      D3      D4      D5      D6      D7  HSYNC0  VSYNC0
           0       1       1       1       1       1       1       1       1       1       0
           1       1       1       1       1       1       1       1       1       1       0
           1       1       1       1       1       1       1       1       1       1       0
           0       1       1       1       1       1       1       1       1       1       0
           1       1       1       1       1       0       0       0       0       0       0
           0       0       1       0       1       0       0       0       0       1       0
           1       0       0       0       0       0       0       0       0       1       0
           1       1       0       0       0       1       1       0       0       1       0
           0       0       0       0       0       0       0       0       0       1       0
           1       1       1       1       1       1       1       1       1       0       0
           0       1       1       1       1       1       1       1       1       1       0
           0       1       1       1       1       1       1       1       1       0       0
           0       1       1       1       1       1       1       1       1       1       0
           0       1       1       1       1       1       1       1       1       1       0
           0       1       1       0       1       0       1       0       0       0       0
           0       0       0       0       0       0       0       0       0       1       0
           1       0       0       0       0       0       0       0       0       1       0
           0       1       1       0       0       0       0       0       0       1       0
           0       0       0       0       0       0       0       0       0       1       0
           1       1       1       1       1       1       1       1       1       1       0
           1       1       1       1       1       1       1       1       1       1       0
           1       1       1       1       1       1       1       1       1       1       0
           0       1       1       1       1       1       1       1       1       1       0
           0       1       1       1       1       1       1       0       0       1       0
           1       0       1       0       0       1       0       0       0       1       0
           1       0       0       0       0       0       0       0       0       1       0
           1       1       0       0       0       0       0       0       0       1       0
           0       0       0       0       0       0       0       0       0       1       0
           0       0       0       0       1       1       1       1       1       1       0
           1       1       1       1       1       1       1       1       1       1       0
           1       1       1       1       1       1       1       1       1       0       0
           1       1       1       1       1       1       1       1       1       1       0
           1       1       1       1       1       1       1       1       1       1       0
           0       1       0       1       1       1       0       0       0       1       0
           1       0       0       0       0       0       0       0       0       1       0
           1       0       0       0       0       1       1       0       0       1       0
           0       0       1       0       1       0       0       0       0       1       0
           0       0       0       0       0       0       0       0       0       1       0
           0       1       1       1       1       1       1       1       1       1       0
           0       1       1       1       1       1       1       1       1       1       0
           1       1       1       1       1       1       1       1       1       1       0
           0       1       1       1       1       1       1       1       1       1       0
    


    Please note that I am using the following values of control line polarities in device tree entries on the custom board.

    hsync-active = <1>;
    vsync-active = <1>;
    pclk-sample = <1>; 

    Since the data lines are toggling, I am hoping there is no issue with the PINMUX configuration.

    However, I am still not able to get the correct capture from the camera. 

    Regards,

    Devashish

  • Hello,

    This is a gentle reminder that your reply is awaited on this post.

    Regards,

    Devashish

  • Hi Devashish,

    I'm in exactly the same situation here...trying to get OV5640 to work with AM5728. Let me know if you found the solution.

  • Hi Nikhil,

    I would like to update you about the progress with the camera module on the TI AM5728 based custom board

    I am now able to get the preview from the camera and can display it on LCD. 

    I am using dmabuftest (https://git.ti.com/cgit/glsdk/omapdrmtest) to display camera preview on LCD. I am using following command -
    dmabuftest -s 54:1024x600 -d /dev/video1 -c 1280x720@YUYV

    The LCD resolution is 1024x600. I have attached a video recording from the phone of the same. I now have following queries -
     
    1. Due to space constraints, the camera module is placed at a physical orientation of 90 degree counterclockwise on our board. Therefore, the preview is also rotated by 90 degrees during capture. The OV5640 datasheet does not support degree rotation. It only supports 0 degree and 180 degree rotation. Is it possible to rotate the camera preview by 90 degree from SoC side?
    2. The camera preview is coming only in half of the LCD screen at 1280x720 resolution. And the image seen in preview is not complete but stretched. What timing register settings (HTS, VTS) can be used to resolve this issue?
    3. Also while using camera with lower resolution (640x480), same issue is observed. The image is displayed only on half of the screen. Also, some horizontal lines are seen in the preview. How to resolve this?
    Kindly acknowledge and revert.
    Regards,
    Devashish