Skip to content

Commit

Permalink
add xilflash library
Browse files Browse the repository at this point in the history
  • Loading branch information
stv0g committed Jul 8, 2020
1 parent e537a0e commit ebff3a7
Show file tree
Hide file tree
Showing 96 changed files with 17,166 additions and 0 deletions.
41 changes: 41 additions & 0 deletions orig/xilflash/data/xilflash.mld
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
###############################################################################
# Copyright (c) 2007 - 2020 Xilinx, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
# Modification History
#
# Ver Who Date Changes
# ----- ---- -------- -----------------------------------------------
# 3.00a sdm 03/03/11 Removed static flash parameters in the library
# 3.00a sdm 03/23/11 Added new parameters to enable support for flash families
# 4.4 ms 08/03/17 Added tags and modified comment lines style for doxygen.
# 4.4 srm 02/16/18 Updated to pick up latest freertos port 10.0
# 4.6 akm 01/22/19 Fixed compilation error of application with xilflash
# library(CR#1018603)
#
##############################################################################

OPTION psf_version = 2.1;

BEGIN LIBRARY xilflash
OPTION drc = flash_drc;
OPTION copyfiles = all;
OPTION REQUIRES_OS = (standalone xilkernel freertos10_xilinx);
OPTION REQUIRES_INTERFACE = (xilflash);
OPTION supported_peripherals = (opb_emc_v2_00_a plb_emc mch_opb_emc xps_mch_emc axi_emc);
OPTION APP_LINKER_FLAGS = "-lxilflash";
OPTION desc = "Xilinx Flash library for Intel/AMD CFI compliant parallel flash";
OPTION VERSION = 4.8;
OPTION NAME = xilflash;
PARAM name = enable_intel, desc = "Enables support for Intel family devices", type = bool, default = true;
PARAM name = enable_amd, desc = "Enables support for AMD family devices", type = bool, default = false;

#deprecated parameters
PARAM name = part_mode, state = DEPRECATED, desc = "Operational mode of each part in bytes. Indicates the data bus width of the Flash part actually used.", type = int, default = 2;
PARAM name = num_parts, state = DEPRECATED, desc = "Number of flash device parts in the array that forms the Flash Memory", type = int, default = 2;
PARAM name = part_width, state = DEPRECATED, desc = "Width of each part in bytes. Indicates the data bus width supported by the Flash part", type = int, default = 2;
PARAM name = base_address, state = DEPRECATED, desc = "Flash Base Address in Hex", type = int, default = 0x0;
PARAM name = flash_family, state = DEPRECATED, desc = "Indicates the flash family type. Enter 1 for INTEL and 2 for AMD.", type = int, default = 1;
PARAM name = platform_flash, state = DEPRECATED, desc = "Indicates the flash device type. Enter 1 for Platform flash and 0 for others.", type = int, default = 0;

END LIBRARY
90 changes: 90 additions & 0 deletions orig/xilflash/data/xilflash.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
###############################################################################
# Copyright (c) 2007 - 2020 Xilinx, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
###############################################################################

## @BEGIN_CHANGELOG EDK_LS3
## Added XPAR_XFL_PLATFORM_FLASH to be generated in the xparameters.h.
## If the user selects Platform Flash XL device to be used then
## parameter will be set to 1.
##
## @END_CHANGELOG
#
# Modification History
#
# Ver Who Date Changes
# ----- ---- -------- -----------------------------------------------
# 2.03a sdm 09/24/10 updated to use Tcl commands instead of unix commands
# 3.00a sdm 03/03/11 Removed static flash parameters in the library
# 3.00a sdm 03/23/11 Added new parameters to enable support for flash families
#
##############################################################################

#---------------------------------------------
# Flash_drc
#---------------------------------------------
proc flash_drc {libhandle} {

}

proc generate {libhandle} {

}

#-------
# post_generate: called after generate called on all libraries
#-------
proc post_generate {libhandle} {

xgen_opts_file $libhandle
}

#-------
# execs_generate: called after BSP's, libraries and drivers have been compiled
# This procedure builds the libxilflash.a library
#-------
proc execs_generate {libhandle} {

}

proc xgen_opts_file {libhandle} {

# Open xparameters.h file
set file_handle [::hsi::utils::open_include_file "xparameters.h"]

# Generate parameters for Flash family support
puts $file_handle "/* Xilinx EDK Parallel Flash Library (XilFlash) User Settings */"
set enable_intel [common::get_property CONFIG.enable_intel $libhandle]
set enable_amd [common::get_property CONFIG.enable_amd $libhandle]

if {$enable_intel == false && $enable_amd == false} {
error "ERROR: no flash family enabled. enable at least one flash family in the bsp settings and rebuild the libraries"
}

if {$enable_intel == true} {
puts $file_handle "\#define XPAR_XFL_DEVICE_FAMILY_INTEL"
}

if {$enable_amd == true} {
puts $file_handle "\#define XPAR_XFL_DEVICE_FAMILY_AMD"
}

close $file_handle

# Copy the include files to the include directory
set srcdir [file join src include]
set dstdir [file join .. .. include]

# Create dstdir if it does not exist
if { ! [file exists $dstdir] } {
file mkdir $dstdir
}

# Get list of files in the srcdir
set sources [glob -join $srcdir *.h]

# Copy each of the files in the list to dstdir
foreach source $sources {
file copy -force $source $dstdir
}
}
Loading

0 comments on commit ebff3a7

Please sign in to comment.