From a404324e7d9dd56b0117afa2fec6bad52414771d Mon Sep 17 00:00:00 2001 From: Kinjal Pravinbhai Patel Date: Fri, 27 Jun 2014 18:49:01 +0530 Subject: [PATCH] drivers : created a new minor version for driver cpu_cortexa9 this patch creates a new minor version v2_1 for driver cpu_cortexa9 Signed-off-by: Kinjal Pravinbhai Patel Acked-by: Anirudha Sarangi --- .../cpu_cortexa9/data/cpu_cortexa9.mdd | 49 ++++++ .../cpu_cortexa9/data/cpu_cortexa9.tcl | 145 ++++++++++++++++++ .../drivers/cpu_cortexa9/src/Makefile | 23 +++ .../drivers/cpu_cortexa9/src/xcpu_cortexa9.h | 39 +++++ 4 files changed, 256 insertions(+) create mode 100755 XilinxProcessorIPLib/drivers/cpu_cortexa9/data/cpu_cortexa9.mdd create mode 100755 XilinxProcessorIPLib/drivers/cpu_cortexa9/data/cpu_cortexa9.tcl create mode 100755 XilinxProcessorIPLib/drivers/cpu_cortexa9/src/Makefile create mode 100755 XilinxProcessorIPLib/drivers/cpu_cortexa9/src/xcpu_cortexa9.h diff --git a/XilinxProcessorIPLib/drivers/cpu_cortexa9/data/cpu_cortexa9.mdd b/XilinxProcessorIPLib/drivers/cpu_cortexa9/data/cpu_cortexa9.mdd new file mode 100755 index 00000000..f76b85b9 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cpu_cortexa9/data/cpu_cortexa9.mdd @@ -0,0 +1,49 @@ +############################################################################### +# +# Copyright (C) 2011 - 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 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. +# +############################################################################### +OPTION psf_version = 2.1; + +BEGIN driver cpu_cortexa9 + +OPTION copyfiles = all; +OPTION driver_state = ACTIVE; +OPTION supported_peripherals = (ps7_cortexa9); +OPTION default_os = "standalone_v3_05_a"; +OPTION VERSION = 2.1; +OPTION NAME = cpu_cortexa9; + + +PARAM name = compiler, desc = "Compiler used to compile both BSP/Libraries and Applications.", type = string, default = arm-xilinx-eabi-gcc; +PARAM name = archiver, desc = "Archiver used to archive libraries for both BSP generation as well as for applications", type = string, default = arm-xilinx-eabi-ar; +PARAM name = compiler_flags, desc = "Compiler flags used in BSP and library generation. '-c' flag stands for 'compile and assemble, but do not link'. Without this flag, gcc tries to link the code, which will fail bacause there is no application involved during libgen. '-O2' can be overwritten by extra compiler flags", type = string, default = "-O2 -c", permit = none; +PARAM name = extra_compiler_flags, desc = "Extra compiler flags used in BSP and library generation.", type = string, default = "-g"; + +END driver diff --git a/XilinxProcessorIPLib/drivers/cpu_cortexa9/data/cpu_cortexa9.tcl b/XilinxProcessorIPLib/drivers/cpu_cortexa9/data/cpu_cortexa9.tcl new file mode 100755 index 00000000..ea7eda04 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cpu_cortexa9/data/cpu_cortexa9.tcl @@ -0,0 +1,145 @@ +############################################################################### +# +# Copyright (C) 2011 - 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 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. +# +############################################################################### +# +# Modification History +# +# Ver Who Date Changes +# ----- ---- -------- ----------------------------------------------- +# 1.00a sdm 05/16/10 Updated to support AXI version of the core +# 2.0 adk 10/12/13 Updated as per the New Tcl API's +# +############################################################################## +#uses "xillib.tcl" + +############################################################ +# "generate" procedure +############################################################ +proc generate {drv_handle} { + + xdefine_cortexa9_params $drv_handle + xdefine_include_file $drv_handle "xparameters.h" "XCPU_CORTEXA9" "C_CPU_CLK_FREQ_HZ" + xdefine_canonical_xpars $drv_handle "xparameters.h" "CPU_CORTEXA9" "C_CPU_CLK_FREQ_HZ" + xdefine_addr_params_for_ext_intf $drv_handle "xparameters.h" +} + +proc xdefine_cortexa9_params {drvhandle} { + + set sw_proc_handle [get_sw_processor] + set hw_proc_handle [get_cells [get_property HW_INSTANCE $sw_proc_handle ]] + + set periphs [::hsm::utils::get_common_driver_ips $drvhandle] + set lprocs [get_cells -filter "IP_NAME==ps7_cortexa9"] + set lprocs [lsort $lprocs] + + set config_inc [::hsm::utils::open_include_file "xparameters.h"] + puts $config_inc "/* Definition for CPU ID */" + + foreach periph $periphs { + set iname [get_property NAME $periph] + + #----------- + # Set CPU ID + #----------- + set id 0 + foreach processor $lprocs { + if {[string compare -nocase $processor $iname] == 0} { + puts $config_inc "#define XPAR_CPU_ID $id" + } + incr id + } + } + + close $config_inc +} + +proc xdefine_addr_params_for_ext_intf {drvhandle file_name} { + set sw_proc_handle [get_sw_processor] + set hw_proc_handle [get_cells [get_property HW_INSTANCE $sw_proc_handle ]] + + # Open include file + set file_handle [::hsm::utils::open_include_file $file_name] + + set mem_ranges [get_mem_ranges -of_objects $hw_proc_handle] + foreach mem_range $mem_ranges { + set inst [get_property INSTANCE $mem_range] + if {$inst != ""} { + continue + } + + + set bparam_name [get_property BASE_NAME $mem_range] + set bparam_value [get_property BASE_VALUE $mem_range] + set hparam_name [get_property HIGH_NAME $mem_range] + set hparam_value [get_property HIGH_VALUE $mem_range] + + # Print all parameters for all peripherals + + + set name [string toupper [get_property NAME $mem_range]] + puts $file_handle "" + puts $file_handle "/* Definitions for interface [string toupper $name] */" + set name [format "XPAR_%s_" $name] + + + if {$bparam_value != ""} { + set value [::hsm::utils::format_addr_string $bparam_value $bparam_name] + set param [string toupper $bparam_name] + if {[string match C_* $param]} { + set name [format "%s%s" $name [string range $param 2 end]] + } else { + set name [format "%s%s" $name $param] + } + + puts $file_handle "#define $name $value" + } + + set name [string toupper [get_property NAME $mem_range]] + set name [format "XPAR_%s_" $name] + if {$hparam_value != ""} { + set value [::hsm::utils::format_addr_string $hparam_value $hparam_name] + set param [string toupper $hparam_name] + if {[string match C_* $param]} { + set name [format "%s%s" $name [string range $param 2 end]] + } else { + set name [format "%s%s" $name $param] + } + + puts $file_handle "#define $name $value" + } + + + puts $file_handle "" + } + + close $file_handle +} + diff --git a/XilinxProcessorIPLib/drivers/cpu_cortexa9/src/Makefile b/XilinxProcessorIPLib/drivers/cpu_cortexa9/src/Makefile new file mode 100755 index 00000000..77363c67 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cpu_cortexa9/src/Makefile @@ -0,0 +1,23 @@ +COMPILER= +ARCHIVER= +CP=cp +COMPILER_FLAGS= +EXTRA_COMPILER_FLAGS= +LIB=libxil.a + +RELEASEDIR=../../../lib +INCLUDEDIR=../../../include +INCLUDES=-I${INCLUDEDIR} + +OUTS = *.o + +LIBSOURCES=*.c +INCLUDEFILES=*.h + +libs: + echo "Compiling cpu_cortexa9" + +.PHONY: include +include: + ${CP} $(INCLUDEFILES) $(INCLUDEDIR) + diff --git a/XilinxProcessorIPLib/drivers/cpu_cortexa9/src/xcpu_cortexa9.h b/XilinxProcessorIPLib/drivers/cpu_cortexa9/src/xcpu_cortexa9.h new file mode 100755 index 00000000..52c602ca --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cpu_cortexa9/src/xcpu_cortexa9.h @@ -0,0 +1,39 @@ +/****************************************************************************** +* +* Copyright (C) 2011 - 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 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 xcpu_cortexa9.h +* +* dummy file +* +******************************************************************************/