From 85fd8c9a18c37e792877e942bc51a76e706d67e6 Mon Sep 17 00:00:00 2001 From: Kinjal Pravinbhai Patel Date: Mon, 13 Jul 2015 18:32:58 +0530 Subject: [PATCH] drivers: cpu_cortexr5: deprecated older version and created new version 1.1 Signed-off-by: Kinjal Pravinbhai Patel --- .../cpu_cortexr5/data/cpu_cortexr5.mdd | 49 ++++++ .../cpu_cortexr5/data/cpu_cortexr5.tcl | 155 ++++++++++++++++++ .../drivers/cpu_cortexr5/src/Makefile | 22 +++ .../drivers/cpu_cortexr5/src/xcpu_cortexr5.h | 43 +++++ 4 files changed, 269 insertions(+) create mode 100644 XilinxProcessorIPLib/drivers/cpu_cortexr5/data/cpu_cortexr5.mdd create mode 100644 XilinxProcessorIPLib/drivers/cpu_cortexr5/data/cpu_cortexr5.tcl create mode 100644 XilinxProcessorIPLib/drivers/cpu_cortexr5/src/Makefile create mode 100644 XilinxProcessorIPLib/drivers/cpu_cortexr5/src/xcpu_cortexr5.h diff --git a/XilinxProcessorIPLib/drivers/cpu_cortexr5/data/cpu_cortexr5.mdd b/XilinxProcessorIPLib/drivers/cpu_cortexr5/data/cpu_cortexr5.mdd new file mode 100644 index 00000000..13252215 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cpu_cortexr5/data/cpu_cortexr5.mdd @@ -0,0 +1,49 @@ +############################################################################### +# +# Copyright (C) 2014 Xilinx, Inc. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Use of the Software is limited solely to applications: +# (a) running on a Xilinx device, or +# (b) that interact with a Xilinx device through a bus or interconnect. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Except as contained in this notice, the name of the Xilinx shall not be used +# in advertising or otherwise to promote the sale, use or other dealings in +# this Software without prior written authorization from Xilinx. +# +############################################################################### +OPTION psf_version = 2.1; + +BEGIN driver cpu_cortexr5 + +OPTION copyfiles = all; +OPTION driver_state = ACTIVE; +OPTION supported_peripherals = (psu_cortexr5); +OPTION default_os = "standalone_v5_0"; +OPTION VERSION = 1.1; +OPTION NAME = cpu_cortexr5; + + +PARAM name = compiler, desc = "Compiler used to compile both BSP/Libraries and Applications.", type = string, default = arm-none-eabi-gcc; +PARAM name = archiver, desc = "Archiver used to archive libraries for both BSP generation as well as for applications", type = string, default = arm-none-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 -DARMR5"; + +END driver diff --git a/XilinxProcessorIPLib/drivers/cpu_cortexr5/data/cpu_cortexr5.tcl b/XilinxProcessorIPLib/drivers/cpu_cortexr5/data/cpu_cortexr5.tcl new file mode 100644 index 00000000..bc98097a --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cpu_cortexr5/data/cpu_cortexr5.tcl @@ -0,0 +1,155 @@ +############################################################################### +# +# Copyright (C) 2014 Xilinx, Inc. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Use of the Software is limited solely to applications: +# (a) running on a Xilinx device, or +# (b) that interact with a Xilinx device through a bus or interconnect. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Except as contained in this notice, the name of the Xilinx shall not be used +# in advertising or otherwise to promote the sale, use or other dealings in +# this Software without prior written authorization from Xilinx. +# +############################################################################### +# +# Modification History +# +# Ver Who Date Changes +# ----- ---- -------- ----------------------------------------------- +# 1.00 pkp 07/21/14 Initial common::version +# +############################################################################## +#uses "xillib.tcl" + +############################################################ +# "generate" procedure +############################################################ +proc generate {drv_handle} { + + xdefine_cortexr5_params $drv_handle + xdefine_include_file $drv_handle "xparameters.h" "XCPU_CORTEXR5" "C_CPU_CLK_FREQ_HZ" + xdefine_canonical_xpars $drv_handle "xparameters.h" "CPU_CORTEXR5" "C_CPU_CLK_FREQ_HZ" + xdefine_addr_params_for_ext_intf $drv_handle "xparameters.h" +} + +proc xdefine_cortexr5_params {drvhandle} { + + set sw_proc_handle [hsi::get_sw_processor] + set hw_proc_handle [hsi::get_cells [common::get_property HW_INSTANCE $sw_proc_handle ]] + set procdrv [hsi::get_sw_processor] + set archiver [common::get_property CONFIG.archiver $procdrv] + if {[string first "iarchive" $archiver] < 0 } { + } else { + set libxil_a [file join .. .. lib libxil.a] + if { ![file exists $libxil_a] } { + # create empty libxil.a + set fd [open "test.a" a+] + close $fd + exec $archiver --create --output $libxil_a test.a + file delete -force test.a + } + } + set periphs [::hsi::utils::get_common_driver_ips $drvhandle] + set lprocs [hsi::get_cells -filter "IP_NAME==psu_cortexr5"] + set lprocs [lsort $lprocs] + + set config_inc [::hsi::utils::open_include_file "xparameters.h"] + puts $config_inc "/* Definition for CPU ID */" + + foreach periph $periphs { + set iname [common::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 [hsi::get_sw_processor] + set hw_proc_handle [hsi::get_cells [common::get_property HW_INSTANCE $sw_proc_handle ]] + + # Open include file + set file_handle [::hsi::utils::open_include_file $file_name] + + set mem_ranges [hsi::get_mem_ranges -of_objects $hw_proc_handle] + foreach mem_range $mem_ranges { + set inst [common::get_property INSTANCE $mem_range] + if {$inst != ""} { + continue + } + + + set bparam_name [common::get_property BASE_NAME $mem_range] + set bparam_value [common::get_property BASE_VALUE $mem_range] + set hparam_name [common::get_property HIGH_NAME $mem_range] + set hparam_value [common::get_property HIGH_VALUE $mem_range] + + # Print all parameters for all peripherals + + + set name [string toupper [common::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 [::hsi::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 [common::get_property NAME $mem_range]] + set name [format "XPAR_%s_" $name] + if {$hparam_value != ""} { + set value [::hsi::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_cortexr5/src/Makefile b/XilinxProcessorIPLib/drivers/cpu_cortexr5/src/Makefile new file mode 100644 index 00000000..648f83a2 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cpu_cortexr5/src/Makefile @@ -0,0 +1,22 @@ +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_cortexr5" + +.PHONY: include +include: + ${CP} $(INCLUDEFILES) $(INCLUDEDIR) diff --git a/XilinxProcessorIPLib/drivers/cpu_cortexr5/src/xcpu_cortexr5.h b/XilinxProcessorIPLib/drivers/cpu_cortexr5/src/xcpu_cortexr5.h new file mode 100644 index 00000000..ec237ad6 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cpu_cortexr5/src/xcpu_cortexr5.h @@ -0,0 +1,43 @@ +/****************************************************************************** +* +* Copyright (C) 2014 Xilinx, Inc. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* Use of the Software is limited solely to applications: +* (a) running on a Xilinx device, or +* (b) that interact with a Xilinx device through a bus or interconnect. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* Except as contained in this notice, the name of the Xilinx shall not be used +* in advertising or otherwise to promote the sale, use or other dealings in +* this Software without prior written authorization from Xilinx. +* +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file xcpu_cortexr5.h +* @addtogroup cpu_cortexr5_v1_0 +* @{ +* @details +* +* dummy file +* +******************************************************************************/ +/** @} */