We are working on DM8168 EVM (Netra) based custom board.
Custom setup is as said below:
We have DM8168 processor video ports connected to FPGA logic, where FPGA will take 1080i-60 embedded sync data (BT.1120) from DM8168 for transmitting and gives 1080i-60 embedded sync data (BT.1120) to DM8168 while receiving with 16-bit lines.
Following are the settings done while execution:
-
Ti81xxvin.ko is built with removing all the sub-device part removed as we are not using any decoder (TVP).
Modified source codes is attached: ti81xx_fb.c & ti81xxvin_main.c (all modifications are tagged with /* SADA */ )
-
Ti81xxhdmi.ko is not installed as we are not using on-chip HDMI.
-
Custom board booted with following boot arg.
“notifyk.vpssm3_sva=0xBF900000”
-
Following “load-hd-firmware.sh” used for loading the Video modules
#!/bin/sh
#
# manage HDVICP2 and HDVPSS Engine firmware
PATH=$PATH:/usr/share/ti/ti-media-controller-utils
HDVICP2_ID=1
HDVPSS_ID=2
case "$1" in
start)
echo "Loading HDVICP2 Firmware"
prcm_config_app s
modprobe syslink
until [[ -e /dev/syslinkipc_ProcMgr && -e /dev/syslinkipc_ClientNotifyMgr ]]
do
sleep 0.5
done
firmware_loader $HDVICP2_ID /usr/share/ti/ti-media-controller-utils/dm816x_hdvicp.xem3 start
echo "Loading HDVPSS Firmware"
firmware_loader $HDVPSS_ID /usr/share/ti/ti-media-controller-utils/dm816x_hdvpss.xem3 start
modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:1080i-60,dvo2:1080i-60,hdcomp:1080i-60 i2c_mode=1
modprobe ti81xxfb vram=0:24M,1:16M,2:6M
fbset -depth 32 -rgba 8/16,8/8,8/0,0/0
modprobe ti81xxvo
modprobe ti81xxvin
;;
stop)
echo "Unloading HDVICP2 Firmware"
firmware_loader $HDVICP2_ID /usr/share/ti/ti-media-controller-utils/dm816x_hdvicp.xem3 stop
echo "Unloading HDVPSS Firmware"
rmmod ti81xxvin
rmmod ti81xxvo
rmmod ti81xxfb
rmmod vpss
firmware_loader $HDVPSS_ID /usr/share/ti/ti-media-controller-utils/dm816x_hdvpss.xem3 stop
rmmod syslink
;;
*)
echo "Usage: /etc/init.d/load-hd-firmware.sh {start|stop}"
exit 1
;;
esac
exit 0
-
Following sysfs settings are done for displaying (on vout0 port).
echo 0 > /sys/devices/platform/vpss/display1/enabled
echo 1080i-60 > /sys/devices/platform/vpss/display1/mode
echo double,yuv422spuv > /sys/devices/platform/vpss/display1/output
echo 1 > /sys/devices/platform/vpss/display1/enabled
Directing display to DVO2:
echo 0 > /sys/devices/platform/vpss/graphics0/enabled
echo 1:dvo2 > /sys/devices/platform/vpss/graphics0/nodes
echo 1 > /sys/devices/platform/vpss/graphics0/enabled
-
Following omx utility is used for capturing, built with 1080i-60 support modifications.
./capture_encode_a8host_debug.xv5T –o capture1.h264 –m 1080i –f 60 –b 1000000 –d 0 –n 50
Below are the Queries/issues that we are facing in this setup:
-
Display video output to FPGA logic:
For embedded Sync transmission:
A synchronization packet occurs immediately before the first active sample on every line, and immediately after the last active sample (and before the start of the horizontal blanking region). The synchronization packet consists of four 10-bit words. The first three words are always the same--0x3FF, 0, 0; the fourth consists of 3 flag bits, along with an error correcting code. As a result, there are 8 different synchronization packets possible.
Issue:
Sometimes we are getting FFFF, AC8F, 0000, and flag instead of FFFF, 0000, 0000 and flag. (Data seen at FPGA signal tapping)
Is there any configuration problem that missing for BT.1120, 1080i-60 embedded sync transmission? Please let me know. I didn’t change any source codes for video output path.
-
Capture video input from FPGA logic:
When I use above said omx utility following are the issues:
1. I am not able to capture more the 100 frames.
2. Capture video is not proper.
File is attached for your reference: capture1.h264
Please answer/suggest for my queries ASAP, this is a major blocker for our development.
Thanks & Regards
/* * * Framebuffer device registration for TI TI816x platforms * * Copyright (C) 2009 Texas Instruments Inc. * Author: Yihe Hu <yihehu@ti.com> * * Some code and ideas taken from TI OMAP2 Platforms * by Tomi Valkeinen. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/bootmem.h> #include <linux/io.h> #include <linux/vps_capture.h> #include <linux/ti81xxfb.h> #include <linux/ti81xx.h> #include <mach/hardware.h> #include <mach/board-ti814x.h> #include <mach/board-ti816x.h> #include <asm/mach/map.h> #if (defined(CONFIG_FB_TI81XX) || defined(CONFIG_FB_TI81XX_MODULE) || \ defined(CONFIG_ARCH_TI81XX)) #define HDVPSS_CAPTURE_INST0_BASE 0x48105500 #define HDVPSS_CAPTURE_INST0_SIZE 1024u #define HDVPSS_CAPTURE_INST2_BASE 0x48105A00 #define HDVPSS_CAPTURE_INST2_SIZE 1024u u8 ti81xx_card_name[] = "TI81xx_catalogue"; struct ti81xxvin_interface tvp7002_pdata = { .clk_polarity = 0, .hs_polarity = 0, .vs_polarity = 1, .fid_polarity = 0, .sog_polarity = 0, }; static struct ti81xxvin_subdev_info hdvpss_capture_sdev_info[] = { { .name = TVP7002_INST0, .board_info = { /* TODO Find the correct address of the TVP7002 connected */ #if 0 /* SADA */ I2C_BOARD_INFO("tvp7002", 0x5d), .platform_data = &tvp7002_pdata, #endif }, .vip_port_cfg = { .ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_15_8, .ancChSel8b = VPS_VIP_ANC_CH_SEL_DONT_CARE, .pixClkEdgePol = VPS_VIP_PIX_CLK_EDGE_POL_FALLING, .invertFidPol = 0, .embConfig = { .errCorrEnable = 1, .srcNumPos = VPS_VIP_SRC_NUM_POS_DONT_CARE, .isMaxChan3Bits = 0, }, .disConfig = { .fidSkewPostCnt = 0, .fidSkewPreCnt = 0, .lineCaptureStyle = VPS_VIP_LINE_CAPTURE_STYLE_DONT_CARE, .fidDetectMode = VPS_VIP_FID_DETECT_MODE_DONT_CARE, .actvidPol = VPS_VIP_POLARITY_DONT_CARE, .vsyncPol = VPS_VIP_POLARITY_DONT_CARE, .hsyncPol = VPS_VIP_POLARITY_DONT_CARE, } }, .video_capture_mode = VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC, .video_if_mode = VPS_CAPT_VIDEO_IF_MODE_16BIT, .input_data_format = FVID2_DF_YUV422P, }, { .name = TVP7002_INST1, .board_info = { #if 0 /* SADA */ I2C_BOARD_INFO("tvp7002", 0x5c), .platform_data = &tvp7002_pdata, #endif }, .vip_port_cfg = { .ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_15_8, .ancChSel8b = VPS_VIP_ANC_CH_SEL_DONT_CARE, .pixClkEdgePol = VPS_VIP_PIX_CLK_EDGE_POL_RISING, .invertFidPol = 0, .embConfig = { .errCorrEnable = 1, .srcNumPos = VPS_VIP_SRC_NUM_POS_DONT_CARE, .isMaxChan3Bits = 0, }, .disConfig = { .fidSkewPostCnt = 0, .fidSkewPreCnt = 0, .lineCaptureStyle = VPS_VIP_LINE_CAPTURE_STYLE_DONT_CARE, .fidDetectMode = VPS_VIP_FID_DETECT_MODE_DONT_CARE, .actvidPol = VPS_VIP_POLARITY_DONT_CARE, .vsyncPol = VPS_VIP_POLARITY_DONT_CARE, .hsyncPol = VPS_VIP_POLARITY_DONT_CARE, } }, .video_capture_mode = VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC, .video_if_mode = VPS_CAPT_VIDEO_IF_MODE_16BIT, .input_data_format = FVID2_DF_YUV422P, }, }; static const struct v4l2_dv_preset hdvpss_inst0_inp0_presets[] = { { .preset = V4L2_DV_720P60, }, { .preset = V4L2_DV_1080I60, }, { .preset = V4L2_DV_1080P60, }, { .preset = V4L2_DV_1080P30, }, }; static const struct v4l2_dv_preset hdvpss_inst2_inp0_presets[] = { { .preset = V4L2_DV_720P60, }, { .preset = V4L2_DV_1080I60, }, { .preset = V4L2_DV_1080P60, }, { .preset = V4L2_DV_1080P30, }, }; static const struct ti81xxvin_input hdvpss_inst0_inputs[] = { { .input = { .index = 0, .name = "Component", .type = V4L2_INPUT_TYPE_CAMERA, .std = V4L2_STD_UNKNOWN, .capabilities = V4L2_OUT_CAP_PRESETS, }, #if 0 /* SADA */ .subdev_name = TVP7002_INST0, #endif .dv_presets = hdvpss_inst0_inp0_presets, .num_dv_presets = ARRAY_SIZE(hdvpss_inst0_inp0_presets), }, }; static const struct ti81xxvin_input hdvpss_inst1_inputs[] = { { .input = { .index = 0, .name = "Component", .type = V4L2_INPUT_TYPE_CAMERA, .std = V4L2_STD_UNKNOWN, .capabilities = V4L2_OUT_CAP_PRESETS, }, #if 0 /* SADA */ .subdev_name = TVP7002_INST1, #endif .dv_presets = hdvpss_inst2_inp0_presets, .num_dv_presets = ARRAY_SIZE(hdvpss_inst2_inp0_presets), }, }; /* 16 bit decoders are present on the Port A of VIP0 and VIP1 instances. Which represents the VIP0 and VIP2 instances in software. While Port B of VIP0 and VIP1 are represented by VIP1 and VIP3 instances. On these two instances no decoders are present. */ static struct ti81xxvin_config ti81xx_hsvpss_capture_cfg = { .subdev_info = hdvpss_capture_sdev_info, .subdev_count = 0, // .subdev_count = ARRAY_SIZE(hdvpss_capture_sdev_info), /* SADA */ .card_name = ti81xx_card_name, .inst_config[0] = { .inputs = hdvpss_inst0_inputs, .input_count = ARRAY_SIZE(hdvpss_inst0_inputs), }, .inst_config[1] = { .inputs = hdvpss_inst0_inputs, .input_count = 0, }, .inst_config[2] = { .inputs = hdvpss_inst1_inputs, .input_count = ARRAY_SIZE(hdvpss_inst1_inputs), }, .inst_config[3] = { .inputs = hdvpss_inst1_inputs, .input_count = 0, }, }; static u64 ti81xx_fb_dma_mask = ~(u32)0; static struct ti81xxfb_platform_data ti81xxfb_config; static struct resource ti81xx_hdvpss_resource[] = { [0] = { .start = HDVPSS_CAPTURE_INST0_BASE, .end = (HDVPSS_CAPTURE_INST0_BASE + HDVPSS_CAPTURE_INST0_SIZE - 1), .flags = IORESOURCE_MEM, }, [1] = { .start = HDVPSS_CAPTURE_INST2_BASE, .end = (HDVPSS_CAPTURE_INST2_BASE + HDVPSS_CAPTURE_INST2_SIZE - 1), .flags = IORESOURCE_MEM, }, }; static struct platform_device ti81xx_fb_device = { .name = "ti81xxfb", .id = -1, .dev = { .dma_mask = &ti81xx_fb_dma_mask, .coherent_dma_mask = ~(u32)0, .platform_data = &ti81xxfb_config, }, .num_resources = 0, }; static struct platform_device hdvpss_capture_dev = { .name = "ti81xxvin", .id = -1, .dev = { .dma_mask = &ti81xx_fb_dma_mask, .coherent_dma_mask = ~(u32)0, }, .num_resources = 2, .resource = ti81xx_hdvpss_resource, }; void ti81xxfb_set_platform_data(struct ti81xxfb_platform_data *data) { ti81xxfb_config = *data; } static inline int ti81xx_init_fb(void) { int retval = 0; retval = platform_device_register(&ti81xx_fb_device); hdvpss_capture_dev.dev.platform_data = &ti81xx_hsvpss_capture_cfg; if (cpu_is_ti814x()) { hdvpss_capture_sdev_info[0].ti81xxvin_select_decoder = NULL;/* SADA */ hdvpss_capture_sdev_info[0].ti81xxvin_set_mode = NULL;/* SADA */ hdvpss_capture_sdev_info[0].decoder_id = 0; hdvpss_capture_sdev_info[1].ti81xxvin_select_decoder = NULL; hdvpss_capture_sdev_info[1].ti81xxvin_set_mode = NULL; hdvpss_capture_sdev_info[1].decoder_id = 0; } else { hdvpss_capture_sdev_info[0].ti81xxvin_select_decoder = NULL;/* SADA */ hdvpss_capture_sdev_info[0].ti81xxvin_set_mode = NULL;/* SADA */ hdvpss_capture_sdev_info[0].decoder_id = 0; hdvpss_capture_sdev_info[1].ti81xxvin_select_decoder = NULL; hdvpss_capture_sdev_info[1].ti81xxvin_set_mode = NULL; hdvpss_capture_sdev_info[1].decoder_id = 0; } retval += platform_device_register(&hdvpss_capture_dev); return retval; } arch_initcall(ti81xx_init_fb); #endif