v_hdmitxss: Add initial version of hdmi tx subsystem driver

Added hdmi tx subsystem driver v1.0 (on behalf of Gilbert
Magnaye)

Signed-off-by: Rohit Consul <rohit.consul@xilinx.com>
Acked-by: Andrei-Liviu Simion <andrei.simion@xilinx.com>
This commit is contained in:
Rohit Consul 2015-10-09 06:37:50 +08:00 committed by Nava kishore Manne
parent 3713b27d5a
commit a6f402d225
9 changed files with 3261 additions and 0 deletions

View file

@ -0,0 +1,44 @@
################################################################################
#
# 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 v_hdmitxss
OPTION supported_peripherals = (v_hdmi_tx_ss_v1_0);
OPTION driver_state = ACTIVE;
OPTION copyfiles = all;
OPTION VERSION = 1.0;
OPTION DEPENDS = (v_hdmitx_v1_0 vtc_v7_0 hdcp1x_v2_0 tmrctr_v4_0);
OPTION NAME = v_hdmitxss;
END driver

View file

@ -0,0 +1,355 @@
################################################################################
#
# 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 gmagnay 08/14/15 Initial version of subsystem tcl
#
################################################################################
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"
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"
::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"
}
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_timer 1
hdcp 1
v_hdmi_tx 1
v_tc 1
}
#MAGS
#foreach name [array names sub_core_inst] {
# puts $config_file "//sub_core_inst: $name $sub_core_inst($name)"
#}
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 -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 :]
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
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"
# 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]] {
#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]
#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 "//$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 -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"
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]
#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
}

View file

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

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,251 @@
/******************************************************************************
*
* 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.
*
******************************************************************************/
/*****************************************************************************/
/**
*
* @file xv_hdmitxss.h
*
* This is main header file of the Xilinx HDMI TX Subsystem driver
*
* <b>HDMI Transmitter Subsystem Overview</b>
*
* HDMI TX Subsystem is a collection of IP cores bounded together by software
* to provide an abstract view of the processing pipe. It hides all the
* complexities of programming the underlying cores from end user.
*
* <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)
* <pre>
* MODIFICATION HISTORY:
*
* Ver Who Date Changes
* ----- ---- -------- -------------------------------------------------------
* 1.00 10/07/15 Initial release.
* </pre>
*
******************************************************************************/
#ifndef HDMITXSS_H /**< prevent circular inclusions by using protection macros*/
#define HDMITXSS_H
#ifdef __cplusplus
extern "C" {
#endif
/***************************** Include Files *********************************/
#include "xstatus.h"
#include "xintc.h"
#include "xvidc.h"
#include "xvidc_edid.h"
#include "xv_hdmitx.h"
#include "xvtc.h"
#include "xtmrctr.h"
#include "xhdcp1x.h"
#define XV_HDMITXSS_HDCP_KEYSEL 0x00u
/****************************** Type Definitions ******************************/
/** @name Handler Types
* @{
*/
/**
* These constants specify different types of handler and used to differentiate
* 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_HandlerType;
/*@}*/
/**
* Sub-Core Configuration Table
*/
typedef struct
{
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 */
}XV_HdmiTxSs_SubCore;
/**
* Video Processing Subsystem configuration structure.
* Each subsystem device should have a configuration structure associated
* that defines the MAX supported sub-cores within subsystem
*/
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 */
u8 MaxPixelsPerClock; /**< Maximum 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 */
} XV_HdmiTxSs_Config;
/**
* Callback type for interrupt.
*
* @param CallbackRef is a callback reference passed in by the upper
* layer when setting the callback functions, and passed back to
* the upper layer when the callback is invoked.
*
* @return None.
*
* @note None.
*
*/
typedef void (*XV_HdmiTxSs_Callback)(void *CallbackRef);
/**
* The XVprocss driver instance data. The user is required to allocate a variable
* of this type for every XVprocss device in the system. A pointer to a variable
* of this type is then passed to the driver API functions.
*/
typedef struct
{
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 */
/* 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 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 */
/**< 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. */
} XV_HdmiTxSs;
/************************** Macros Definitions *******************************/
/************************** Function Prototypes ******************************/
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);
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);
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);
int XV_HdmiTxSs_ReadEdid(XV_HdmiTxSs *InstancePtr, u8 *BufferPtr);
void XV_HdmiTxSs_ShowEdid(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_StreamStart(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_SendAudioInfoframe(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);
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);
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);
void XV_HdmiTxSs_SetTmdsClockRatio(XV_HdmiTxSs *InstancePtr, u8 Ratio);
u32 XV_HdmiTxSs_GetTmdsClockFreqHz(XV_HdmiTxSs *InstancePtr);
int XV_HdmiTxSs_DetectHdmi20(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_RefClockChangeInit(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_ReportTiming(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_ReportSubcoreVersion(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_HdcpEnable(XV_HdmiTxSs *InstancePtr, u8 Enable);
u8 XV_HdmiTxSs_HdcpPoll(XV_HdmiTxSs *InstancePtr);
u8 XV_HdmiTxSs_HdcpStart(XV_HdmiTxSs *InstancePtr);
void XV_HdmiTxSs_HdcpTimerCallback(void *CallBackRef, u8 TimerChannel);
int XV_HdmiTxSs_HdcpTimerStart(const XHdcp1x *InstancePtr, u16 TimeoutInMs);
int XV_HdmiTxSs_HdcpTimerStop(const XHdcp1x *InstancePtr);
int XV_HdmiTxSs_HdcpTimerBusyDelay(const XHdcp1x *InstancePtr, u16 DelayInMs);
#ifdef __cplusplus
}
#endif
#endif /* end of protection macro */

View file

@ -0,0 +1,326 @@
/******************************************************************************
*
* 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.
*
******************************************************************************/
/*****************************************************************************/
/**
*
* @file xv_hdmitxss_coreinit.c
* @addtogroup v_hdmitxss
* @{
* @details
* HDMI TX 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
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver Who Date Changes
* ----- ---- -------- -------------------------------------------------------
* 1.00 10/07/15 Initial release.
* </pre>
*
******************************************************************************/
/***************************** Include Files *********************************/
#include "xv_hdmitxss_coreinit.h"
/************************** Constant Definitions *****************************/
/************************** Function Prototypes ******************************/
static int XV_HdmiTxSs_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 XV_HdmiTxSs_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) && (AbsAddr<SubSys_HighAddr)) {
*SubCore_BaseAddr = AbsAddr;
Status = XST_SUCCESS;
}
else {
*SubCore_BaseAddr = 0;
Status = XST_FAILURE;
}
return(Status);
}
/*****************************************************************************/
/**
* This function initializes the included sub-core to it's static configuration
*
* @param HdmiTxSsPtr is a pointer to the Subsystem instance to be worked on.
*
* @return XST_SUCCESS/XST_FAILURE
*
******************************************************************************/
int XV_HdmiTxSs_SubcoreInitHdmiTx(XV_HdmiTxSs *HdmiTxSsPtr)
{
int Status;
u32 AbsAddr;
XV_HdmiTx_Config *ConfigPtr;
if (HdmiTxSsPtr->HdmiTxPtr) {
/* 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) {
xil_printf("HDMITXSS ERR:: HDMI TX device not found\r\n");
return(XST_FAILURE);
}
/* Compute absolute base address */
AbsAddr = 0;
Status = XV_HdmiTxSs_ComputeSubcoreAbsAddr(HdmiTxSsPtr->Config.BaseAddress,
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);
return(XST_FAILURE);
}
/* Initialize core */
Status = XV_HdmiTx_CfgInitialize(HdmiTxSsPtr->HdmiTxPtr,
ConfigPtr,
AbsAddr);
if (Status != XST_SUCCESS) {
xil_printf("HDMITXSS ERR:: HDMI TX Initialization failed\r\n");
return(XST_FAILURE);
}
}
return(XST_SUCCESS);
}
/*****************************************************************************/
/**
* This function initializes the included sub-core to it's static configuration
*
* @param HdmiTxSsPtr is a pointer to the Subsystem instance to be worked on.
*
* @return XST_SUCCESS/XST_FAILURE
*
******************************************************************************/
int XV_HdmiTxSs_SubcoreInitVtc(XV_HdmiTxSs *HdmiTxSsPtr)
{
int Status;
u32 AbsAddr;
XVtc_Config *ConfigPtr;
if (HdmiTxSsPtr->VtcPtr) {
/* Get core configuration */
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing VTC core.... \r\n");
ConfigPtr = XVtc_LookupConfig(HdmiTxSsPtr->Config.Vtc.DeviceId);
if (ConfigPtr == NULL) {
xil_printf("HDMITXSS ERR:: VTC device not found\r\n");
return(XST_FAILURE);
}
/* Compute absolute base address */
AbsAddr = 0;
Status = XV_HdmiTxSs_ComputeSubcoreAbsAddr(HdmiTxSsPtr->Config.BaseAddress,
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);
return(XST_FAILURE);
}
/* Initialize core */
Status = XVtc_CfgInitialize(HdmiTxSsPtr->VtcPtr,
ConfigPtr,
AbsAddr);
if (Status != XST_SUCCESS) {
xil_printf("HDMITXSS ERR:: VTC Initialization failed\r\n");
return(XST_FAILURE);
}
}
return(XST_SUCCESS);
}
/*****************************************************************************/
/**
* This function initializes the included sub-core to it's static configuration
*
* @param HdmiTxSsPtr is a pointer to the Subsystem instance to be worked on.
*
* @return XST_SUCCESS/XST_FAILURE
*
******************************************************************************/
int XV_HdmiTxSs_SubcoreInitHdcpTimer(XV_HdmiTxSs *HdmiTxSsPtr)
{
int Status;
u32 AbsAddr;
XTmrCtr_Config *ConfigPtr;
if (HdmiTxSsPtr->HdcpTimerPtr) {
/* Get core configuration */
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXI Timer core.... \r\n");
ConfigPtr = XTmrCtr_LookupConfig(HdmiTxSsPtr->Config.HdcpTimer.DeviceId);
if (ConfigPtr == NULL) {
xil_printf("HDMITXSS ERR:: AXIS Timer device not found\r\n");
return(XST_FAILURE);
}
/* Compute absolute base address */
AbsAddr = 0;
Status = XV_HdmiTxSs_ComputeSubcoreAbsAddr(HdmiTxSsPtr->Config.BaseAddress,
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);
return(XST_FAILURE);
}
/* Setup the instance */
memset(HdmiTxSsPtr->HdcpTimerPtr, 0, sizeof(XTmrCtr));
/* 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);
if (Status != XST_SUCCESS) {
xil_printf("HDMITXSS ERR:: AXI Timer Initialization failed\r\n");
return(XST_FAILURE);
}
}
return(XST_SUCCESS);
}
/*****************************************************************************/
/**
* This function initializes the included sub-core to it's static configuration
*
* @param HdmiTxSsPtr is a pointer to the Subsystem instance to be worked on.
*
* @return XST_SUCCESS/XST_FAILURE
*
******************************************************************************/
int XV_HdmiTxSs_SubcoreInitHdcp(XV_HdmiTxSs *HdmiTxSsPtr)
{
int Status;
u32 AbsAddr;
XHdcp1x_Config *ConfigPtr;
if (HdmiTxSsPtr->HdcpPtr){
/* Get core configuration */
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing HDCP core.... \r\n");
ConfigPtr = XHdcp1x_LookupConfig(HdmiTxSsPtr->Config.Hdcp.DeviceId);
if (ConfigPtr == NULL){
xil_printf("HDMITXSS ERR:: HDCP device not found\r\n");
return(XST_FAILURE);
}
/* Compute absolute base address */
AbsAddr = 0;
Status = XV_HdmiTxSs_ComputeSubcoreAbsAddr(HdmiTxSsPtr->Config.BaseAddress,
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);
return(XST_FAILURE);
}
/* Initialize core */
void *PhyIfPtr = HdmiTxSsPtr->HdmiTxPtr;
Status = XHdcp1x_CfgInitialize(HdmiTxSsPtr->HdcpPtr,
ConfigPtr,
PhyIfPtr,
AbsAddr);
/* Self-test the hdcp interface */
if (XHdcp1x_SelfTest(HdmiTxSsPtr->HdcpPtr) != XST_SUCCESS) {
Status = XST_FAILURE;
}
if (Status != XST_SUCCESS) {
xil_printf("HDMITXSS ERR:: HDCP Initialization failed\r\n");
return(XST_FAILURE);
}
XHdcp1x_SetKeySelect(HdmiTxSsPtr->HdcpPtr, XV_HDMITXSS_HDCP_KEYSEL);
}
return(XST_SUCCESS);
}
/** @} */

View file

@ -0,0 +1,79 @@
/******************************************************************************
*
* 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.
*
******************************************************************************/
/*****************************************************************************/
/**
*
* @file xv_hdmitxss_coreinit.h
* @addtogroup v_hdmitxss
* @{
* @details
*
* This header file contains the hdmi tx subsystem sub-cores
* initialization routines and helper functions.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver Who Date Changes
* ----- ---- -------- -------------------------------------------------------
* 1.00 10/07/15 Initial release.
* </pre>
*
******************************************************************************/
#ifndef XV_HDMITXSS_COREINIT_H__ /* prevent circular inclusions */
#define XV_HDMITXSS_COREINIT_H__ /* by using protection macros */
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <string.h>
#include "xv_hdmitxss.h"
#include "xv_hdmitx.h"
#include "xvtc.h"
#include "xtmrctr.h"
#include "xhdcp1x.h"
/************************** Constant Definitions *****************************/
/************************** Function Prototypes ******************************/
int XV_HdmiTxSs_SubcoreInitHdmiTx(XV_HdmiTxSs *HdmiTxSsPtr);
int XV_HdmiTxSs_SubcoreInitVtc(XV_HdmiTxSs *HdmiTxSsPtr);
int XV_HdmiTxSs_SubcoreInitHdcpTimer(XV_HdmiTxSs *HdmiTxSsPtr);
int XV_HdmiTxSs_SubcoreInitHdcp(XV_HdmiTxSs *HdmiTxSsPtr);
#ifdef __cplusplus
}
#endif
#endif
/** @} */

View file

@ -0,0 +1,105 @@
/*******************************************************************
*
* 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 "xv_hdmitxss.h"
/*
* List of Sub-cores included in the subsystem
* Sub-core device id will be set by its driver in xparameters.h
* Excluded sub-core device id is set to 255
* Excluded sub-core baseaddr is set to 0xFFFFFFFF
*/
#ifndef XPAR_V_HDMI_TX_SS_0_AXI_TIMER_DEVICE_ID
#define XPAR_V_HDMI_TX_SS_0_AXI_TIMER_PRESENT 0
#define XPAR_V_HDMI_TX_SS_0_AXI_TIMER_DEVICE_ID 255
#define XPAR_V_HDMI_TX_SS_0_AXI_TIMER_BASEADDR 0xFFFFFFFF
#endif
#ifndef XPAR_V_HDMI_TX_SS_0_HDCP_1_4_DEVICE_ID
#define XPAR_V_HDMI_TX_SS_0_HDCP_1_4_PRESENT 0
#define XPAR_V_HDMI_TX_SS_0_HDCP_1_4_DEVICE_ID 255
#define XPAR_V_HDMI_TX_SS_0_HDCP_1_4_BASEADDR 0xFFFFFFFF
#endif
#ifndef XPAR_V_HDMI_TX_SS_0_V_HDMI_TX_DEVICE_ID
#define XPAR_V_HDMI_TX_SS_0_V_HDMI_TX_PRESENT 0
#define XPAR_V_HDMI_TX_SS_0_V_HDMI_TX_DEVICE_ID 255
#define XPAR_V_HDMI_TX_SS_0_V_HDMI_TX_BASEADDR 0xFFFFFFFF
#endif
#ifndef XPAR_V_HDMI_TX_SS_0_V_TC_DEVICE_ID
#define XPAR_V_HDMI_TX_SS_0_V_TC_PRESENT 0
#define XPAR_V_HDMI_TX_SS_0_V_TC_DEVICE_ID 255
#define XPAR_V_HDMI_TX_SS_0_V_TC_BASEADDR 0xFFFFFFFF
#endif
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_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

@ -0,0 +1,97 @@
/******************************************************************************
*
* 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.
*
******************************************************************************/
/*****************************************************************************/
/**
*
* @file xv_hdmitxss_sinit.c
* @addtogroup v_hdmitxss
* @{
* @details
*
* This file contains the implementation of the HDMI TX Subsystem
* driver's static initialization functionality.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver Who Date Changes
* ----- ---- -------- -------------------------------------------------------
* 1.00 10/07/15 Initial release.
* </pre>
*
******************************************************************************/
/***************************** Include Files *********************************/
#include "xparameters.h"
#include "xv_hdmitxss.h"
/************************** Constant Definitions *****************************/
/**************************** Type Definitions *******************************/
/***************** Macros (Inline Functions) Definitions *********************/
/************************** Function Prototypes ******************************/
/************************** Variable Definitions *****************************/
extern XV_HdmiTxSs_Config XV_HdmiTxSs_ConfigTable[];
/*****************************************************************************/
/**
* This function looks for the device configuration based on the unique device
* ID. The table XV_HdmiTxSs_ConfigTable[] contains the configuration information
* for each instance of the device in the system.
*
* @param DeviceId is the unique device ID of the device being looked up
*
* @return A pointer to the configuration table entry corresponding to the
* given device ID, or NULL if no match is found
*
*******************************************************************************/
XV_HdmiTxSs_Config* XV_HdmiTxSs_LookupConfig(u32 DeviceId)
{
XV_HdmiTxSs_Config *CfgPtr = NULL;
u32 Index;
for (Index = 0U; Index < (u32)XPAR_XV_HDMITXSS_NUM_INSTANCES; Index++) {
if (XV_HdmiTxSs_ConfigTable[Index].DeviceId == DeviceId) {
CfgPtr = &XV_HdmiTxSs_ConfigTable[Index];
break;
}
}
return (CfgPtr);
}
/** @} */