diff --git a/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.mdd b/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.mdd old mode 100644 new mode 100755 index b6c5da2a..5d95d73b --- a/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.mdd +++ b/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.mdd @@ -1,42 +1,43 @@ -##****************************************************************************** -## -## Copyright (C) 2014 Xilinx, Inc. All rights reserved. -## -## Permission is hereby granted, free of charge, to any person obtaining a copy -## of this software and associated documentation files (the "Software"), to deal -## in the Software without restriction, including without limitation the rights -## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -## copies of the Software, and to permit persons to whom the Software is -## furnished to do so, subject to the following conditions: -## -## The above copyright notice and this permission notice shall be included in -## all copies or substantial portions of the Software. -## -## Use of the Software is limited solely to applications: -## (a) running on a Xilinx device, or -## (b) that interact with a Xilinx device through a bus or interconnect. -## -## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -## XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -## WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -## OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -## SOFTWARE. -## -## Except as contained in this notice, the name of the Xilinx shall not be used -## in advertising or otherwise to promote the sale, use or other dealings in -## this Software without prior written authorization from Xilinx. -## -##*****************************************************************************/ +############################################################################## +# +# Copyright (C) 2015 Xilinx, Inc. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"),to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Use of the Software is limited solely to applications: +# (a) running on a Xilinx device, or +# (b) that interact with a Xilinx device through a bus or interconnect. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Except as contained in this notice, the name of the Xilinx shall not be used +# in advertising or otherwise to promote the sale, use or other dealings in +# this Software without prior written authorization from Xilinx. +############################################################################### OPTION psf_version = 2.1; BEGIN driver vprocss - OPTION supported_peripherals = (vprocss); - OPTION driver_state = ACTIVE; - OPTION depends = (video_common_v1_0); - OPTION copyfiles = all; - OPTION VERSION = 1.0; - OPTION NAME = vprocss; + + OPTION supported_peripherals = (v_proc_ss); + OPTION driver_state = ACTIVE; + OPTION copyfiles = all; + OPTION VERSION = 1.0; + OPTION DEPENDS = (video_common v_csc v_deinterlacer v_hcresampler v_vcresampler v_hscaler v_vscaler v_letterbox axivdma gpio axis_switch); + OPTION NAME = vprocss; + END driver diff --git a/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.tcl b/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.tcl new file mode 100755 index 00000000..bdeb2ea2 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.tcl @@ -0,0 +1,333 @@ +############################################################################## +# +# Copyright (C) 2015 Xilinx, Inc. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"),to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Use of the Software is limited solely to applications: +# (a) running on a Xilinx device, or +# (b) that interact with a Xilinx device through a bus or interconnect. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Except as contained in this notice, the name of the Xilinx shall not be used +# in advertising or otherwise to promote the sale, use or other dealings in +# this Software without prior written authorization from Xilinx. +# +# MODIFICATION HISTORY: +# Ver Who Date Changes +# -------- ------ -------- ---------------------------------------------------- +# 1.0 rco 07/21/15 Initial version of subsystem tcl + +############################################################################### + +proc generate {drv_handle} { + ::hsi::utils::define_include_file $drv_handle "xparameters.h" "XVprocss" "NUM_INSTANCES" "C_BASEADDR" "C_HIGHADDR" "DEVICE_ID" "C_SCALER_ALGORITHM" "C_TOPOLOGY" "C_SAMPLES_PER_CLK" "C_MAX_DATA_WIDTH" "C_NUM_VIDEO_COMPONENTS" "C_MAX_COLS" "C_MAX_ROWS" "C_H_SCALER_TAPS" "C_V_SCALER_TAPS" "C_H_SCALER_PHASES" "C_V_SCALER_PHASES" "C_CHROMA_ALGORITHM" "C_H_CHROMA_TAPS" "C_V_CHROMA_TAPS" + + hier_ip_define_config_file $drv_handle "xvprocss_g.c" "XVprocss" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_TOPOLOGY" "C_SAMPLES_PER_CLK" "C_MAX_DATA_WIDTH" "C_NUM_VIDEO_COMPONENTS" "C_MAX_COLS" "C_MAX_ROWS" + + ::hsi::utils::define_canonical_xpars $drv_handle "xparameters.h" "Vprocss" "C_BASEADDR" "C_HIGHADDR" "DEVICE_ID" "C_SCALER_ALGORITHM" "C_TOPOLOGY" "C_SAMPLES_PER_CLK" "C_MAX_DATA_WIDTH" "C_NUM_VIDEO_COMPONENTS" "C_MAX_COLS" "C_MAX_ROWS" "C_H_SCALER_TAPS" "C_V_SCALER_TAPS" "C_H_SCALER_PHASES" "C_V_SCALER_PHASES" "C_CHROMA_ALGORITHM" "C_H_CHROMA_TAPS" "C_V_CHROMA_TAPS" +} + + +proc hier_ip_define_config_file {drv_handle file_name drv_string args} { + set args [::hsi::utils::get_exact_arg_list $args] + set hw_instance_name [::common::get_property HW_INSTANCE $drv_handle]; + + set filename [file join "src" $file_name] + set config_file [open $filename w] + + ::hsi::utils::write_c_header $config_file "Driver configuration" + + puts $config_file "#include \"xparameters.h\"" + puts $config_file "#include \"[string tolower $drv_string].h\"" + puts $config_file "\n/*" + puts $config_file "* List of Sub-cores included in the subsystem" + puts $config_file "* Sub-core device id will be set by its driver in xparameters.h" + puts $config_file "*/\n" + + set periphs_g [::hsi::utils::get_common_driver_ips $drv_handle] + + array set sub_core_inst { + axi_gpio 2 + v_vscaler 1 + v_hscaler 1 + axi_vdma 1 + v_letterbox 1 + v_csc 1 + v_hcresampler 1 + v_vcresampler 2 + v_deinterlacer 1 + axis_switch 1 + } + + foreach periph_g $periphs_g { + set mem_ranges [::hsi::get_mem_ranges $periph_g] + + ::hsi::current_hw_instance $periph_g; + + set child_cells_g [::hsi::get_cells] + + foreach child_cell_g $child_cells_g { + set child_cell_vlnv [::common::get_property VLNV $child_cell_g] + set child_cell_name_g [common::get_property NAME $child_cell_g] + set vlnv_arr [split $child_cell_vlnv :] + + lassign $vlnv_arr ip_vendor ip_library ip_name ip_version + set ip_type_g [common::get_property IP_TYPE $child_cell_g] + + if { [string compare -nocase "BUS" $ip_type_g] != 0 } { + set interfaces [hsi::get_intf_pins -of_objects $child_cell_g] + set is_slave 0 + + foreach interface $interfaces { + set intf_type [common::get_property TYPE $interface] + #puts "Interface type $intf_type\n" + if { [string compare -nocase "SLAVE" $intf_type] == 0 } { + set is_slave 1 + } + } + if { $is_slave != 0 } { + #puts "Processing Periph: $ip_name $child_cell_name_g" + set final_child_cell_instance_name_present_g XPAR_${child_cell_name_g}_PRESENT + puts -nonewline $config_file "#define [string toupper $final_child_cell_instance_name_present_g]\t 1\n" + + # create dictionary for ip name and it's instance names "ip_name {inst1_name inst2_name}" + dict lappend ss_ip_list $ip_name $child_cell_name_g + } + } + } + + puts $config_file "\n\n/*" + puts $config_file "* List of Sub-cores excluded from the subsystem" + puts $config_file "* - Excluded sub-core device id is set to 255" + puts $config_file "* - Excluded sub-core baseaddr is set to 0" + puts $config_file "*/\n" + + foreach sub_core [lsort [array names sub_core_inst]] { + if {[dict exists $ss_ip_list $sub_core]} { + set max_instances $sub_core_inst($sub_core) + #check if core can have multiple instances + #It is possible that not all instances are used in the design + if {$max_instances > 1} { + set ip_instances [dict get $ss_ip_list $sub_core] + set avail_instances [llength $ip_instances] + + #puts "Sub-Core: $sub_core" + #puts "instances: $ip_instances" + + #check if available instances are less than MAX + #if yes, mark the missing instance + #if all instances are present then skip the core + if {$avail_instances < $max_instances} { + if {[string compare -nocase "axi_gpio" $sub_core] == 0} { + set ip_inst_name [lindex $ip_instances 0] + set srcstr "${periph_g}_reset_sel_axi_mm" + if {[string compare -nocase $srcstr $ip_inst_name] == 0} { + set strval "RESET_SEL_AXIS" + } else { + set strval "RESET_SEL_AXI_MM" + } + } elseif {[string compare -nocase "v_vcresampler" $sub_core]} { + set ip_inst_name [lindex $ip_instances 0] + set srcstr "${periph_g}_v_vcresampler_in" + if {[string compare -nocase $srcstr $ip_inst_name] == 0} { + set strval "V_VCRESAMPLER_OUT" + } else { + set strval "V_VCRESAMPLER_IN" + } + } + #puts "String Selected: $strval" + set final_child_cell_instance_name_g "XPAR_${periph_g}_${strval}_PRESENT" + set final_child_cell_instance_devid_g "XPAR_${periph_g}_${strval}_DEVICE_ID" + set final_child_cell_instance_baseaddr_g "XPAR_${periph_g}_${strval}_BASEADDR" + puts -nonewline $config_file "#define [string toupper $final_child_cell_instance_name_g] 0\n" + puts -nonewline $config_file "#define [string toupper $final_child_cell_instance_devid_g] 255\n" + puts -nonewline $config_file "#define [string toupper $final_child_cell_instance_baseaddr_g] 0\n\n" + } + + } + #puts -nonewline $config_file "#define [string toupper $final_child_cell_instance_name_g] 1\n" + } else { + set count 0 + while {$count<$sub_core_inst($sub_core)} { + set final_child_cell_instance_name_g "XPAR_${periph_g}_${sub_core}_${count}_PRESENT" + set final_child_cell_instance_devid_g "XPAR_${periph_g}_${sub_core}_${count}_DEVICE_ID" + set final_child_cell_instance_baseaddr_g "XPAR_${periph_g}_${sub_core}_${count}_BASEADDR" + puts -nonewline $config_file "#define [string toupper $final_child_cell_instance_name_g] 0\n" + puts -nonewline $config_file "#define [string toupper $final_child_cell_instance_devid_g] 255\n" + puts -nonewline $config_file "#define [string toupper $final_child_cell_instance_baseaddr_g] 0\n\n" + incr count + } + } + } + ::hsi::current_hw_instance + } + + + puts $config_file "\n\n" + puts $config_file [format "%s_Config %s_ConfigTable\[\] =" $drv_string $drv_string] + puts $config_file "\{" + set periphs [::hsi::utils::get_common_driver_ips $drv_handle] + set start_comma "" + foreach periph $periphs { + puts $config_file [format "%s\t\{" $start_comma] + set comma "" + foreach arg $args { + if {[string compare -nocase "DEVICE_ID" $arg] == 0} { + puts -nonewline $config_file [format "%s\t\t%s,\n" $comma [::hsi::utils::get_ip_param_name $periph $arg]] + continue + } + + # Check if this is a driver parameter or a peripheral parameter + set value [common::get_property CONFIG.$arg $drv_handle] + if {[llength $value] == 0} { + set local_value [common::get_property CONFIG.$arg $periph ] + # If a parameter isn't found locally (in the current + # peripheral), we will (for some obscure and ancient reason) + # look in peripherals connected via point to point links + if { [string compare -nocase $local_value ""] == 0} { + set p2p_name [::hsi::utils::get_p2p_name $periph $arg] + if { [string compare -nocase $p2p_name ""] == 0} { + puts -nonewline $config_file [format "%s\t\t%s" $comma [::hsi::utils::get_ip_param_name $periph $arg]] + } else { + puts -nonewline $config_file [format "%s\t\t%s" $comma $p2p_name] + } + } else { + puts -nonewline $config_file [format "%s\t\t%s" $comma [::hsi::utils::get_ip_param_name $periph $arg]] + } + } else { + puts -nonewline $config_file [format "%s\t\t%s" $comma [::hsi::utils::get_driver_param_name $drv_string $arg]] + } + set comma ",\n" + } + + ::hsi::current_hw_instance $periph + set child_cells [::hsi::get_cells] + puts $config_file ",\n" + + foreach sub_core [lsort [array names sub_core_inst]] { + set max_instances $sub_core_inst($sub_core) + #puts "\nProcessing sub-core: $sub_core" + #puts "Max Instances: $max_instances" + + if {[dict exists $ss_ip_list $sub_core]} { + #puts "****Sub-core found in dictionary****" + if {[string compare -nocase "V_DEINTERLACER" $sub_core] == 0} { + set base_addr_name "S_AXI_AXILITES_BASEADDR" + } elseif {[string match -nocase v_* $sub_core]} { + set base_addr_name "S_AXI_CTRL_BASEADDR" + } else { + set base_addr_name "BASEADDR" + } + + set ip_instances [dict get $ss_ip_list $sub_core] + set avail_instances [llength $ip_instances] + + #check if core can have multiple instances + #It is possible that not all instances are used in the design + if {$max_instances > 1} { + + #check if available instances are less than MAX + #if yes, include the missing instance + if {$avail_instances < $max_instances} { + set ip_inst_name [lindex $ip_instances 0] + set count 0 + set str_name "unknown" + #puts "IP Inst. Name: $ip_inst_name" + while {$count < $max_instances} { + if {[string compare -nocase "axi_gpio" $sub_core] == 0} { + set str_name [expr {$count == 0 ? "RESET_SEL_AXI_MM" : "RESET_SEL_AXIS"}] + } elseif {[string compare -nocase "v_vcresampler" $sub_core]} { + set str_name [expr {$count == 0 ? "V_VCRESAMPLER_IN" : "V_VCRESAMPLER_OUT"}] + } + #write the ip instance entry to the table + set final_child_cell_instance_name_present "XPAR_${periph}_${str_name}_PRESENT" + set final_child_cell_instance_devid "XPAR_${periph}_${str_name}_DEVICE_ID" + set final_child_cell_instance_name_baseaddr "XPAR_${periph}_${str_name}_${base_addr_name}" + + puts $config_file "\t\t\{" + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_name_present]] + puts $config_file "," + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_devid]] + puts $config_file "," + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_name_baseaddr]] + puts $config_file "\n\t\t\}," + incr count + } + } else { + foreach ip_inst $ip_instances { + #puts "instance = $ip_inst" + set final_child_cell_instance_name_present "XPAR_${ip_inst}_PRESENT" + set final_child_cell_instance_devid "XPAR_${ip_inst}_DEVICE_ID" + set final_child_cell_instance_name_baseaddr "XPAR_${ip_inst}_${base_addr_name}" + + puts $config_file "\t\t\{" + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_name_present]] + puts $config_file "," + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_devid]] + puts $config_file "," + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_name_baseaddr]] + puts $config_file "\n\t\t\}," + } + } + } else { + set ip_inst_name [lindex $ip_instances 0] + #puts "instance = $ip_inst" + set final_child_cell_instance_name_present "XPAR_${ip_inst_name}_PRESENT" + set final_child_cell_instance_devid "XPAR_${ip_inst_name}_DEVICE_ID" + set final_child_cell_instance_name_baseaddr "XPAR_${ip_inst_name}_${base_addr_name}" + + puts $config_file "\t\t\{" + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_name_present]] + puts $config_file "," + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_devid]] + puts $config_file "," + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_name_baseaddr]] + puts $config_file "\n\t\t\}," + } + } else { + #puts "****sub-core not in dictionary****" + set count 0 + + while {$count< $max_instances} { + set final_child_cell_instance_name_present "XPAR_${periph}_${sub_core}_${count}_PRESENT" + set final_child_cell_instance_devid "XPAR_${periph}_${sub_core}_${count}_DEVICE_ID" + set final_child_cell_instance_name_baseaddr "XPAR_${periph}_${sub_core}_${count}_BASEADDR" + + puts $config_file "\t\t\{" + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_name_present]] + puts $config_file "," + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_devid]] + puts $config_file "," + puts -nonewline $config_file [format "\t\t\t%s" [string toupper $final_child_cell_instance_name_baseaddr]] + puts $config_file "\n\t\t\}," + incr count + } + } + } + + ::hsi::current_hw_instance + + puts -nonewline $config_file "\t\}" + set start_comma ",\n" + } + + puts $config_file "\n\};" + puts $config_file "\n"; + close $config_file +} diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/Makefile b/XilinxProcessorIPLib/drivers/vprocss/src/Makefile new file mode 100644 index 00000000..71b53b05 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/vprocss/src/Makefile @@ -0,0 +1,40 @@ +COMPILER= +ARCHIVER= +CP=cp +COMPILER_FLAGS= +EXTRA_COMPILER_FLAGS=-Wall -Wextra +LIB=libxil.a + +CC_FLAGS = $(COMPILER_FLAGS) +ECC_FLAGS = $(EXTRA_COMPILER_FLAGS) + +RELEASEDIR=../../../lib +INCLUDEDIR=../../../include +INCLUDES=-I./. -I${INCLUDEDIR} + +OUTS = *.o + +INCLUDEFILES=*.h ./vdma/*.h +LIBSOURCES=*.c ./vdma/*.c + +OBJECTS = $(addsuffix .o, $(basename ./vdma/xvprocss_vdma.c $(wildcard *.c))) + +libs: banner xvprocss_libs clean + +%.o: %.c + ${COMPILER} $(CC_FLAGS) $(ECC_FLAGS) $(INCLUDES) -o $@ $< + +banner: + echo "Compiling Video Processing Subsystem" + +xvprocss_libs: ${OBJECTS} + $(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OBJECTS} + +.PHONY: include +include: xvprocss_includes + +xvprocss_includes: + ${CP} ${INCLUDEFILES} ${INCLUDEDIR} + +clean: + rm -rf ${OBJECTS} diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_dma.c b/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.c similarity index 97% rename from XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_dma.c rename to XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.c index d53a1122..5b06591b 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_dma.c +++ b/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.c @@ -32,9 +32,10 @@ /*****************************************************************************/ /** * -* @file xvprocss_dma.c -* @addtogroup vprocss_v1_0 +* @file xvprocss_vdma.c +* @addtogroup vprocss * @{ +* @details * Video buffer management routine. * The functions in this file provides an abstraction from the register peek/poke @@ -45,7 +46,7 @@ * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- -* 1.00 rc 05/18/15 Initial Release +* 1.00 rco 07/21/15 Initial Release * * @@ -53,7 +54,7 @@ /***************************** Include Files *********************************/ #include "xvidc.h" -#include "xvprocss_dma.h" +#include "xvprocss_vdma.h" #include "microblaze_sleep.h" #define XVDMA_RESET_TIMEOUT (1000000) //10ms at 10ns time period (100MHz clock)) @@ -429,7 +430,7 @@ void XVprocss_VdmaDbgReportStatus(XAxiVdma *pVdma, u32 Bpp) * @return None * ******************************************************************************/ -void XVprocss_SetVdmaWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh) +void XVprocss_VdmaSetWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh) { XVidC_VideoWindow wrWin, rdWin; u32 OutputWidth, OutputHeight; @@ -464,7 +465,7 @@ void XVprocss_SetVdmaWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh) /* write PIP window stream to DDR */ status = XVprocss_VdmaWriteSetup(pVprocss->vdma, - pVprocss->Config.UsrExtMemBaseAddr, + pVprocss->FrameBufBaseaddr, &wrWin, OutputWidth, OutputHeight, @@ -486,7 +487,7 @@ void XVprocss_SetVdmaWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh) rdWin.Height = OutputHeight; status = XVprocss_VdmaReadSetup(pVprocss->vdma, - pVprocss->Config.UsrExtMemBaseAddr, + pVprocss->FrameBufBaseaddr, &rdWin, OutputWidth, OutputHeight, @@ -509,7 +510,7 @@ void XVprocss_SetVdmaWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh) * @return None * ******************************************************************************/ -void XVprocss_SetVdmaWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh) +void XVprocss_VdmaSetWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh) { XVidC_VideoWindow wrWin, rdWin; u32 InputWidth, InputHeight; @@ -533,7 +534,7 @@ void XVprocss_SetVdmaWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh) /* write input stream to DDR */ status = XVprocss_VdmaWriteSetup(pVprocss->vdma, - pVprocss->Config.UsrExtMemBaseAddr, + pVprocss->FrameBufBaseaddr, &wrWin, InputWidth, InputHeight, @@ -563,7 +564,7 @@ void XVprocss_SetVdmaWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh) } status = XVprocss_VdmaReadSetup(pVprocss->vdma, - pVprocss->Config.UsrExtMemBaseAddr, + pVprocss->FrameBufBaseaddr, &rdWin, InputWidth, InputHeight, diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_dma.h b/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.h similarity index 83% rename from XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_dma.h rename to XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.h index 0abe758b..37ba1b21 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_dma.h +++ b/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.h @@ -32,9 +32,10 @@ /*****************************************************************************/ /** * -* @file xvprocss_dma.h +* @file xvprocss_vdma.h * @addtogroup vprocss_v1_0 * @{ +* @details * * This header file contains the video processing engine DMA buffer management * routines and helper functions. AXI-VDMA core is used to provide DMA @@ -69,19 +70,18 @@ * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- -* 1.00 rc 05/18/15 Initial Release +* 1.00 rco 07/21/15 Initial Release * * ******************************************************************************/ -#ifndef XVPROCSS_DMA_H_ /* prevent circular inclusions */ -#define XVPROCSS_DMA_H_ /* by using protection macros */ +#ifndef XVPROCSS_VDMA_H_ /* prevent circular inclusions */ +#define XVPROCSS_VDMA_H_ /* by using protection macros */ #ifdef __cplusplus extern "C" { #endif -//#include "xaxivdma.h" #include "xvprocss.h" /************************** Constant Definitions *****************************/ @@ -102,21 +102,21 @@ void XVprocss_VdmaStart(XAxiVdma *pVdma); void XVprocss_VdmaStop(XAxiVdma *pVdma); void XVprocss_VdmaReset(XAxiVdma *pVdma); int XVprocss_VdmaWriteSetup(XAxiVdma *pVdma, - u32 WrBaseAddress, - XVidC_VideoWindow *window, - u32 FrameWidth, - u32 FrameHeight, - u32 Bpp); + u32 WrBaseAddress, + XVidC_VideoWindow *window, + u32 FrameWidth, + u32 FrameHeight, + u32 Bpp); int XVprocss_VdmaReadSetup(XAxiVdma *pVdma, - u32 RdBaseAddress, - XVidC_VideoWindow *window, - u32 FrameWidth, - u32 FrameHeight, - u32 Bpp); + u32 RdBaseAddress, + XVidC_VideoWindow *window, + u32 FrameWidth, + u32 FrameHeight, + u32 Bpp); int XVprocss_VdmaStartTransfer(XAxiVdma *pVdma); void XVprocss_VdmaDbgReportStatus(XAxiVdma *pVdma, u32 Bpp); -void XVprocss_SetVdmaWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh); -void XVprocss_SetVdmaWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh); +void XVprocss_VdmaSetWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh); +void XVprocss_VdmaSetWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh); #ifdef __cplusplus } diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c index bc5b42a6..6aa0303f 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c @@ -33,8 +33,6 @@ /** * * @file xvprocss.c -* @addtogroup vprocss_v1_0 -* @{ * * This is main code of Xilinx Video Processing Subsystem device driver. * Please see xvprocss.h for more details of the driver. @@ -44,7 +42,7 @@ * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- -* 1.00 rc 05/01/15 Initial Release +* 1.00 rco 07/21/15 Initial Release * * @@ -54,8 +52,9 @@ #include "microblaze_sleep.h" #include "xvprocss.h" #include "xenv.h" -#include "xvprocss_dma.h" +#include "xvprocss_vdma.h" #include "xvprocss_router.h" +#include "xvprocss_coreinit.h" /************************** Constant Definitions *****************************/ @@ -107,10 +106,11 @@ XVprocss_SubCores subcoreRepo; /**< Define Driver instance of all sub-core /************************** Function Prototypes ******************************/ static void SetPODConfiguration(XVprocss *pVprocss); static void GetIncludedSubcores(XVprocss *pVprocss); + static int validateVidStreamConfig(XVidC_VideoStream *pStrmIn, XVidC_VideoStream *pStrmOut); -static int SetupStreamMode(XVprocss *pVprocss); -static int SetupMaxMode(XVprocss *pVprocss); +static int SetupModeScalerOnly(XVprocss *pVprocss); +static int SetupModeMax(XVprocss *pVprocss); /***************** Macros (Inline Functions) Definitions *********************/ /*****************************************************************************/ @@ -365,6 +365,27 @@ static void GetIncludedSubcores(XVprocss *pVprocss) ? (&subcoreRepo.rstAximm) : NULL); } +/*****************************************************************************/ +/** +* This function sets the base address of the video frame buffers used by the +* subsystem instance +* +* @param InstancePtr is a pointer to the Subsystem instance to be worked on. +* @param addr is the base address of the video frame buffers +* +* @return None +* +******************************************************************************/ +void XVprocss_SetFrameBufBaseaddr(XVprocss *InstancePtr, u32 addr) +{ + /* Verify arguments */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(addr != 0); + + InstancePtr->FrameBufBaseaddr = addr; +} + + /*****************************************************************************/ /** * This function initializes the video subsystem and included sub-cores. @@ -388,8 +409,8 @@ int XVprocss_CfgInitialize(XVprocss *InstancePtr, XVprocss_Config *CfgPtr, { XVprocss *pVprocss = InstancePtr; XAxiVdma_Config *VdmaCfgPtr; - XAxis_Switch_Config *RouterCfgPtr; int status; + u32 AbsAddr; /* Verify arguments */ Xil_AssertNonvoid(pVprocss != NULL); @@ -402,13 +423,13 @@ int XVprocss_CfgInitialize(XVprocss *InstancePtr, XVprocss_Config *CfgPtr, pVprocss->Config.BaseAddress = EffectiveAddr; /* Print the configuration selected */ - switch(pVprocss->Config.Mode) + switch(pVprocss->Config.Topology) { - case XVPROCSS_MODE_MAX: + case XVPROCSS_TOPOLOGY_FULL_FLEDGED: xil_printf(" [Subsystem Configuration Mode - Full]\r\n\r\n"); break; - case XVPROCSS_MODE_STREAM: + case XVPROCSS_TOPOLOGY_SCALER_ONLY: xil_printf(" [Subsystem Configuration Mode - Scaler-Only]\r\n\r\n"); break; @@ -421,45 +442,19 @@ int XVprocss_CfgInitialize(XVprocss *InstancePtr, XVprocss_Config *CfgPtr, GetIncludedSubcores(pVprocss); /* Initialize all included sub_cores */ - if(pVprocss->router) - { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXIS Switch core.... \r\n"); - RouterCfgPtr = XAxisScr_LookupConfig(pVprocss->Config.Router.DeviceId); - if(RouterCfgPtr == NULL) - { - xil_printf("VPROCSS ERR:: AXIS Switch device not found\r\n"); - return(XST_DEVICE_NOT_FOUND); - } - status = XAxisScr_CfgInitialize(pVprocss->router, - RouterCfgPtr, - RouterCfgPtr->BaseAddress); - - if(status != XST_SUCCESS) - { - xil_printf("VPROCSS ERR:: AXIS Switch Initialization failed %d\r\n", status); - return(XST_FAILURE); - } - } - if(pVprocss->rstAxis) { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXIS Reset core.... \r\n"); - status = XGpio_Initialize(pVprocss->rstAxis, pVprocss->Config.RstAxis.DeviceId); - if(status == XST_DEVICE_NOT_FOUND) + if(XVprocss_SubcoreInitResetAxis(pVprocss) != XST_SUCCESS) { - xil_printf("VPROCSS ERR:: AXIS Clk Reset device not found\r\n"); - return(status); + return(XST_FAILURE); } } if(pVprocss->rstAximm) { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXI-MM Reset core.... \r\n"); - status = XGpio_Initialize(pVprocss->rstAximm, pVprocss->Config.RstAximm.DeviceId); - if(status == XST_DEVICE_NOT_FOUND) + if(XVprocss_SubcoreInitResetAximm(pVprocss) != XST_SUCCESS) { - xil_printf("VPROCSS ERR:: AXIS Div2 Clk Reset device not found\r\n"); - return(status); + return(XST_FAILURE); } /* * Make sure AXI-MM interface is not in reset. If in reset it will prevent @@ -468,159 +463,128 @@ int XVprocss_CfgInitialize(XVprocss *InstancePtr, XVprocss_Config *CfgPtr, XVprocss_EnableBlock(InstancePtr->rstAximm, GPIO_CH_RESET_SEL, RESET_MASK_IP_AXIMM); } - if(pVprocss->hcrsmplr) + if(pVprocss->router) { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing H Chroma Resampler core.... \r\n"); - status = XV_hcresampler_Initialize(pVprocss->hcrsmplr, pVprocss->Config.HCrsmplr.DeviceId); - if(status == XST_DEVICE_NOT_FOUND) + if(XVprocss_SubcoreInitRouter(pVprocss) != XST_SUCCESS) { - xil_printf("VPROCSS ERR:: H Chroma Resampler device not found\r\n"); - return(status); - } - } - - if(pVprocss->vcrsmplrIn) - { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Input V Chroma Resampler core.... \r\n"); - status = XV_vcresampler_Initialize(pVprocss->vcrsmplrIn, pVprocss->Config.VCrsmplrIn.DeviceId); - if(status == XST_DEVICE_NOT_FOUND) - { - xil_printf("VPROCSS ERR:: Input V Chroma Resampler device not found\r\n"); - return(status); - } - } - - if(pVprocss->vcrsmplrOut) - { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Output V Chroma Resampler core.... \r\n"); - status = XV_vcresampler_Initialize(pVprocss->vcrsmplrOut, pVprocss->Config.VCrsmplrOut.DeviceId); - if(status == XST_DEVICE_NOT_FOUND) - { - xil_printf("VPROCSS ERR:: Output V Chroma Resampler device not found\r\n"); - return(status); - } - } - - if(pVprocss->vscaler) - { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing V Scaler core.... \r\n"); - status = XV_vscaler_Initialize(pVprocss->vscaler, pVprocss->Config.Vscale.DeviceId); - if(status == XST_DEVICE_NOT_FOUND) - { - xil_printf("VPROCSS ERR:: V Scaler device not found\r\n"); - return(status); - } - } - - if(pVprocss->hscaler) - { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing H Scaler core.... \r\n"); - status = XV_hscaler_Initialize(pVprocss->hscaler, pVprocss->Config.Hscale.DeviceId); - if(status == XST_DEVICE_NOT_FOUND) - { - xil_printf("VPROCSS ERR:: H Scaler device not found\r\n"); - return(status); - } - } - - if(pVprocss->vdma) - { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing VDMA core.... \r\n"); - VdmaCfgPtr = XAxiVdma_LookupConfig(pVprocss->Config.Vdma.DeviceId); - if(VdmaCfgPtr == NULL) - { - xil_printf("VPROCSS ERR:: VDMA device not found\r\n"); - return(XST_DEVICE_NOT_FOUND); - } - status = XAxiVdma_CfgInitialize(pVprocss->vdma, - VdmaCfgPtr, - VdmaCfgPtr->BaseAddress); - - if(status != XST_SUCCESS) - { - xil_printf("VPROCSS ERR:: VDMA Configuration Initialization failed %d\r\n", status); return(XST_FAILURE); } } - if(pVprocss->lbox) - { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Letterbox core.... \r\n"); - status = XV_letterbox_Initialize(pVprocss->lbox, pVprocss->Config.Lbox.DeviceId); - if(status == XST_DEVICE_NOT_FOUND) - { - xil_printf("VPROCSS ERR:: LetterBox device not found\r\n"); - return(status); - } - } - if(pVprocss->csc) { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing CSC core.... \r\n"); - status = XV_csc_Initialize(pVprocss->csc, pVprocss->Config.Csc.DeviceId); - if(status == XST_DEVICE_NOT_FOUND) + if(XVprocss_SubcoreInitCsc(pVprocss) != XST_SUCCESS) { - xil_printf("VPROCSS ERR:: CSC device not found\r\n"); - return(status); + return(XST_FAILURE); } } + if(pVprocss->hscaler) + { + if(XVprocss_SubcoreInitHScaler(pVprocss) != XST_SUCCESS) + { + return(XST_FAILURE); + } + } + + if(pVprocss->vscaler) + { + if(XVprocss_SubcoreInitVScaler(pVprocss) != XST_SUCCESS) + { + return(XST_FAILURE); + } + } + + if(pVprocss->hcrsmplr) + { + if(XVprocss_SubcoreInitHCrsmplr(pVprocss) != XST_SUCCESS) + { + return(XST_FAILURE); + } + } + + if(pVprocss->vcrsmplrIn) + { + if(XVprocss_SubcoreInitVCrsmpleIn(pVprocss) != XST_SUCCESS) + { + return(XST_FAILURE); + } + } + + if(pVprocss->vcrsmplrOut) + { + if(XVprocss_SubcoreInitVCrsmpleOut(pVprocss) != XST_SUCCESS) + { + return(XST_FAILURE); + } + } + + if(pVprocss->lbox) + { + if(XVprocss_SubcoreInitLetterbox(pVprocss) != XST_SUCCESS) + { + return(XST_FAILURE); + } + } + + if(pVprocss->vdma) + { + if(XVprocss_SubcoreInitVdma(pVprocss) != XST_SUCCESS) + { + return(XST_FAILURE); + } + + if(pVprocss->FrameBufBaseaddr == 0) + { + xil_printf("\r\nVPROCSS ERR:: Video Frame Buffer base address not set\r\n"); + xil_printf(" Use XVprocss_SetFrameBufBaseaddr() API before subsystem init\r\n\r\n"); + return(XST_FAILURE); + } + } + + if(pVprocss->deint) { - xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Deinterlacer core.... \r\n"); - status = XV_deinterlacer_Initialize(pVprocss->deint, pVprocss->Config.Deint.DeviceId); - if(status == XST_DEVICE_NOT_FOUND) + if(XVprocss_SubcoreInitDeinterlacer(pVprocss) != XST_SUCCESS) + { + return(XST_FAILURE); + } + + /* Set Deinterlacer buffer offset in allocated DDR Frame Buffer */ + if(pVprocss->vdma) //vdma must be present for this to work { - xil_printf("VPROCSS ERR:: Deinterlacer device not found\r\n"); - return(status); + u32 vdmaBufReq, bufsize; + u32 Bpp; //bytes per pixel + + Bpp = (pVprocss->Config.PixPrecision + 7)/8; + + //compute buffer size based on subsystem configuration + //For 1 4K2K buffer (YUV444 16-bit) size is ~48MB + bufsize = pVprocss->Config.MaxWidth * + pVprocss->Config.MaxHeight * + pVprocss->Config.NumVidComponents * + Bpp; + + //VDMA requires 4 buffers for total size of ~190MB + vdmaBufReq = pVprocss->vdma->MaxNumFrames * bufsize; + + /* + * vdmaBufReq = 0x0BDD 80000 + * padBuf = 0x02F7 6000 (1 buffer is added as pad between vdma and deint) + * ------------- + * DeInt Offst= 0x0ED4 E000 + * ------------- + */ + /* Set Deint Buffer Address Offset */ + pVprocss->idata.deintBufAddr = pVprocss->FrameBufBaseaddr + vdmaBufReq + bufsize; } - } - - /* Validate DDR Frame Buffer Allocation */ - if(pVprocss->vdma) - { - u32 vdmaBufReq, deintBufReq, padBuf; - u32 totBufReq; - u32 inRange, numVdmaBuf; - - /* Validate External Memory Range available */ - numVdmaBuf = pVprocss->vdma->MaxNumFrames; - - //4 4K2K (YUV444 16-bit) buffers (~190MB) needed for frame buffers - vdmaBufReq = numVdmaBuf * (u32)3840 * 2160 * 3 * 2; - - //3 1080i (YUV444 16-bit) field buffers (~18MB) needed for de-interlacer - deintBufReq = 3*(u32)1920*540*3*2; - - //1 4K2K buffer (~48MB) reserved as pad between vdma and deint - padBuf = (u32)3840*2160*3*2; - - totBufReq = vdmaBufReq + deintBufReq + padBuf; //~256MB (0x1000 0000) - inRange = (totBufReq < pVprocss->Config.UsrExtMemAddr_Range); - if(!inRange) + else { - xil_printf("VPROCSS ERR:: EXT Memory Region Allocated is small."); - xil_printf("Try increasing memory range\r\n"); + xil_printf("\r\nVPROCSS ERR:: VDMA IP not found. Unable to assign De-interlacer buffer offsets\r\n"); return(XST_FAILURE); } - - /* - * DDR @0x8000 0000 - * - 512MB space reserved for elf file - * VDMA Buffer offset = 0x8000 0000 + 0x2000 0000 - * = 0xA000 0000 - * vdmaBufReq = 0x0BDD 80000 - * padBuf = 0x02F7 6000 - * ------------- - * DeInt Offst= 0x0ED4 E000 --->0xAED4 E0000 - * ------------- - */ - /* Set Deint Buffer Address Offset */ - if(pVprocss->deint) - { - pVprocss->idata.deintBufAddr = pVprocss->Config.UsrExtMemBaseAddr + vdmaBufReq + padBuf; - } } + return(XST_SUCCESS); } @@ -1015,11 +979,11 @@ void XVprocss_UpdateZoomPipWindow(XVprocss *InstancePtr) /* send vdma update window to IP */ if(XVprocss_IsPipModeOn(InstancePtr)) { - XVprocss_SetVdmaWinToDnScaleMode(InstancePtr, XVPROCSS_VDMA_UPDATE_WR_CH); + XVprocss_VdmaSetWinToDnScaleMode(InstancePtr, XVPROCSS_VDMA_UPDATE_WR_CH); } else { - XVprocss_SetVdmaWinToUpScaleMode(InstancePtr, XVPROCSS_VDMA_UPDATE_RD_CH); + XVprocss_VdmaSetWinToUpScaleMode(InstancePtr, XVPROCSS_VDMA_UPDATE_RD_CH); } XVprocss_VdmaStartTransfer(InstancePtr->vdma); @@ -1274,8 +1238,8 @@ static int validateVidStreamConfig(XVidC_VideoStream *pStrmIn, /*****************************************************************************/ /** -* This function configures the video subsystem pipeline for Stream Mode -* configuration of the subsystem +* This function configures the video subsystem pipeline for ScalerOnly +* topology of the subsystem * * @param pVprocss is a pointer to the Subsystem instance to be worked on. * @@ -1285,7 +1249,7 @@ static int validateVidStreamConfig(XVidC_VideoStream *pStrmIn, * accordingly else will ignore the request * ******************************************************************************/ -static int SetupStreamMode(XVprocss *pVprocss) +static int SetupModeScalerOnly(XVprocss *pVprocss) { u32 vsc_WidthIn, vsc_HeightIn, vsc_HeightOut; u32 hsc_HeightIn, hsc_WidthIn, hsc_WidthOut; @@ -1354,15 +1318,15 @@ static int SetupStreamMode(XVprocss *pVprocss) /*****************************************************************************/ /** -* This function configures the video subsystem pipeline for Maximum (Full) -* mode configuration +* This function configures the video subsystem pipeline for Maximum +* (Full_Fledged) topology * * @param pVprocss is a pointer to the Subsystem instance to be worked on. * * @return XST_SUCCESS if successful else XST_FAILURE * ******************************************************************************/ -static int SetupMaxMode(XVprocss *pVprocss) +static int SetupModeMax(XVprocss *pVprocss) { int status; @@ -1420,15 +1384,15 @@ int XVprocss_ConfigureSubsystem(XVprocss *InstancePtr) XVidC_ReportStreamInfo(&InstancePtr->VidOut); xil_printf("**************************************************\r\n\r\n"); - switch(InstancePtr->Config.Mode) + switch(InstancePtr->Config.Topology) { - case XVPROCSS_MODE_MAX: - status = SetupMaxMode(InstancePtr); + case XVPROCSS_TOPOLOGY_FULL_FLEDGED: + status = SetupModeMax(InstancePtr); break; - case XVPROCSS_MODE_STREAM: + case XVPROCSS_TOPOLOGY_SCALER_ONLY: //Only configuration supported is V->H - status = SetupStreamMode(InstancePtr); + status = SetupModeScalerOnly(InstancePtr); break; default: @@ -1438,4 +1402,3 @@ int XVprocss_ConfigureSubsystem(XVprocss *InstancePtr) } return(status); } -/** @} */ diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.h b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.h index 5645e6c2..a9d72abf 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.h +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.h @@ -33,9 +33,6 @@ /** * * @file xvprocss.h -* @addtogroup vprocss_v1_0 -* @{ -* @details * * This is main header file of the Xilinx Video Processing Subsystem driver * @@ -49,12 +46,12 @@ * * Video Subsystem supports following features * - AXI Stream Input/Output interface -* - 2 or 4 pixel-wide video interface -* - up to 16 bits per component -* - RGB & YCbCb color space +* - 1, 2 or 4 pixel-wide video interface +* - 8/10/12/16 bits per component +* - RGB & YCbCr color space * - Memory based/streaming mode scaling in either direction (Up/Down) * - Up to 4k2k 60Hz resolution at both Input and Output interface -* - Interlaced input support +* - Interlaced input support (1080i 50Hz/60Hz) * - Frame rate conversion * - Drop frames if input rate > output rate * - Repeat frames if input rate < output rate @@ -111,6 +108,8 @@ * Subsystem driver requires 2 support peripherals, Timer and an Interrupt * Controller, to be present in the design and the application must register a * handle to these with the subsystem using the provided API's. +* Also for memory based design application must program the base address of the +* video buffers in memory. Refer Memory Requirement section below * * Subsystem Driver Usage * @@ -123,6 +122,25 @@ * Xilinx video common driver and only the resolutions listed therein are * supported at this time * +* Memory Requirement +* +* For full configuration mode DDR memory is used to store video frame buffers +* Subsystem uses 4 frame buffers for Progressive input and 3 field buffers for +* interlaced input (if supported). Amount of memory required by the subsystem +* can be calculated +* +* - NUM_BUFFERS * MAX_WIDTH * MAX_HEIGHT * NUM_VIDEO_COMPONENTS * ByesPerPixel +* +* BytesPerPixel +* - 1 Byte for 8 bit data pipe +* - 2 Byte for 10/12/16 bit data pipe +* +* The location of these buffers in the memory is system dependent and as such +* must be determined by the system designer and the application code is +* responsible to program the base address of the buffer memory prior to +* initializing the subsystem. API to use is defined below +* - XVprocss_SetFrameBufBaseaddr +* * Interrupt Service * * Currently no interrupts are available from the subsystem. User application is @@ -154,7 +172,7 @@ * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- -* 1.00 rc 05/01/15 Initial Release +* 1.00 rco 07/21/15 Initial Release * * @@ -173,11 +191,12 @@ extern "C" { #include "xgpio.h" #include "xaxis_switch.h" #include "xvidc.h" +#include "xaxivdma.h" + /** - * Sub-core Layer 2 driver includes + * Subsystem sub-core header files * Layer 2 includes Layer-1 */ -#include "xaxivdma.h" #include "xv_csc_l2.h" #include "xv_deinterlacer_l2.h" #include "xv_hcresampler_l2.h" @@ -210,9 +229,9 @@ typedef enum */ typedef enum { - XVPROCSS_MODE_MAX = 0, - XVPROCSS_MODE_STREAM -}XVPROCSS_CONFIG_MODE; + XVPROCSS_TOPOLOGY_SCALER_ONLY = 0, + XVPROCSS_TOPOLOGY_FULL_FLEDGED, +}XVPROCSS_CONFIG_TOPOLOGY; /** * Types of Windows (Sub-frames) available in the Subsystem @@ -270,8 +289,9 @@ typedef struct */ typedef struct { - u16 isPresent; /**< Flag to indicate if sub-core is present in the design*/ - u16 DeviceId; /**< Device ID of the sub-core */ + u16 isPresent; /**< Flag to indicate if sub-core is present in the design*/ + u16 DeviceId; /**< Device ID of the sub-core */ + u32 AddrOffset; /**< sub-core offset from subsystem base address */ }XSubCore; /** @@ -283,25 +303,28 @@ typedef struct typedef struct { u16 DeviceId; /**< DeviceId is the unique ID of the device */ - u32 BaseAddress; /**< BaseAddress is the physical base address of - the device's registers */ - u8 Mode; /**< Subsystem configuration mode */ + u32 BaseAddress; /**< BaseAddress is the physical base address of the + subsystem address range */ + u32 HighAddress; /**< HighAddress is the physical MAX address of the + subsystem address range */ + u8 Topology; /**< Subsystem configuration mode */ u8 PixPerClock; /**< Number of Pixels Per Clock processed by Subsystem */ u16 PixPrecision; /**< Processing precision of the data pipe */ + u16 NumVidComponents; /**< Number of Video Components */ + u16 MaxWidth; /**< Maximum cols supported by subsystem instance */ + u16 MaxHeight; /**< Maximum rows supported by subsystem instance */ + XSubCore RstAximm; /**< Axi MM reset network instance configuration */ + XSubCore RstAxis; /**< Axi stream reset network instance configuration */ + XSubCore Vdma; /**< Sub-core instance configuration */ + XSubCore Router; /**< Sub-core instance configuration */ + XSubCore Csc; /**< Sub-core instance configuration */ + XSubCore Deint; /**< Sub-core instance configuration */ XSubCore HCrsmplr; /**< Sub-core instance configuration */ + XSubCore Hscale; /**< Sub-core instance configuration */ + XSubCore Lbox; /**< Sub-core instance configuration */ XSubCore VCrsmplrIn; /**< Sub-core instance configuration */ XSubCore VCrsmplrOut; /**< Sub-core instance configuration */ XSubCore Vscale; /**< Sub-core instance configuration */ - XSubCore Hscale; /**< Sub-core instance configuration */ - XSubCore Vdma; /**< Sub-core instance configuration */ - XSubCore Lbox; /**< Sub-core instance configuration */ - XSubCore Csc; /**< Sub-core instance configuration */ - XSubCore Deint; /**< Sub-core instance configuration */ - XSubCore Router; /**< Sub-core instance configuration */ - XSubCore RstAxis; /**< Axi stream reset network instance configuration */ - XSubCore RstAximm; /**< Axi MM reset network instance configuration */ - u32 UsrExtMemBaseAddr; /**< DDR base address for buffer management */ - u32 UsrExtMemAddr_Range; /**< Range of addresses available for buffers */ } XVprocss_Config; /** @@ -311,9 +334,9 @@ typedef struct */ typedef struct { - XVprocss_Config Config; /**< Hardware configuration */ - u32 IsReady; /**< Device and the driver instance are initialized */ - + XVprocss_Config Config; /**< Hardware configuration */ + u32 IsReady; /**< Device and the driver instance are + initialized */ XAxis_Switch *router; /**< handle to sub-core driver instance */ XGpio *rstAxis; /**< handle to sub-core driver instance */ XGpio *rstAximm; /**< handle to sub-core driver instance */ @@ -332,19 +355,22 @@ typedef struct * Layer2 SW Register (Every Subsystem instance will have it's own copy of Layer 2 register bank for applicable sub-cores) */ - XV_csc_L2Reg cscL2Reg; /**< Layer 2 register bank for csc sub-core */ - XV_vscaler_l2 vscL2Reg; /**< Layer 2 register bank for vsc sub-core */ - XV_hscaler_l2 hscL2Reg; /**< Layer 2 register bank for hsc sub-core */ + XV_csc_L2Reg cscL2Reg; /**< Layer 2 register bank for csc sub-core */ + XV_vscaler_l2 vscL2Reg; /**< Layer 2 register bank for vsc sub-core */ + XV_hscaler_l2 hscL2Reg; /**< Layer 2 register bank for hsc sub-core */ //I/O Streams - XVidC_VideoStream VidIn; /**< Input AXIS configuration */ - XVidC_VideoStream VidOut; /**< Output AXIS configuration */ + XVidC_VideoStream VidIn; /**< Input AXIS configuration */ + XVidC_VideoStream VidOut; /**< Output AXIS configuration */ - XVprocss_IData idata; /**< Internal Scratch pad memory for subsystem instance */ + XVprocss_IData idata; /**< Internal Scratch pad memory for subsystem + instance */ + u32 FrameBufBaseaddr; /**< Base address for frame buffer storage */ - XIntc *pXintc; /**< handle to system interrupt controller */ + XIntc *pXintc; /**< handle to system interrupt controller */ XVidC_DelayHandler UsrDelaymsec; /**< custom user function for delay/sleep */ - void *pUsrTmr; /**< handle to timer instance used by user delay function */ + void *pUsrTmr; /**< handle to timer instance used by user + delay function */ } XVprocss; /************************** Macros Definitions *******************************/ @@ -357,7 +383,7 @@ typedef struct * *****************************************************************************/ #define XVprocss_IsConfigModeMax(pVprocss) \ - ((pVprocss)->Config.Mode == XVPROCSS_MODE_MAX) + ((pVprocss)->Config.Topology == XVPROCSS_TOPOLOGY_FULL_FLEDGED) /*****************************************************************************/ /** @@ -368,8 +394,8 @@ typedef struct * @return Returns 1 if condition is TRUE or 0 if FALSE * *****************************************************************************/ -#define XVprocss_IsConfigModeStream(pVprocss) \ - ((pVprocss)->Config.Mode == XVPROCSS_MODE_STREAM) +#define XVprocss_IsConfigModeSscalerOnly(pVprocss) \ + ((pVprocss)->Config.Topology == XVPROCSS_TOPOLOGY_SCALER_ONLY) /*****************************************************************************/ @@ -454,9 +480,10 @@ typedef struct /************************** Function Prototypes ******************************/ XVprocss_Config* XVprocss_LookupConfig(u32 DeviceId); -int XVprocss_CfgInitialize(XVprocss *InstancePtr, - XVprocss_Config *CfgPtr, - u32 EffectiveAddr); +void XVprocss_SetFrameBufBaseaddr(XVprocss *InstancePtr, u32 addr); +int XVprocss_CfgInitialize(XVprocss *InstancePtr, + XVprocss_Config *CfgPtr, + u32 EffectiveAddr); int XVprocss_PowerOnInit(XVprocss *InstancePtr, u32 DeviceId); void XVprocss_Start(XVprocss *InstancePtr); void XVprocss_Stop(XVprocss *InstancePtr); @@ -472,11 +499,11 @@ int XVprocss_ConfigureSubsystem(XVprocss *InstancePtr); void XVprocss_SetZoomMode(XVprocss *InstancePtr, u8 OnOff); void XVprocss_SetPipMode(XVprocss *InstancePtr, u8 OnOff); -void XVprocss_SetZoomPipWindow(XVprocss *InstancePtr, - XVprocss_Win mode, +void XVprocss_SetZoomPipWindow(XVprocss *InstancePtr, + XVprocss_Win mode, XVidC_VideoWindow *win); -void XVprocss_GetZoomPipWindow(XVprocss *InstancePtr, - XVprocss_Win mode, +void XVprocss_GetZoomPipWindow(XVprocss *InstancePtr, + XVprocss_Win mode, XVidC_VideoWindow *win); void XVprocss_UpdateZoomPipWindow(XVprocss *InstancePtr); @@ -492,4 +519,3 @@ void XVprocss_RegisterDelayHandler(XVprocss *InstancePtr, #endif #endif /* end of protection macro */ -/** @} */ diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.c b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.c new file mode 100644 index 00000000..5ed63b87 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.c @@ -0,0 +1,747 @@ +/****************************************************************************** + * + * Copyright (C) 2015 Xilinx, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * Use of the Software is limited solely to applications: + * (a) running on a Xilinx device, or + * (b) that interact with a Xilinx device through a bus or interconnect. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of the Xilinx shall not be used + * in advertising or otherwise to promote the sale, use or other dealings in + * this Software without prior written authorization from Xilinx. + * +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file xvprocss_coreinit.c +* @addtogroup vprocss +* @{ +* @details + +* Video Processing Subsystem Sub-Cores initialization +* The functions in this file provides an abstraction from the initialization +* sequence for included sub-cores. Subsystem is assigned an address and range +* on the axi-lite interface. This address space is condensed where-in each +* sub-core is at a fixed offset from the subsystem base address. For processor +* to be able to access the sub-core this offset needs to be transalted into a +* absolute address within the subsystems addressable range +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ---- -------- -------------------------------------------------------
+* 1.00  rco  07/21/15   Initial Release
+
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ +#include "xvprocss_coreinit.h" + +/************************** Constant Definitions *****************************/ + +/************************** Function Prototypes ******************************/ +static int ComputeSubcoreAbsAddr(u32 subsys_baseaddr, + u32 subsys_highaddr, + u32 subcore_offset, + u32 *subcore_baseaddr); + + +/*****************************************************************************/ +/** +* This function computes the subcore absolute address on axi-lite interface +* Subsystem is mapped at an absolute address and all included sub-cores are +* at pre-defined offset from the subsystem base address. To access the subcore +* register map from host CPU an absolute address is required. +* Subsystem has address range of 1MB (0x00000-0xFFFFF) +* +* @param subsys_baseaddr is the base address of the the Subsystem instance +* @param subsys_highaddr is the max address of the Subsystem instance +* @param subcore_offset is the offset of the specified core +* @param subcore_baseaddr is the computed absolute base address of the subcore +* +* @return XST_SUCCESS if base address computation is successful and within +* subsystem address range else XST_FAILURE +* +******************************************************************************/ +static int ComputeSubcoreAbsAddr(u32 subsys_baseaddr, + u32 subsys_highaddr, + u32 subcore_offset, + u32 *subcore_baseaddr) +{ + int status; + u32 absAddr; + + absAddr = subsys_baseaddr | subcore_offset; + if((absAddr>=subsys_baseaddr) && (absAddrrstAxis) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXIS Reset core.... \r\n"); + pConfig = XGpio_LookupConfig(pVprocss->Config.RstAxis.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: Reset AXIS device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.RstAxis.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Reset AXIS core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XGpio_CfgInitialize(pVprocss->rstAxis, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Reset AXIS core Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitResetAximm(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XGpio_Config *pConfig; + + if(pVprocss->rstAximm) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXI-MM Reset core.... \r\n"); + pConfig = XGpio_LookupConfig(pVprocss->Config.RstAximm .DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: Reset AXI-MM device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.RstAximm.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Reset AXI-MM core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XGpio_CfgInitialize(pVprocss->rstAximm, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Reset AXI-MM core Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitRouter(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XAxis_Switch_Config *pConfig; + + if(pVprocss->router) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXIS Switch core.... \r\n"); + pConfig = XAxisScr_LookupConfig(pVprocss->Config.Router.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: AXIS Switch device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.Router.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: AXIS Switch core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XAxisScr_CfgInitialize(pVprocss->router, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: AXIS Switch Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitCsc(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XV_csc_Config *pConfig; + + if(pVprocss->csc) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing CSC core.... \r\n"); + pConfig = XV_csc_LookupConfig(pVprocss->Config.Csc.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: CSC device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.Csc.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: CSC core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XV_csc_CfgInitialize(pVprocss->csc, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: CSC Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitHScaler(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XV_hscaler_Config *pConfig; + + if(pVprocss->hscaler) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Horiz. Scaler core.... \r\n"); + pConfig = XV_hscaler_LookupConfig(pVprocss->Config.Hscale.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: Horiz. Scaler device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.Hscale.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Horiz. Scaler core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XV_hscaler_CfgInitialize(pVprocss->hscaler, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Horiz. Scaler Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitVScaler(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XV_vscaler_Config *pConfig; + + if(pVprocss->vscaler) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Vert. Scaler core.... \r\n"); + pConfig = XV_vscaler_LookupConfig(pVprocss->Config.Vscale.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: Vert. Scaler device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.Vscale.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Vert. Scaler core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XV_vscaler_CfgInitialize(pVprocss->vscaler, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Vert. Scaler Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitHCrsmplr(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XV_hcresampler_Config *pConfig; + + if(pVprocss->hcrsmplr) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing H Chroma Resampler core.... \r\n"); + pConfig = XV_hcresampler_LookupConfig(pVprocss->Config.HCrsmplr.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: H Chroma Resampler device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.HCrsmplr.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: H Chroma Resampler core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XV_hcresampler_CfgInitialize(pVprocss->hcrsmplr, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: H Chroma Resampler Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitVCrsmpleIn(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XV_vcresampler_Config *pConfig; + + if(pVprocss->vcrsmplrIn) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Input V Chroma Resampler core.... \r\n"); + pConfig = XV_vcresampler_LookupConfig(pVprocss->Config.VCrsmplrIn.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: Input V Chroma Resampler device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.VCrsmplrIn.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Input V Chroma Resampler core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XV_vcresampler_CfgInitialize(pVprocss->vcrsmplrIn, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Input V Chroma Resampler Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitVCrsmpleOut(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XV_vcresampler_Config *pConfig; + + if(pVprocss->vcrsmplrOut) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Output V Chroma Resampler core.... \r\n"); + pConfig = XV_vcresampler_LookupConfig(pVprocss->Config.VCrsmplrOut.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: Output V Chroma Resampler device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.VCrsmplrOut.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Output V Chroma Resampler core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XV_vcresampler_CfgInitialize(pVprocss->vcrsmplrOut, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Output V Chroma Resampler Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitLetterbox(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XV_letterbox_Config *pConfig; + + if(pVprocss->lbox) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Letterbox core.... \r\n"); + pConfig = XV_letterbox_LookupConfig(pVprocss->Config.Lbox.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: Letterbox device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.Lbox.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Letterbox core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XV_letterbox_CfgInitialize(pVprocss->lbox, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Letterbox Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitVdma(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XAxiVdma_Config *pConfig; + + if(pVprocss->vdma) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing VDMA core.... \r\n"); + pConfig = XAxiVdma_LookupConfig(pVprocss->Config.Vdma.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: VDMA device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.Vdma.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: VDMA core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XAxiVdma_CfgInitialize(pVprocss->vdma, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: VDMA Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* This function initializes the included sub-core to it's static configuration +* +* @param pVprocss is a pointer to the Subsystem instance to be worked on. +* +* @return XST_SUCCESS/XST_FAILURE +* +******************************************************************************/ +int XVprocss_SubcoreInitDeinterlacer(XVprocss *pVprocss) +{ + int status; + u32 AbsAddr; + XV_deinterlacer_Config *pConfig; + + if(pVprocss->deint) + { + /* Get core configuration */ + xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Deinterlacer core.... \r\n"); + pConfig = XV_deinterlacer_LookupConfig(pVprocss->Config.Deint.DeviceId); + if(pConfig == NULL) + { + xil_printf("VPROCSS ERR:: Deinterlacer device not found\r\n"); + return(XST_FAILURE); + } + + /* Compute absolute base address */ + AbsAddr = 0; + status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress, + pVprocss->Config.HighAddress, + pVprocss->Config.Deint.AddrOffset, + &AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Deinterlacer core base address (0x%x) invalid %d\r\n", AbsAddr); + return(XST_FAILURE); + } + + /* Initialize core */ + status = XV_deinterlacer_CfgInitialize(pVprocss->deint, + pConfig, + AbsAddr); + + if(status != XST_SUCCESS) + { + xil_printf("VPROCSS ERR:: Deinterlacer Initialization failed\r\n"); + return(XST_FAILURE); + } + } + return(XST_SUCCESS); +} +/** @} */ \ No newline at end of file diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.h b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.h new file mode 100644 index 00000000..c5e0c231 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.h @@ -0,0 +1,82 @@ +/****************************************************************************** + * + * Copyright (C) 2015 Xilinx, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * Use of the Software is limited solely to applications: + * (a) running on a Xilinx device, or + * (b) that interact with a Xilinx device through a bus or interconnect. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of the Xilinx shall not be used + * in advertising or otherwise to promote the sale, use or other dealings in + * this Software without prior written authorization from Xilinx. + * +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file xvprocss_coreinit.h +* @addtogroup vprocss +* @{ +* @details +* +* This header file contains the video processing engine sub-cores +* initialization routines and helper functions. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ---- -------- -------------------------------------------------------
+* 1.00  rco  07/21/15   Initial Release
+
+* 
+* +******************************************************************************/ +#ifndef XVPROCSS_COREINIT_H__ /* prevent circular inclusions */ +#define XVPROCSS_COREINIT_H__ /* by using protection macros */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "xvprocss.h" +/************************** Constant Definitions *****************************/ + +/************************** Function Prototypes ******************************/ +int XVprocss_SubcoreInitResetAxis(XVprocss *pVprocss); +int XVprocss_SubcoreInitResetAximm(XVprocss *pVprocss); +int XVprocss_SubcoreInitRouter(XVprocss *pVprocss); +int XVprocss_SubcoreInitCsc(XVprocss *pVprocss); +int XVprocss_SubcoreInitHScaler(XVprocss *pVprocss); +int XVprocss_SubcoreInitVScaler(XVprocss *pVprocss); +int XVprocss_SubcoreInitHCrsmplr(XVprocss *pVprocss); +int XVprocss_SubcoreInitVCrsmpleIn(XVprocss *pVprocss); +int XVprocss_SubcoreInitVCrsmpleOut(XVprocss *pVprocss); +int XVprocss_SubcoreInitLetterbox(XVprocss *pVprocss); +int XVprocss_SubcoreInitVdma(XVprocss *pVprocss); +int XVprocss_SubcoreInitDeinterlacer(XVprocss *pVprocss); + +#ifdef __cplusplus +} +#endif + +#endif +/** @} */ diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_g.c b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_g.c new file mode 100644 index 00000000..337c1f87 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_g.c @@ -0,0 +1,144 @@ + +/******************************************************************* +* +* CAUTION: This file is automatically generated by HSI. +* Version: +* DO NOT EDIT. +* +* Copyright (C) 2010-2015 Xilinx, Inc. All Rights Reserved.* +*Permission is hereby granted, free of charge, to any person obtaining a copy +*of this software and associated documentation files (the Software), to deal +*in the Software without restriction, including without limitation the rights +*to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +*copies of the Software, and to permit persons to whom the Software is +*furnished to do so, subject to the following conditions: +* +*The above copyright notice and this permission notice shall be included in +*all copies or substantial portions of the Software. +* +* Use of the Software is limited solely to applications: +*(a) running on a Xilinx device, or +*(b) that interact with a Xilinx device through a bus or interconnect. +* +*THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +*IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +*FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +*XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +*WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +*OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +* +*Except as contained in this notice, the name of the Xilinx shall not be used +*in advertising or otherwise to promote the sale, use or other dealings in +*this Software without prior written authorization from Xilinx. +* + +* +* Description: Driver configuration +* +*******************************************************************/ + +#include "xparameters.h" +#include "xvprocss.h" + +/* +* List of Sub-cores included in the subsystem +* Sub-core device id will be set by its driver in xparameters.h +*/ + +#define XPAR_V_PROC_SS_0_AXI_VDMA_PRESENT 1 +#define XPAR_V_PROC_SS_0_RESET_SEL_AXI_MM_PRESENT 1 +#define XPAR_V_PROC_SS_0_RESET_SEL_AXIS_PRESENT 1 +#define XPAR_V_PROC_SS_0_V_CSC_PRESENT 1 +#define XPAR_V_PROC_SS_0_V_DEINTERLACER_PRESENT 1 +#define XPAR_V_PROC_SS_0_V_HCRESAMPLER_PRESENT 1 +#define XPAR_V_PROC_SS_0_V_HSCALER_PRESENT 1 +#define XPAR_V_PROC_SS_0_V_LETTERBOX_PRESENT 1 +#define XPAR_V_PROC_SS_0_V_VCRESAMPLER_0_PRESENT 1 +#define XPAR_V_PROC_SS_0_V_VCRESAMPLER_1_PRESENT 1 +#define XPAR_V_PROC_SS_0_V_VSCALER_PRESENT 1 +#define XPAR_V_PROC_SS_0_AXIS_SWITCH_PRESENT 1 + +/* +* List of Sub-cores excluded from the subsystem +* - Excluded sub-core device id is set to 255 +* - Excluded sub-core baseaddr is set to 0 +*/ + + + + +XVprocss_Config XVprocss_ConfigTable[] = +{ + { + XPAR_V_PROC_SS_0_DEVICE_ID, + XPAR_V_PROC_SS_0_BASEADDR, + XPAR_V_PROC_SS_0_HIGHADDR, + XPAR_V_PROC_SS_0_TOPOLOGY, + XPAR_V_PROC_SS_0_SAMPLES_PER_CLK, + XPAR_V_PROC_SS_0_MAX_DATA_WIDTH, + XPAR_V_PROC_SS_0_NUM_VIDEO_COMPONENTS, + XPAR_V_PROC_SS_0_MAX_COLS, + XPAR_V_PROC_SS_0_MAX_ROWS, + + { + XPAR_V_PROC_SS_0_RESET_SEL_AXI_MM_PRESENT, + XPAR_V_PROC_SS_0_RESET_SEL_AXI_MM_DEVICE_ID, + XPAR_V_PROC_SS_0_RESET_SEL_AXI_MM_BASEADDR + }, + { + XPAR_V_PROC_SS_0_RESET_SEL_AXIS_PRESENT, + XPAR_V_PROC_SS_0_RESET_SEL_AXIS_DEVICE_ID, + XPAR_V_PROC_SS_0_RESET_SEL_AXIS_BASEADDR + }, + { + XPAR_V_PROC_SS_0_AXI_VDMA_PRESENT, + XPAR_V_PROC_SS_0_AXI_VDMA_DEVICE_ID, + XPAR_V_PROC_SS_0_AXI_VDMA_BASEADDR + }, + { + XPAR_V_PROC_SS_0_AXIS_SWITCH_PRESENT, + XPAR_V_PROC_SS_0_AXIS_SWITCH_DEVICE_ID, + XPAR_V_PROC_SS_0_AXIS_SWITCH_BASEADDR + }, + { + XPAR_V_PROC_SS_0_V_CSC_PRESENT, + XPAR_V_PROC_SS_0_V_CSC_DEVICE_ID, + XPAR_V_PROC_SS_0_V_CSC_S_AXI_CTRL_BASEADDR + }, + { + XPAR_V_PROC_SS_0_V_DEINTERLACER_PRESENT, + XPAR_V_PROC_SS_0_V_DEINTERLACER_DEVICE_ID, + XPAR_V_PROC_SS_0_V_DEINTERLACER_S_AXI_AXILITES_BASEADDR + }, + { + XPAR_V_PROC_SS_0_V_HCRESAMPLER_PRESENT, + XPAR_V_PROC_SS_0_V_HCRESAMPLER_DEVICE_ID, + XPAR_V_PROC_SS_0_V_HCRESAMPLER_S_AXI_CTRL_BASEADDR + }, + { + XPAR_V_PROC_SS_0_V_HSCALER_PRESENT, + XPAR_V_PROC_SS_0_V_HSCALER_DEVICE_ID, + XPAR_V_PROC_SS_0_V_HSCALER_S_AXI_CTRL_BASEADDR + }, + { + XPAR_V_PROC_SS_0_V_LETTERBOX_PRESENT, + XPAR_V_PROC_SS_0_V_LETTERBOX_DEVICE_ID, + XPAR_V_PROC_SS_0_V_LETTERBOX_S_AXI_CTRL_BASEADDR + }, + { + XPAR_V_PROC_SS_0_V_VCRESAMPLER_0_PRESENT, + XPAR_V_PROC_SS_0_V_VCRESAMPLER_0_DEVICE_ID, + XPAR_V_PROC_SS_0_V_VCRESAMPLER_0_S_AXI_CTRL_BASEADDR + }, + { + XPAR_V_PROC_SS_0_V_VCRESAMPLER_1_PRESENT, + XPAR_V_PROC_SS_0_V_VCRESAMPLER_1_DEVICE_ID, + XPAR_V_PROC_SS_0_V_VCRESAMPLER_1_S_AXI_CTRL_BASEADDR + }, + { + XPAR_V_PROC_SS_0_V_VSCALER_PRESENT, + XPAR_V_PROC_SS_0_V_VSCALER_DEVICE_ID, + XPAR_V_PROC_SS_0_V_VSCALER_S_AXI_CTRL_BASEADDR + }, + } +}; diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.c b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.c index 6d0a068d..21b37aba 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.c +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.c @@ -33,8 +33,9 @@ /** * * @file xvprocss_router.c -* @addtogroup vprocss_v1_0 +* @addtogroup vprocss * @{ +* @details * Video buffer management routine. * The functions in this file provides an abstraction from the register peek/poke @@ -45,7 +46,7 @@ * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- -* 1.00 rc 05/18/15 Initial Release +* 1.00 rco 07/21/15 Initial Release * * @@ -54,7 +55,8 @@ /***************************** Include Files *********************************/ #include "xvidc.h" #include "xvprocss_router.h" -#include "xvprocss_dma.h" +#include "xvprocss_vdma.h" + /************************** Constant Definitions *****************************/ /* AXIS Switch Port# connected to input stream */ #define AXIS_SWITCH_VIDIN_S0 (0) @@ -156,8 +158,8 @@ static XVprocss_ScaleMode GetScalingMode(XVprocss *pVprocss) XVprocss_GetZoomPipWindow(pVprocss, XVPROCSS_ZOOM_WIN, &win); /* validate window */ status = validateWindowSize(&win, - pStrIn->Timing.HActive, - pStrIn->Timing.VActive); + pStrIn->Timing.HActive, + pStrIn->Timing.VActive); if(status != XST_SUCCESS) { xil_printf("ERR:: VDMA Read Channel Window Invalid \r\n"); @@ -564,11 +566,11 @@ void XVprocss_SetupRouterDataFlow(XVprocss *pVprocss) { case XVPROCSS_SCALE_1_1: case XVPROCSS_SCALE_UP: - XVprocss_SetVdmaWinToUpScaleMode(pVprocss, XVPROCSS_VDMA_UPDATE_ALL_CH); + XVprocss_VdmaSetWinToUpScaleMode(pVprocss, XVPROCSS_VDMA_UPDATE_ALL_CH); break; case XVPROCSS_SCALE_DN: - XVprocss_SetVdmaWinToDnScaleMode(pVprocss, XVPROCSS_VDMA_UPDATE_ALL_CH); + XVprocss_VdmaSetWinToDnScaleMode(pVprocss, XVPROCSS_VDMA_UPDATE_ALL_CH); break; default: diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.h b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.h index 69a9ee9c..9e2a9af1 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.h +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.h @@ -33,8 +33,9 @@ /** * * @file xvprocss_router.h -* @addtogroup vprocss_v1_0 +* @addtogroup vprocss * @{ +* @details * * This header file contains the video processing engine data flow setup * routines and helper functions. @@ -44,7 +45,7 @@ * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- -* 1.00 rc 05/18/15 Initial Release +* 1.00 rco 07/21/15 Initial Release * * @@ -56,7 +57,6 @@ extern "C" { #endif -//#include "xaxivdma.h" #include "xvprocss.h" /************************** Constant Definitions *****************************/ diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_sinit.c b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_sinit.c index 2e70967f..ffc10768 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_sinit.c +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_sinit.c @@ -33,8 +33,9 @@ /** * * @file xvprocss_sinit.c -* @addtogroup vprocss_v1_0 +* @addtogroup vprocss * @{ +* @details * * This file contains the implementation of the Video Processing Subsystem * driver's static initialization functionality. @@ -44,7 +45,7 @@ * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- -* 1.00 rc 05/01/15 Initial Release +* 1.00 rco 07/21/15 Initial Release * * @@ -55,8 +56,6 @@ #include "xvprocss.h" /************************** Constant Definitions *****************************/ -//ToDo: This will be exported to xparameters.h -#define XPAR_XDSPSS_NUM_INSTANCES (1) /**************************** Type Definitions *******************************/ @@ -68,7 +67,7 @@ /************************** Function Prototypes ******************************/ /************************** Variable Definitions *****************************/ -extern XVprocss_Config XVprocss_ConfigTable[XPAR_XDSPSS_NUM_INSTANCES]; +extern XVprocss_Config XVprocss_ConfigTable[]; /*****************************************************************************/ /** @@ -87,7 +86,7 @@ XVprocss_Config* XVprocss_LookupConfig(u32 DeviceId) XVprocss_Config *CfgPtr = NULL; u32 index; - for (index = 0U; index < (u32)XPAR_XDSPSS_NUM_INSTANCES; index++) + for (index = 0U; index < (u32)XPAR_XVPROCSS_NUM_INSTANCES; index++) { if (XVprocss_ConfigTable[index].DeviceId == DeviceId) {