drivers: cpu_cortexa53: added new driver

This patch adds new driver cpu_cortexa53 for zynq ultrascale mp support

Signed-off-by: Kinjal Pravinbhai Patel <patelki@xilinx.com>
This commit is contained in:
Kinjal Pravinbhai Patel 2014-12-16 14:57:56 +05:30 committed by Suneel Garapati
parent 825d4966e7
commit 9eecf81cf7
4 changed files with 265 additions and 0 deletions

View file

@ -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 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_cortexa53
OPTION copyfiles = all;
OPTION driver_state = ACTIVE;
OPTION supported_peripherals = (ps8_cortexa53);
OPTION default_os = "standalone_v5_0";
OPTION VERSION = 1.0;
OPTION NAME = cpu_cortexa53;
PARAM name = compiler, desc = "Compiler used to compile both BSP/Libraries and Applications.", type = string, default = aarch64-none-elf-gcc;
PARAM name = archiver, desc = "Archiver used to archive libraries for both BSP generation as well as for applications", type = string, default = aarch64-none-elf-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

View file

@ -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 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.0 pkp 07/21/14 Initial version
#
##############################################################################
#uses "xillib.tcl"
############################################################
# "generate" procedure
############################################################
proc generate {drv_handle} {
xdefine_cortexa53_params $drv_handle
xdefine_include_file $drv_handle "xparameters.h" "XCPU_CORTEXA53" "C_CPU_CLK_FREQ_HZ"
xdefine_canonical_xpars $drv_handle "xparameters.h" "CPU_CORTEXA53" "C_CPU_CLK_FREQ_HZ"
xdefine_addr_params_for_ext_intf $drv_handle "xparameters.h"
}
proc xdefine_cortexa53_params {drvhandle} {
set sw_proc_handle [get_sw_processor]
set hw_proc_handle [get_cells [get_property HW_INSTANCE $sw_proc_handle ]]
set procdrv [get_sw_processor]
set archiver [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 [::hsm::utils::get_common_driver_ips $drvhandle]
set lprocs [get_cells -filter "IP_NAME==ps8_cortexa53"]
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
}

View file

@ -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_cortexa53"
.PHONY: include
include:
${CP} $(INCLUDEFILES) $(INCLUDEDIR)

View file

@ -0,0 +1,39 @@
/******************************************************************************
*
* 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 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_cortexa53.h
*
* dummy file
*
******************************************************************************/