v_hdmitxss: Improved stability.

Contributions from Marco Groeneveld (mgroenev@xilinx.com).

Signed-off-by: Andrei-Liviu Simion <andrei.simion@xilinx.com>
Acked-by: Srikanth Vemula <svemula@xilinx.com>
This commit is contained in:
Gilbert Magnaye 2015-11-12 23:24:08 -08:00 committed by Nava kishore Manne
parent 9f2f544754
commit b695b55fcc
8 changed files with 744 additions and 723 deletions

View file

@ -39,27 +39,27 @@
proc generate {drv_handle} {
::hsi::utils::define_include_file $drv_handle "xparameters.h" "XV_HdmiTxSs" \
"NUM_INSTANCES" \
"C_BASEADDR" \
"C_HIGHADDR" \
"DEVICE_ID" \
"C_INPUT_PIXELS_PER_CLOCK" \
"C_MAX_BITS_PER_COMPONENT"
"NUM_INSTANCES" \
"C_BASEADDR" \
"C_HIGHADDR" \
"DEVICE_ID" \
"C_INPUT_PIXELS_PER_CLOCK" \
"C_MAX_BITS_PER_COMPONENT"
hier_ip_define_config_file $drv_handle "xv_hdmitxss_g.c" "XV_HdmiTxSs" \
"DEVICE_ID" \
"C_BASEADDR" \
"C_HIGHADDR" \
"C_INPUT_PIXELS_PER_CLOCK" \
"C_MAX_BITS_PER_COMPONENT"
"DEVICE_ID" \
"C_BASEADDR" \
"C_HIGHADDR" \
"C_INPUT_PIXELS_PER_CLOCK" \
"C_MAX_BITS_PER_COMPONENT"
::hsi::utils::define_canonical_xpars $drv_handle "xparameters.h" \
"XV_HdmiTxSs" \
"C_BASEADDR" \
"C_HIGHADDR" \
"DEVICE_ID" \
"C_INPUT_PIXELS_PER_CLOCK" \
"C_MAX_BITS_PER_COMPONENT"
"XV_HdmiTxSs" \
"C_BASEADDR" \
"C_HIGHADDR" \
"DEVICE_ID" \
"C_INPUT_PIXELS_PER_CLOCK" \
"C_MAX_BITS_PER_COMPONENT"
}
@ -81,12 +81,12 @@ proc hier_ip_define_config_file {drv_handle file_name drv_string args} {
set periphs_g [::hsi::utils::get_common_driver_ips $drv_handle]
array set sub_core_inst {
axi_timer 1
hdcp 1
v_hdmi_tx 1
v_tc 1
}
array set sub_core_inst {
axi_timer 1
hdcp 1
v_hdmi_tx 1
v_tc 1
}
#MAGS
#foreach name [array names sub_core_inst] {
@ -94,113 +94,113 @@ proc hier_ip_define_config_file {drv_handle file_name drv_string args} {
#}
foreach periph_g $periphs_g {
set mem_ranges [::hsi::get_mem_ranges $periph_g]
set mem_ranges [::hsi::get_mem_ranges $periph_g]
::hsi::current_hw_instance $periph_g;
::hsi::current_hw_instance $periph_g;
set child_cells_g [::hsi::get_cells -hier]
set child_cells_g [::hsi::get_cells -hier]
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 :]
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]
lassign $vlnv_arr ip_vendor ip_library ip_name ip_version
set ip_type_g [common::get_property IP_TYPE $child_cell_g]
puts "IP type $ip_type_g\n"
if { [string compare -nocase "BUS" $ip_type_g] != 0 } {
set interfaces [hsi::get_intf_pins -of_objects $child_cell_g]
set is_slave 0
puts "IP type $ip_type_g\n"
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"
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"
#puts $config_file "//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"
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
}
}
}
# 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"
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]] {
foreach sub_core [lsort [array names sub_core_inst]] {
#puts $config_file "//sub_core_inst: $sub_core $sub_core_inst($sub_core)"
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]
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"
#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"
}
#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 -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 "\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]
@ -238,115 +238,115 @@ proc hier_ip_define_config_file {drv_handle file_name drv_string args} {
set comma ",\n"
}
::hsi::current_hw_instance $periph
set child_cells [::hsi::get_cells -hier]
puts $config_file ",\n"
::hsi::current_hw_instance $periph
set child_cells [::hsi::get_cells -hier]
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"
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 match -nocase v_t* $sub_core]} {
set base_addr_name "BASEADDR"
} elseif {[string match -nocase v_* $sub_core]} {
set base_addr_name "BASEADDR"
} else {
set base_addr_name "BASEADDR"
}
if {[dict exists $ss_ip_list $sub_core]} {
#puts "****Sub-core found in dictionary****"
if {[string match -nocase v_t* $sub_core]} {
set base_addr_name "BASEADDR"
} elseif {[string match -nocase v_* $sub_core]} {
set base_addr_name "BASEADDR"
} else {
set base_addr_name "BASEADDR"
}
set ip_instances [dict get $ss_ip_list $sub_core]
set avail_instances [llength $ip_instances]
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 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}"
#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\},"
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 {
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
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"
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
}
}
}
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
::hsi::current_hw_instance
puts -nonewline $config_file "\t\}"
set start_comma ",\n"
puts -nonewline $config_file "\t\}"
set start_comma ",\n"
}
puts $config_file "\n\};"

10
XilinxProcessorIPLib/drivers/v_hdmitxss/src/Makefile Executable file → Normal file
View file

@ -22,19 +22,19 @@ OBJECTS = $(addsuffix .o, $(basename $(wildcard *.c)))
libs: banner xvhdmitxss_libs clean
%.o: %.c
${COMPILER} $(CC_FLAGS) $(ECC_FLAGS) $(INCLUDES) -o $@ $<
${COMPILER} $(CC_FLAGS) $(ECC_FLAGS) $(INCLUDES) -o $@ $<
banner:
echo "Compiling HDMI TX Subsystem"
echo "Compiling HDMI TX Subsystem"
xvhdmitxss_libs: ${OBJECTS}
$(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OBJECTS}
$(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OBJECTS}
.PHONY: include
include: xvhdmitxss_includes
xvhdmitxss_includes:
${CP} ${INCLUDEFILES} ${INCLUDEDIR}
${CP} ${INCLUDEFILES} ${INCLUDEDIR}
clean:
rm -rf ${OBJECTS}
rm -rf ${OBJECTS}

758
XilinxProcessorIPLib/drivers/v_hdmitxss/src/xv_hdmitxss.c Executable file → Normal file

File diff suppressed because it is too large Load diff

123
XilinxProcessorIPLib/drivers/v_hdmitxss/src/xv_hdmitxss.h Executable file → Normal file
View file

@ -45,12 +45,12 @@
* <b>Subsystem Driver Features</b>
*
* HDMI Subsystem supports following features
* - AXI Stream Input/Output interface
* - 1, 2 or 4 pixel-wide video interface
* - 8/10/12/16 bits per component
* - RGB & YCbCr color space
* - Up to 4k2k 60Hz resolution at both Input and Output interface
* - Interlaced input support (1080i 50Hz/60Hz)
* - AXI Stream Input/Output interface
* - 1, 2 or 4 pixel-wide video interface
* - 8/10/12/16 bits per component
* - RGB & YCbCr color space
* - Up to 4k2k 60Hz resolution at both Input and Output interface
* - Interlaced input support (1080i 50Hz/60Hz)
* <pre>
* MODIFICATION HISTORY:
@ -92,10 +92,10 @@ extern "C" {
* interrupt requests from peripheral.
*/
typedef enum {
XV_HDMITXSS_HANDLER_CONNECT = 1, /**< Handler for connect */
XV_HDMITXSS_HANDLER_VS, /**< Handler for vsync */
XV_HDMITXSS_HANDLER_STREAM_DOWN, /**< Handler for stream down */
XV_HDMITXSS_HANDLER_STREAM_UP /**< Handler for stream up */
XV_HDMITXSS_HANDLER_CONNECT = 1, /**< Handler for connect */
XV_HDMITXSS_HANDLER_VS, /**< Handler for vsync */
XV_HDMITXSS_HANDLER_STREAM_DOWN, /**< Handler for stream down */
XV_HDMITXSS_HANDLER_STREAM_UP /**< Handler for stream up */
} XV_HdmiTxSs_HandlerType;
/*@}*/
@ -117,17 +117,17 @@ typedef struct
typedef struct
{
u16 DeviceId; /**< DeviceId is the unique ID of the device */
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 */
u16 DeviceId; /**< DeviceId is the unique ID of the device */
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 */
XVidC_PixelsPerClock Ppc; /**< Supported Pixel per Clock */
u8 MaxBitsPerPixel; /**< Maximum Supported Color Depth */
XV_HdmiTxSs_SubCore HdcpTimer; /**< Sub-core instance configuration */
XV_HdmiTxSs_SubCore Hdcp; /**< Sub-core instance configuration */
XV_HdmiTxSs_SubCore HdmiTx; /**< Sub-core instance configuration */
XV_HdmiTxSs_SubCore Vtc; /**< Sub-core instance configuration */
u8 MaxBitsPerPixel; /**< Maximum Supported Color Depth */
XV_HdmiTxSs_SubCore HdcpTimer; /**< Sub-core instance configuration */
XV_HdmiTxSs_SubCore Hdcp; /**< Sub-core instance configuration */
XV_HdmiTxSs_SubCore HdmiTx; /**< Sub-core instance configuration */
XV_HdmiTxSs_SubCore Vtc; /**< Sub-core instance configuration */
} XV_HdmiTxSs_Config;
/**
@ -151,43 +151,43 @@ typedef void (*XV_HdmiTxSs_Callback)(void *CallbackRef);
*/
typedef struct
{
XV_HdmiTxSs_Config Config; /**< Hardware configuration */
u32 IsReady; /**< Device and the driver instance are initialized */
XV_HdmiTxSs_Config Config; /**< Hardware configuration */
u32 IsReady; /**< Device and the driver instance are initialized */
XTmrCtr *HdcpTimerPtr; /**< handle to sub-core driver instance */
XHdcp1x *HdcpPtr; /**< handle to sub-core driver instance */
XV_HdmiTx *HdmiTxPtr; /**< handle to sub-core driver instance */
XVtc *VtcPtr; /**< handle to sub-core driver instance */
XTmrCtr *HdcpTimerPtr; /**< handle to sub-core driver instance */
XHdcp1x *HdcpPtr; /**< handle to sub-core driver instance */
XV_HdmiTx *HdmiTxPtr; /**< handle to sub-core driver instance */
XVtc *VtcPtr; /**< handle to sub-core driver instance */
/* Callbacks */
XV_HdmiTxSs_Callback ConnectCallback; /**< Callback for connect
* event interrupt */
void *ConnectRef; /**< To be passed to the connect
* interrupt callback */
/* Callbacks */
XV_HdmiTxSs_Callback ConnectCallback; /**< Callback for connect
* event interrupt */
void *ConnectRef; /**< To be passed to the connect
* interrupt callback */
XV_HdmiTxSs_Callback VsCallback; /**< Callback for Vsync event interrupt */
void *VsRef; /**< To be passed to the Vsync interrupt callback */
XV_HdmiTxSs_Callback VsCallback; /**< Callback for Vsync event interrupt */
void *VsRef; /**< To be passed to the Vsync interrupt callback */
XV_HdmiTxSs_Callback StreamDownCallback; /**< Callback for stream
* down callback */
void *StreamDownRef; /**< To be passed to the stream down callback */
XV_HdmiTxSs_Callback StreamDownCallback; /**< Callback for stream
* down callback */
void *StreamDownRef; /**< To be passed to the stream down callback */
XV_HdmiTxSs_Callback StreamUpCallback; /**< Callback for stream up
* callback */
void *StreamUpRef; /**< To be passed to the stream up callback */
XV_HdmiTxSs_Callback StreamUpCallback; /**< Callback for stream up
* callback */
void *StreamUpRef; /**< To be passed to the stream up callback */
/**< Scratch pad */
u8 SamplingRate; /**< HDMI TX Sampling rate */
u8 IsStreamConnected; /**< HDMI TX Stream Connected */
u8 AudioEnabled; /**< HDMI TX Audio Enabled */
u8 AudioMute; /**< HDMI TX Audio Mute */
u8 AudioChannels; /**< Number of Audio Channels */
/**< Scratch pad */
u8 SamplingRate; /**< HDMI TX Sampling rate */
u8 IsStreamConnected; /**< HDMI TX Stream Connected */
u8 AudioEnabled; /**< HDMI TX Audio Enabled */
u8 AudioMute; /**< HDMI TX Audio Mute */
u8 AudioChannels; /**< Number of Audio Channels */
XVidC_DelayHandler UserTimerWaitUs; /**< Custom user function for
delay/sleep. */
void *UserTimerPtr; /**< Pointer to a timer instance
used by the custom user
delay/sleep function. */
XVidC_DelayHandler UserTimerWaitUs; /**< Custom user function for
delay/sleep. */
void *UserTimerPtr; /**< Pointer to a timer instance
used by the custom user
delay/sleep function. */
} XV_HdmiTxSs;
/************************** Macros Definitions *******************************/
@ -196,20 +196,20 @@ typedef struct
XV_HdmiTxSs_Config *XV_HdmiTxSs_LookupConfig(u32 DeviceId);
void XV_HdmiTxSs_ReportCoreInfo(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_SetUserTimerHandler(XV_HdmiTxSs *InstancePtr,
XVidC_DelayHandler CallbackFunc, void *CallbackRef);
XVidC_DelayHandler CallbackFunc, void *CallbackRef);
void XV_HdmiTxSS_HdmiTxIntrHandler(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSS_HdcpIntrHandler(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSS_HdcpTimerIntrHandler(XV_HdmiTxSs *InstancePtr);
int XV_HdmiTxSs_CfgInitialize(XV_HdmiTxSs *InstancePtr,
XV_HdmiTxSs_Config *CfgPtr,
u32 EffectiveAddr);
XV_HdmiTxSs_Config *CfgPtr,
u32 EffectiveAddr);
void XV_HdmiTxSs_Start(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_Stop(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_Reset(XV_HdmiTxSs *InstancePtr);
int XV_HdmiTxSs_SetCallback(XV_HdmiTxSs *InstancePtr,
u32 HandlerType,
void *CallbackFuncPtr,
void *CallbackRef);
u32 HandlerType,
void *CallbackFuncPtr,
void *CallbackRef);
int XV_HdmiTxSs_ReadEdid(XV_HdmiTxSs *InstancePtr, u8 *BufferPtr);
void XV_HdmiTxSs_ShowEdid(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_StreamStart(XV_HdmiTxSs *InstancePtr);
@ -217,19 +217,18 @@ void XV_HdmiTxSs_SendAuxInfoframe(XV_HdmiTxSs *InstancePtr, void *AuxPtr);
void XV_HdmiTxSs_SetAudioChannels(XV_HdmiTxSs *InstancePtr, u8 AudioChannels);
void XV_HdmiTxSs_AudioMute(XV_HdmiTxSs *InstancePtr, u8 Enable);
u32 XV_HdmiTxSs_SetStream(XV_HdmiTxSs *InstancePtr,
XVidC_VideoMode VideoMode,
XVidC_ColorFormat ColorFormat,
XVidC_ColorDepth Bpc,
XVidC_PixelsPerClock Ppc);
XVidC_VideoMode VideoMode,
XVidC_ColorFormat ColorFormat,
XVidC_ColorDepth Bpc);
u32 XV_HdmiTxSs_SetStreamReducedBlanking(XV_HdmiTxSs *InstancePtr);
XVidC_VideoStream *XV_HdmiTxSs_GetVideoStream(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_SetVideoStream(XV_HdmiTxSs *InstancePtr,
XVidC_VideoStream VidStream);
XVidC_VideoStream VidStream);
void XV_HdmiTxSs_SetSamplingRate(XV_HdmiTxSs *InstancePtr, u8 SamplingRate);
void XV_HdmiTxSs_SetVideoIDCode(XV_HdmiTxSs *InstancePtr, u8 Vic);
void XV_HdmiTxSs_SetVideoStreamType(XV_HdmiTxSs *InstancePtr, u8 StreamType);
void XV_HdmiTxSs_SetVideoStreamScramblingFlag(XV_HdmiTxSs *InstancePtr,
u8 IsScrambled);
u8 IsScrambled);
void XV_HdmiTxSs_SetTmdsClockRatio(XV_HdmiTxSs *InstancePtr, u8 Ratio);
u32 XV_HdmiTxSs_GetTmdsClockFreqHz(XV_HdmiTxSs *InstancePtr);
int XV_HdmiTxSs_DetectHdmi20(XV_HdmiTxSs *InstancePtr);

View file

@ -63,9 +63,9 @@
/************************** Function Prototypes ******************************/
static int XV_HdmiTxSs_ComputeSubcoreAbsAddr(u32 SubSys_BaseAddr,
u32 SubSys_HighAddr,
u32 SubCore_Offset,
u32 *SubCore_BaseAddr);
u32 SubSys_HighAddr,
u32 SubCore_Offset,
u32 *SubCore_BaseAddr);
/*****************************************************************************/
/**
@ -85,9 +85,9 @@ static int XV_HdmiTxSs_ComputeSubcoreAbsAddr(u32 SubSys_BaseAddr,
*
******************************************************************************/
static int XV_HdmiTxSs_ComputeSubcoreAbsAddr(u32 SubSys_BaseAddr,
u32 SubSys_HighAddr,
u32 SubCore_Offset,
u32 *SubCore_BaseAddr)
u32 SubSys_HighAddr,
u32 SubCore_Offset,
u32 *SubCore_BaseAddr)
{
int Status;
u32 AbsAddr;
@ -98,8 +98,8 @@ static int XV_HdmiTxSs_ComputeSubcoreAbsAddr(u32 SubSys_BaseAddr,
Status = XST_SUCCESS;
}
else {
*SubCore_BaseAddr = 0;
Status = XST_FAILURE;
*SubCore_BaseAddr = 0;
Status = XST_FAILURE;
}
return(Status);
@ -121,7 +121,7 @@ int XV_HdmiTxSs_SubcoreInitHdmiTx(XV_HdmiTxSs *HdmiTxSsPtr)
XV_HdmiTx_Config *ConfigPtr;
if (HdmiTxSsPtr->HdmiTxPtr) {
/* Get core configuration */
/* Get core configuration */
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing HDMI TX core.... \r\n");
ConfigPtr = XV_HdmiTx_LookupConfig(HdmiTxSsPtr->Config.HdmiTx.DeviceId);
if (ConfigPtr == NULL) {
@ -129,20 +129,20 @@ int XV_HdmiTxSs_SubcoreInitHdmiTx(XV_HdmiTxSs *HdmiTxSsPtr)
return(XST_FAILURE);
}
/* Compute absolute base address */
/* Compute absolute base address */
AbsAddr = 0;
Status = XV_HdmiTxSs_ComputeSubcoreAbsAddr(HdmiTxSsPtr->Config.BaseAddress,
HdmiTxSsPtr->Config.HighAddress,
HdmiTxSsPtr->Config.HdmiTx.AddrOffset,
&AbsAddr);
HdmiTxSsPtr->Config.HighAddress,
HdmiTxSsPtr->Config.HdmiTx.AddrOffset,
&AbsAddr);
if (Status != XST_SUCCESS) {
xil_printf("HDMITXSS ERR:: HDMI TX core base address (0x%x) \
invalid %d\r\n", AbsAddr);
invalid %d\r\n", AbsAddr);
return(XST_FAILURE);
}
/* Initialize core */
/* Initialize core */
Status = XV_HdmiTx_CfgInitialize(HdmiTxSsPtr->HdmiTxPtr,
ConfigPtr,
AbsAddr);
@ -171,7 +171,7 @@ int XV_HdmiTxSs_SubcoreInitVtc(XV_HdmiTxSs *HdmiTxSsPtr)
XVtc_Config *ConfigPtr;
if (HdmiTxSsPtr->VtcPtr) {
/* Get core configuration */
/* Get core configuration */
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing VTC core.... \r\n");
ConfigPtr = XVtc_LookupConfig(HdmiTxSsPtr->Config.Vtc.DeviceId);
if (ConfigPtr == NULL) {
@ -179,20 +179,20 @@ int XV_HdmiTxSs_SubcoreInitVtc(XV_HdmiTxSs *HdmiTxSsPtr)
return(XST_FAILURE);
}
/* Compute absolute base address */
/* Compute absolute base address */
AbsAddr = 0;
Status = XV_HdmiTxSs_ComputeSubcoreAbsAddr(HdmiTxSsPtr->Config.BaseAddress,
HdmiTxSsPtr->Config.HighAddress,
HdmiTxSsPtr->Config.Vtc.AddrOffset,
&AbsAddr);
HdmiTxSsPtr->Config.HighAddress,
HdmiTxSsPtr->Config.Vtc.AddrOffset,
&AbsAddr);
if (Status != XST_SUCCESS) {
xil_printf("HDMITXSS ERR:: CSC core base address (0x%x) \
invalid %d\r\n", AbsAddr);
invalid %d\r\n", AbsAddr);
return(XST_FAILURE);
}
/* Initialize core */
/* Initialize core */
Status = XVtc_CfgInitialize(HdmiTxSsPtr->VtcPtr,
ConfigPtr,
AbsAddr);
@ -222,7 +222,7 @@ int XV_HdmiTxSs_SubcoreInitHdcpTimer(XV_HdmiTxSs *HdmiTxSsPtr)
XTmrCtr_Config *ConfigPtr;
if (HdmiTxSsPtr->HdcpTimerPtr) {
/* Get core configuration */
/* Get core configuration */
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXI Timer core.... \r\n");
ConfigPtr = XTmrCtr_LookupConfig(HdmiTxSsPtr->Config.HdcpTimer.DeviceId);
if (ConfigPtr == NULL) {
@ -230,30 +230,30 @@ int XV_HdmiTxSs_SubcoreInitHdcpTimer(XV_HdmiTxSs *HdmiTxSsPtr)
return(XST_FAILURE);
}
/* Compute absolute base address */
/* Compute absolute base address */
AbsAddr = 0;
Status = XV_HdmiTxSs_ComputeSubcoreAbsAddr(HdmiTxSsPtr->Config.BaseAddress,
HdmiTxSsPtr->Config.HighAddress,
HdmiTxSsPtr->Config.HdcpTimer.AddrOffset,
&AbsAddr);
HdmiTxSsPtr->Config.HighAddress,
HdmiTxSsPtr->Config.HdcpTimer.AddrOffset,
&AbsAddr);
if (Status != XST_SUCCESS) {
xil_printf("HDMITXSS ERR:: AXI Timer core base address (0x%x) \
invalid %d\r\n", AbsAddr);
invalid %d\r\n", AbsAddr);
return(XST_FAILURE);
}
/* Setup the instance */
memset(HdmiTxSsPtr->HdcpTimerPtr, 0, sizeof(XTmrCtr));
/* Setup the instance */
memset(HdmiTxSsPtr->HdcpTimerPtr, 0, sizeof(XTmrCtr));
/* Initialize core */
XTmrCtr_CfgInitialize(HdmiTxSsPtr->HdcpTimerPtr, ConfigPtr, AbsAddr);
Status = XTmrCtr_InitHw(HdmiTxSsPtr->HdcpTimerPtr);
/* Initialize core */
XTmrCtr_CfgInitialize(HdmiTxSsPtr->HdcpTimerPtr, ConfigPtr, AbsAddr);
Status = XTmrCtr_InitHw(HdmiTxSsPtr->HdcpTimerPtr);
/* Initialize the hdcp timer functions */
XHdcp1x_SetTimerStart(&XV_HdmiTxSs_HdcpTimerStart);
XHdcp1x_SetTimerStop(&XV_HdmiTxSs_HdcpTimerStop);
XHdcp1x_SetTimerDelay(&XV_HdmiTxSs_HdcpTimerBusyDelay);
/* Initialize the hdcp timer functions */
XHdcp1x_SetTimerStart(&XV_HdmiTxSs_HdcpTimerStart);
XHdcp1x_SetTimerStop(&XV_HdmiTxSs_HdcpTimerStop);
XHdcp1x_SetTimerDelay(&XV_HdmiTxSs_HdcpTimerBusyDelay);
if (Status != XST_SUCCESS) {
xil_printf("HDMITXSS ERR:: AXI Timer Initialization failed\r\n");
@ -279,7 +279,7 @@ int XV_HdmiTxSs_SubcoreInitHdcp(XV_HdmiTxSs *HdmiTxSsPtr)
XHdcp1x_Config *ConfigPtr;
if (HdmiTxSsPtr->HdcpPtr){
/* Get core configuration */
/* Get core configuration */
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing HDCP core.... \r\n");
ConfigPtr = XHdcp1x_LookupConfig(HdmiTxSsPtr->Config.Hdcp.DeviceId);
if (ConfigPtr == NULL){
@ -287,38 +287,38 @@ int XV_HdmiTxSs_SubcoreInitHdcp(XV_HdmiTxSs *HdmiTxSsPtr)
return(XST_FAILURE);
}
/* Compute absolute base address */
/* Compute absolute base address */
AbsAddr = 0;
Status = XV_HdmiTxSs_ComputeSubcoreAbsAddr(HdmiTxSsPtr->Config.BaseAddress,
HdmiTxSsPtr->Config.HighAddress,
HdmiTxSsPtr->Config.Hdcp.AddrOffset,
&AbsAddr);
HdmiTxSsPtr->Config.HighAddress,
HdmiTxSsPtr->Config.Hdcp.AddrOffset,
&AbsAddr);
if (Status != XST_SUCCESS){
xil_printf("HDMITXSS ERR:: HDCP core base address (0x%x) invalid %d\r\n",
AbsAddr);
AbsAddr);
return(XST_FAILURE);
}
/* Initialize core */
/* Initialize core */
void *PhyIfPtr = HdmiTxSsPtr->HdmiTxPtr;
Status = XHdcp1x_CfgInitialize(HdmiTxSsPtr->HdcpPtr,
ConfigPtr,
PhyIfPtr,
AbsAddr);
AbsAddr);
/* Self-test the hdcp interface */
if (XHdcp1x_SelfTest(HdmiTxSsPtr->HdcpPtr) != XST_SUCCESS) {
Status = XST_FAILURE;
}
/* Self-test the hdcp interface */
if (XHdcp1x_SelfTest(HdmiTxSsPtr->HdcpPtr) != XST_SUCCESS) {
Status = XST_FAILURE;
}
if (Status != XST_SUCCESS) {
if (Status != XST_SUCCESS) {
xil_printf("HDMITXSS ERR:: HDCP Initialization failed\r\n");
return(XST_FAILURE);
}
XHdcp1x_SetKeySelect(HdmiTxSsPtr->HdcpPtr, XV_HDMITXSS_HDCP_KEYSEL);
XHdcp1x_SetKeySelect(HdmiTxSsPtr->HdcpPtr, XV_HDMITXSS_HDCP_KEYSEL);
}
return(XST_SUCCESS);
}

View file

View file

@ -74,32 +74,32 @@
XV_HdmiTxSs_Config XV_HdmiTxSs_ConfigTable[] =
{
{
XPAR_V_HDMI_TX_SS_0_DEVICE_ID,
XPAR_V_HDMI_TX_SS_0_BASEADDR,
XPAR_V_HDMI_TX_SS_0_HIGHADDR,
XPAR_V_HDMI_TX_SS_0_INPUT_PIXELS_PER_CLOCK,
XPAR_V_HDMI_TX_SS_0_MAX_BITS_PER_COMPONENT,
{
XPAR_V_HDMI_TX_SS_0_DEVICE_ID,
XPAR_V_HDMI_TX_SS_0_BASEADDR,
XPAR_V_HDMI_TX_SS_0_HIGHADDR,
XPAR_V_HDMI_TX_SS_0_INPUT_PIXELS_PER_CLOCK,
XPAR_V_HDMI_TX_SS_0_MAX_BITS_PER_COMPONENT,
{
XPAR_V_HDMI_TX_SS_0_AXI_TIMER_0_PRESENT,
XPAR_V_HDMI_TX_SS_0_AXI_TIMER_0_DEVICE_ID,
XPAR_V_HDMI_TX_SS_0_AXI_TIMER_0_BASEADDR
},
{
XPAR_V_HDMI_TX_SS_0_HDCP_0_PRESENT,
XPAR_V_HDMI_TX_SS_0_HDCP_0_DEVICE_ID,
XPAR_V_HDMI_TX_SS_0_HDCP_0_BASEADDR
},
{
XPAR_V_HDMI_TX_SS_0_V_HDMI_TX_PRESENT,
XPAR_V_HDMI_TX_SS_0_V_HDMI_TX_DEVICE_ID,
XPAR_V_HDMI_TX_SS_0_V_HDMI_TX_BASEADDR
},
{
XPAR_V_HDMI_TX_SS_0_V_TC_PRESENT,
XPAR_V_HDMI_TX_SS_0_V_TC_DEVICE_ID,
XPAR_V_HDMI_TX_SS_0_V_TC_BASEADDR
},
}
{
XPAR_V_HDMI_TX_SS_0_AXI_TIMER_0_PRESENT,
XPAR_V_HDMI_TX_SS_0_AXI_TIMER_0_DEVICE_ID,
XPAR_V_HDMI_TX_SS_0_AXI_TIMER_0_BASEADDR
},
{
XPAR_V_HDMI_TX_SS_0_HDCP_0_PRESENT,
XPAR_V_HDMI_TX_SS_0_HDCP_0_DEVICE_ID,
XPAR_V_HDMI_TX_SS_0_HDCP_0_BASEADDR
},
{
XPAR_V_HDMI_TX_SS_0_V_HDMI_TX_PRESENT,
XPAR_V_HDMI_TX_SS_0_V_HDMI_TX_DEVICE_ID,
XPAR_V_HDMI_TX_SS_0_V_HDMI_TX_BASEADDR
},
{
XPAR_V_HDMI_TX_SS_0_V_TC_PRESENT,
XPAR_V_HDMI_TX_SS_0_V_TC_DEVICE_ID,
XPAR_V_HDMI_TX_SS_0_V_TC_BASEADDR
},
}
};

View file