Migrate to Vitis2023.2 version
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
|
||||
CompileFlags:
|
||||
Add: [-Wno-unknown-warning-option, -U__linux__, -U__clang__]
|
||||
Remove: [-m*, -f*]
|
||||
@@ -0,0 +1,54 @@
|
||||
# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
# SPDX-License-Identifier: MIT
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/Hello_worldExample.cmake)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/UserConfig.cmake)
|
||||
set(APP_NAME test_app)
|
||||
project(${APP_NAME})
|
||||
|
||||
enable_language(C ASM CXX)
|
||||
find_package(common)
|
||||
collect(PROJECT_LIB_DEPS xilstandalone)
|
||||
collect(PROJECT_LIB_DEPS xil)
|
||||
collect(PROJECT_LIB_DEPS xiltimer;lwip213)
|
||||
|
||||
|
||||
collect(PROJECT_LIB_DEPS gcc)
|
||||
collect(PROJECT_LIB_DEPS c)
|
||||
|
||||
collect (PROJECT_LIB_SOURCES platform.c)
|
||||
collect (PROJECT_LIB_SOURCES helloworld.c)
|
||||
collector_list (_sources PROJECT_LIB_SOURCES)
|
||||
foreach (source ${_sources})
|
||||
get_filename_component(ext ${source} EXT)
|
||||
list(APPEND src_ext ${ext})
|
||||
endforeach()
|
||||
|
||||
find_project_type ("${src_ext}" PROJECT_TYPE)
|
||||
|
||||
if("${PROJECT_TYPE}" STREQUAL "c++")
|
||||
collect(PROJECT_LIB_DEPS stdc++)
|
||||
endif()
|
||||
collector_list (_deps PROJECT_LIB_DEPS)
|
||||
list (APPEND _deps ${USER_LINK_LIBRARIES})
|
||||
|
||||
if("${PROJECT_TYPE}" STREQUAL "c++")
|
||||
string (REPLACE ";" ",-l" _deps "${_deps}")
|
||||
endif()
|
||||
if(CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
|
||||
set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
|
||||
endif()
|
||||
linker_gen("${CMAKE_CURRENT_SOURCE_DIR}/linker_files/")
|
||||
string(APPEND CMAKE_C_FLAGS ${USER_COMPILE_OPTIONS})
|
||||
string(APPEND CMAKE_CXX_FLAGS ${USER_COMPILE_OPTIONS})
|
||||
string(APPEND CMAKE_C_LINK_FLAGS ${USER_LINK_OPTIONS})
|
||||
string(APPEND CMAKE_CXX_LINK_FLAGS ${USER_LINK_OPTIONS})
|
||||
set_source_files_properties(${_sources} OBJECT_DEPENDS "${CMAKE_LIBRARY_PATH}/*.a")
|
||||
add_executable(${APP_NAME}.elf ${_sources})
|
||||
set_target_properties(${APP_NAME}.elf PROPERTIES LINK_DEPENDS ${CMAKE_SOURCE_DIR}/lscript.ld)
|
||||
target_link_libraries(${APP_NAME}.elf -Wl,-T -Wl,\"${CMAKE_SOURCE_DIR}/lscript.ld\" -L\"${CMAKE_SOURCE_DIR}/\" -L\"${CMAKE_LIBRARY_PATH}/\" -L\"${USER_LINK_DIRECTORIES}/\" -Wl,--start-group,-l${_deps} -Wl,--end-group)
|
||||
target_compile_definitions(${APP_NAME}.elf PUBLIC ${USER_COMPILE_DEFINITIONS})
|
||||
target_include_directories(${APP_NAME}.elf PUBLIC ${USER_INCLUDE_DIRECTORIES})
|
||||
print_elf_size(CMAKE_SIZE ${APP_NAME})
|
||||
@@ -0,0 +1,13 @@
|
||||
set(DDR ps7_ddr_0)
|
||||
set(ps7_ddr_0 "0x100000;0x3ff00000")
|
||||
set(ps7_ram_0 "0x0;0x30000")
|
||||
set(ps7_ram_1 "0xffff0000;0xfe00")
|
||||
set(TOTAL_MEM_CONTROLLERS "ps7_ddr_0;ps7_ram_0;ps7_ram_1")
|
||||
set(MEMORY_SECTION "MEMORY
|
||||
{
|
||||
ps7_ddr_0 : ORIGIN = 0x100000, LENGTH = 0x3ff00000
|
||||
ps7_ram_0 : ORIGIN = 0x0, LENGTH = 0x30000
|
||||
ps7_ram_1 : ORIGIN = 0xffff0000, LENGTH = 0xfe00
|
||||
}")
|
||||
set(STACK_SIZE 0x2000)
|
||||
set(HEAP_SIZE 0x2000)
|
||||
@@ -0,0 +1,157 @@
|
||||
# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
# SPDX-License-Identifier: MIT
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
### USER SETTINGS START ###
|
||||
# Below settings can be customized
|
||||
# User need to edit it manually as per their needs.
|
||||
### DO NOT ADD OR REMOVE VARIABLES FROM THIS SECTION ###
|
||||
# -----------------------------------------
|
||||
# Add any compiler definitions, they will be added as extra definitions
|
||||
# Example adding VERBOSE=1 will pass -DVERBOSE=1 to the compiler.
|
||||
set(USER_COMPILE_DEFINITIONS
|
||||
""
|
||||
)
|
||||
|
||||
# Undefine any previously specified compiler definitions, either built in or provided with a -D option
|
||||
# Example adding MY_SYMBOL will pass -UMY_SYMBOL to the compiler.
|
||||
set(USER_UNDEFINED_SYMBOLS
|
||||
"__clang__"
|
||||
)
|
||||
|
||||
|
||||
# Add any directories below, they will be added as extra include directories.
|
||||
# Example 1: Adding /proj/data/include will pass -I/proj/data/include
|
||||
# Example 2: Adding ../../common/include will consider the path as relative to this component directory.
|
||||
# Example 3: Adding ${CMAKE_SOURCE_DIR}/data/include to add data/include from this project.
|
||||
|
||||
set(USER_INCLUDE_DIRECTORIES
|
||||
)
|
||||
|
||||
# -----------------------------------------
|
||||
|
||||
# Turn on all optional warnings (-Wall)
|
||||
set(USER_COMPILE_WARNINGS_ALL -Wall)
|
||||
|
||||
# Enable extra warning flags (-Wextra)
|
||||
set(USER_COMPILE_WARNINGS_EXTRA -Wextra)
|
||||
|
||||
# Make all warnings into hard errors (-Werror)
|
||||
set(USER_COMPILE_WARNINGS_AS_ERRORS )
|
||||
|
||||
# Check the code for syntax errors, but don't do anything beyond that. (-fsyntax-only)
|
||||
set(USER_COMPILE_WARNINGS_CHECK_SYNTAX_ONLY )
|
||||
|
||||
# Issue all the mandatory diagnostics listed in the C standard (-pedantic)
|
||||
set(USER_COMPILE_WARNINGS_PEDANTIC )
|
||||
|
||||
# Issue all the mandatory diagnostics, and make all mandatory diagnostics into errors. (-pedantic-errors)
|
||||
set(USER_COMPILE_WARNINGS_PEDANTIC_AS_ERRORS )
|
||||
|
||||
# Suppress all warnings (-w)
|
||||
set(USER_COMPILE_WARNINGS_INHIBIT_ALL )
|
||||
|
||||
# -----------------------------------------
|
||||
|
||||
# Optimization level "-O0" [None] , "-O1" [Optimize] , "-O2" [Optimize More], "-O3" [Optimize Most] or "-Os" [Optimize Size]
|
||||
set(USER_COMPILE_OPTIMIZATION_LEVEL -O0)
|
||||
|
||||
# Other flags related to optimization
|
||||
set(USER_COMPILE_OPTIMIZATION_OTHER_FLAGS )
|
||||
|
||||
# -----------------------------------------
|
||||
|
||||
# Debug level "" [None], "-g1" [Minimum], "g2" [Default], "g3" [Maximim]
|
||||
set(USER_COMPILE_DEBUG_LEVEL -g3)
|
||||
|
||||
# Other flags releated to debugging
|
||||
set(USER_COMPILE_DEBUG_OTHER_FLAGS )
|
||||
|
||||
# -----------------------------------------
|
||||
|
||||
# Enable Profiling (-pg) (This feature is not supported currently)
|
||||
# set(USER_COMPILE_PROFILING_ENABLE )
|
||||
|
||||
# -----------------------------------------
|
||||
|
||||
# Verbose (-v)
|
||||
set(USER_COMPILE_VERBOSE )
|
||||
|
||||
# Support ANSI_PROGRAM (-ansi)
|
||||
set(USER_COMPILE_ANSI )
|
||||
|
||||
# Add any compiler options that are not covered by the above variables, they will be added as extra compiler options
|
||||
# To enable profiling -pg [ for gprof ] or -p [ for prof information ]
|
||||
set(USER_COMPILE_OTHER_FLAGS )
|
||||
|
||||
# -----------------------------------------
|
||||
|
||||
# Linker options
|
||||
# Do not use the standard system startup files when linking.
|
||||
# The standard system libraries are used normally, unless -nostdlib or -nodefaultlibs is used. (-nostartfiles)
|
||||
set(USER_LINK_NO_START_FILES )
|
||||
|
||||
# Do not use the standard system libraries when linking. (-nodefaultlibs)
|
||||
set(USER_LINK_NO_DEFAULT_LIBS )
|
||||
|
||||
# Do not use the standard system startup files or libraries when linking. (-nostdlib)
|
||||
set(USER_LINK_NO_STDLIB )
|
||||
|
||||
# Omit all symbol information (-s)
|
||||
set(USER_LINK_OMIT_ALL_SYMBOL_INFO )
|
||||
|
||||
|
||||
# -----------------------------------------
|
||||
|
||||
# Add any libraries to be linked below, they will be added as extra libraries.
|
||||
# User need to update USER_LINK_DIRECTORIES below with these library paths.
|
||||
set(USER_LINK_LIBRARIES
|
||||
)
|
||||
|
||||
# Add any directories to look for the libraries to be linked.
|
||||
# Example 1: Adding /proj/compression/lib will pass -L/proj/compression/lib to the linker.
|
||||
# Example adding Adding ../../common/lib will consider the path as relative to this directory. and will pass the path to -L option.
|
||||
set(USER_LINK_DIRECTORIES
|
||||
)
|
||||
|
||||
# -----------------------------------------
|
||||
|
||||
set(USER_LINKER_SCRIPT "${CMAKE_SOURCE_DIR}/lscript.ld")
|
||||
|
||||
# Add linker options to be passed, they will be added as extra linker options
|
||||
# Example : adding -s will pass -s to the linker.
|
||||
set(USER_LINK_OTHER_FLAGS
|
||||
)
|
||||
|
||||
# -----------------------------------------
|
||||
|
||||
### END OF USER SETTINGS SECTION ###
|
||||
### DO NOT EDIT BEYOND THIS LINE ###
|
||||
|
||||
set(USER_COMPILE_OPTIONS
|
||||
" ${USER_COMPILE_WARNINGS_ALL}"
|
||||
" ${USER_COMPILE_WARNINGS_EXTRA}"
|
||||
" ${USER_COMPILE_WARNINGS_AS_ERRORS}"
|
||||
" ${USER_COMPILE_WARNINGS_CHECK_SYNTAX_ONLY}"
|
||||
" ${USER_COMPILE_WARNINGS_PEDANTIC}"
|
||||
" ${USER_COMPILE_WARNINGS_PEDANTIC_AS_ERRORS}"
|
||||
" ${USER_COMPILE_WARNINGS_INHIBIT_ALL}"
|
||||
" ${USER_COMPILE_OPTIMIZATION_LEVEL}"
|
||||
" ${USER_COMPILE_OPTIMIZATION_OTHER_FLAGS}"
|
||||
" ${USER_COMPILE_DEBUG_LEVEL}"
|
||||
" ${USER_COMPILE_DEBUG_OTHER_FLAGS}"
|
||||
" ${USER_COMPILE_VERBOSE}"
|
||||
" ${USER_COMPILE_ANSI}"
|
||||
" ${USER_COMPILE_OTHER_FLAGS}"
|
||||
)
|
||||
foreach(entry ${USER_UNDEFINED_SYMBOLS})
|
||||
list(APPEND USER_COMPILE_OPTIONS " -U${entry}")
|
||||
endforeach()
|
||||
|
||||
set(USER_LINK_OPTIONS
|
||||
" ${USER_LINKER_NO_START_FILES}"
|
||||
" ${USER_LINKER_NO_DEFAULT_LIBS}"
|
||||
" ${USER_LINKER_NO_STDLIB}"
|
||||
" ${USER_LINKER_OMIT_ALL_SYMBOL_INFO}"
|
||||
" ${USER_LINK_OTHER_FLAGS}"
|
||||
)
|
||||
@@ -0,0 +1,3 @@
|
||||
domain_path: /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/NewInstrCalBoard_bsp/export/NewInstrCalBoard_bsp/sw/standalone_ps7_cortexa9_0
|
||||
app_src_dir: /data/xilinx/Vitis/2023.2/data/embeddedsw/lib/sw_apps/hello_world
|
||||
template: hello_world
|
||||
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"directory": "/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/test_app/build",
|
||||
"command": "/data/xilinx/Vitis/2023.2/gnu/aarch32/lin/gcc-arm-none-eabi/bin/arm-none-eabi-gcc -isystem /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/NewInstrCalBoard_bsp/export/NewInstrCalBoard_bsp/sw/standalone_ps7_cortexa9_0/include -isystem /data/xilinx/Vitis/2023.2/gnu/aarch32/lin/gcc-arm-none-eabi/x86_64-oesdk-linux/usr/lib/arm-xilinx-eabi/gcc/arm-xilinx-eabi/12.2.0/include -isystem /data/xilinx/Vitis/2023.2/gnu/aarch32/lin/gcc-arm-none-eabi/x86_64-oesdk-linux/usr/lib/arm-xilinx-eabi/gcc/arm-xilinx-eabi/12.2.0/include-fixed -isystem /data/xilinx/Vitis/2023.2/gnu/aarch32/lin/gcc-arm-none-eabi/aarch32-xilinx-eabi/usr/include -O2 -DSDT -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -specs=/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/NewInstrCalBoard_bsp/export/NewInstrCalBoard_bsp/sw/standalone_ps7_cortexa9_0/Xilinx.spec -I/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/NewInstrCalBoard_bsp/export/NewInstrCalBoard_bsp/sw/standalone_ps7_cortexa9_0/include -Wall -Wextra -O0 -g3 -U__clang__ -o CMakeFiles/test_app.elf.dir/platform.c.obj -c /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/test_app/src/platform.c",
|
||||
"file": "/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/test_app/src/platform.c"
|
||||
},
|
||||
{
|
||||
"directory": "/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/test_app/build",
|
||||
"command": "/data/xilinx/Vitis/2023.2/gnu/aarch32/lin/gcc-arm-none-eabi/bin/arm-none-eabi-gcc -isystem /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/NewInstrCalBoard_bsp/export/NewInstrCalBoard_bsp/sw/standalone_ps7_cortexa9_0/include -isystem /data/xilinx/Vitis/2023.2/gnu/aarch32/lin/gcc-arm-none-eabi/x86_64-oesdk-linux/usr/lib/arm-xilinx-eabi/gcc/arm-xilinx-eabi/12.2.0/include -isystem /data/xilinx/Vitis/2023.2/gnu/aarch32/lin/gcc-arm-none-eabi/x86_64-oesdk-linux/usr/lib/arm-xilinx-eabi/gcc/arm-xilinx-eabi/12.2.0/include-fixed -isystem /data/xilinx/Vitis/2023.2/gnu/aarch32/lin/gcc-arm-none-eabi/aarch32-xilinx-eabi/usr/include -O2 -DSDT -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -specs=/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/NewInstrCalBoard_bsp/export/NewInstrCalBoard_bsp/sw/standalone_ps7_cortexa9_0/Xilinx.spec -I/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/NewInstrCalBoard_bsp/export/NewInstrCalBoard_bsp/sw/standalone_ps7_cortexa9_0/include -Wall -Wextra -O0 -g3 -U__clang__ -o CMakeFiles/test_app.elf.dir/helloworld.c.obj -c /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/test_app/src/helloworld.c",
|
||||
"file": "/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/proj_cal/Vitis/test_app/src/helloworld.c"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,33 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
/*
|
||||
* helloworld.c: simple test application
|
||||
*
|
||||
* This application configures UART 16550 to baud rate 9600.
|
||||
* PS7 UART (Zynq) is not initialized by this application, since
|
||||
* bootrom/bsp configures it to baud rate 115200
|
||||
*
|
||||
* ------------------------------------------------
|
||||
* | UART TYPE BAUD RATE |
|
||||
* ------------------------------------------------
|
||||
* uartns550 9600
|
||||
* uartlite Configurable only in HW design
|
||||
* ps7_uart 115200 (configured by bootrom/bsp)
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "platform.h"
|
||||
#include "xil_printf.h"
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
init_platform();
|
||||
|
||||
print("Hello World\n\r");
|
||||
print("Successfully ran Hello World application");
|
||||
cleanup_platform();
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x2000;
|
||||
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x2000;
|
||||
|
||||
_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 1024;
|
||||
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 2048;
|
||||
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : 1024;
|
||||
_FIQ_STACK_SIZE = DEFINED(_FIQ_STACK_SIZE) ? _FIQ_STACK_SIZE : 1024;
|
||||
_UNDEF_STACK_SIZE = DEFINED(_UNDEF_STACK_SIZE) ? _UNDEF_STACK_SIZE : 1024;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
ps7_ddr_0 : ORIGIN = 0x100000, LENGTH = 0x3ff00000
|
||||
ps7_ram_0 : ORIGIN = 0x0, LENGTH = 0x30000
|
||||
ps7_ram_1 : ORIGIN = 0xffff0000, LENGTH = 0xfe00
|
||||
}
|
||||
|
||||
/* Specify the default entry point to the program */
|
||||
|
||||
ENTRY(_vector_table)
|
||||
|
||||
/* Define the sections, and where they are mapped in memory */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
KEEP (*(.vectors))
|
||||
*(.boot)
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.plt)
|
||||
*(.gnu_warning)
|
||||
*(.gcc_execpt_table)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.vfp11_veneer)
|
||||
*(.ARM.extab)
|
||||
*(.gnu.linkonce.armextab.*)
|
||||
*(.note.gnu.build-id)
|
||||
} > ps7_ddr_0
|
||||
|
||||
.init : {
|
||||
KEEP (*(.init))
|
||||
} > ps7_ddr_0
|
||||
|
||||
.fini : {
|
||||
KEEP (*(.fini))
|
||||
} > ps7_ddr_0
|
||||
|
||||
.rodata : {
|
||||
__rodata_start = .;
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
*(.gnu.linkonce.r.*)
|
||||
__rodata_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.rodata1 : {
|
||||
__rodata1_start = .;
|
||||
*(.rodata1)
|
||||
*(.rodata1.*)
|
||||
__rodata1_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.sdata2 : {
|
||||
__sdata2_start = .;
|
||||
*(.sdata2)
|
||||
*(.sdata2.*)
|
||||
*(.gnu.linkonce.s2.*)
|
||||
__sdata2_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.sbss2 : {
|
||||
__sbss2_start = .;
|
||||
*(.sbss2)
|
||||
*(.sbss2.*)
|
||||
*(.gnu.linkonce.sb2.*)
|
||||
__sbss2_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.data : {
|
||||
__data_start = .;
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
*(.jcr)
|
||||
*(.got)
|
||||
*(.got.plt)
|
||||
__data_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.data1 : {
|
||||
__data1_start = .;
|
||||
*(.data1)
|
||||
*(.data1.*)
|
||||
__data1_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.got : {
|
||||
*(.got)
|
||||
} > ps7_ddr_0
|
||||
|
||||
.ctors : {
|
||||
__CTOR_LIST__ = .;
|
||||
___CTORS_LIST___ = .;
|
||||
KEEP (*crtbegin.o(.ctors))
|
||||
KEEP (*(EXCLUDE_FILE(*crtend.o) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
__CTOR_END__ = .;
|
||||
___CTORS_END___ = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.dtors : {
|
||||
__DTOR_LIST__ = .;
|
||||
___DTORS_LIST___ = .;
|
||||
KEEP (*crtbegin.o(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE(*crtend.o) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
__DTOR_END__ = .;
|
||||
___DTORS_END___ = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.fixup : {
|
||||
__fixup_start = .;
|
||||
*(.fixup)
|
||||
__fixup_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.eh_frame : {
|
||||
*(.eh_frame)
|
||||
} > ps7_ddr_0
|
||||
|
||||
.eh_framehdr : {
|
||||
__eh_framehdr_start = .;
|
||||
*(.eh_framehdr)
|
||||
__eh_framehdr_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.gcc_except_table : {
|
||||
*(.gcc_except_table)
|
||||
} > ps7_ddr_0
|
||||
|
||||
.mmu_tbl (ALIGN(16384)) : {
|
||||
__mmu_tbl_start = .;
|
||||
*(.mmu_tbl)
|
||||
__mmu_tbl_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.ARM.exidx : {
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
*(.gnu.linkonce.armexidix.*.*)
|
||||
__exidx_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.preinit_array : {
|
||||
__preinit_array_start = .;
|
||||
KEEP (*(SORT(.preinit_array.*)))
|
||||
KEEP (*(.preinit_array))
|
||||
__preinit_array_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.init_array : {
|
||||
__init_array_start = .;
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
__init_array_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.fini_array : {
|
||||
__fini_array_start = .;
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
KEEP (*(.fini_array))
|
||||
__fini_array_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.drvcfg_sec : {
|
||||
. = ALIGN(8);
|
||||
__drvcfgsecdata_start = .;
|
||||
KEEP (*(.drvcfg_sec))
|
||||
__drvcfgsecdata_end = .;
|
||||
__drvcfgsecdata_size = __drvcfgsecdata_end - __drvcfgsecdata_start;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.ARM.attributes : {
|
||||
__ARM.attributes_start = .;
|
||||
*(.ARM.attributes)
|
||||
__ARM.attributes_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.sdata : {
|
||||
__sdata_start = .;
|
||||
*(.sdata)
|
||||
*(.sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
__sdata_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.sbss (NOLOAD) : {
|
||||
__sbss_start = .;
|
||||
*(.sbss)
|
||||
*(.sbss.*)
|
||||
*(.gnu.linkonce.sb.*)
|
||||
__sbss_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.tdata : {
|
||||
__tdata_start = .;
|
||||
*(.tdata)
|
||||
*(.tdata.*)
|
||||
*(.gnu.linkonce.td.*)
|
||||
__tdata_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.tbss : {
|
||||
__tbss_start = .;
|
||||
*(.tbss)
|
||||
*(.tbss.*)
|
||||
*(.gnu.linkonce.tb.*)
|
||||
__tbss_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.bss (NOLOAD) : {
|
||||
__bss_start = .;
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
__bss_end = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
_SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 );
|
||||
|
||||
_SDA2_BASE_ = __sdata2_start + ((__sbss2_end - __sdata2_start) / 2 );
|
||||
|
||||
/* Generate Stack and Heap definitions */
|
||||
|
||||
.heap (NOLOAD) : {
|
||||
. = ALIGN(16);
|
||||
_heap = .;
|
||||
HeapBase = .;
|
||||
_heap_start = .;
|
||||
. += _HEAP_SIZE;
|
||||
_heap_end = .;
|
||||
HeapLimit = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
.stack (NOLOAD) : {
|
||||
. = ALIGN(16);
|
||||
_stack_end = .;
|
||||
. += _STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
_stack = .;
|
||||
__stack = _stack;
|
||||
. = ALIGN(16);
|
||||
_irq_stack_end = .;
|
||||
. += _IRQ_STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
__irq_stack = .;
|
||||
_supervisor_stack_end = .;
|
||||
. += _SUPERVISOR_STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
__supervisor_stack = .;
|
||||
_abort_stack_end = .;
|
||||
. += _ABORT_STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
__abort_stack = .;
|
||||
_fiq_stack_end = .;
|
||||
. += _FIQ_STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
__fiq_stack = .;
|
||||
_undef_stack_end = .;
|
||||
. += _UNDEF_STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
__undef_stack = .;
|
||||
} > ps7_ddr_0
|
||||
|
||||
end = .;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
#include "xparameters.h"
|
||||
#include "xil_cache.h"
|
||||
|
||||
#ifndef SDT
|
||||
#include "platform_config.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Uncomment one of the following two lines, depending on the target,
|
||||
* if ps7/psu init source files are added in the source directory for
|
||||
* compiling example outside of SDK.
|
||||
*/
|
||||
/*#include "ps7_init.h"*/
|
||||
/*#include "psu_init.h"*/
|
||||
|
||||
#ifdef STDOUT_IS_16550
|
||||
#include "xuartns550_l.h"
|
||||
|
||||
#define UART_BAUD 9600
|
||||
#endif
|
||||
|
||||
void
|
||||
enable_caches()
|
||||
{
|
||||
#ifdef __PPC__
|
||||
Xil_ICacheEnableRegion(CACHEABLE_REGION_MASK);
|
||||
Xil_DCacheEnableRegion(CACHEABLE_REGION_MASK);
|
||||
#elif __MICROBLAZE__
|
||||
#ifdef XPAR_MICROBLAZE_USE_ICACHE
|
||||
Xil_ICacheEnable();
|
||||
#endif
|
||||
#ifdef XPAR_MICROBLAZE_USE_DCACHE
|
||||
Xil_DCacheEnable();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
disable_caches()
|
||||
{
|
||||
#ifdef __MICROBLAZE__
|
||||
#ifdef XPAR_MICROBLAZE_USE_DCACHE
|
||||
Xil_DCacheDisable();
|
||||
#endif
|
||||
#ifdef XPAR_MICROBLAZE_USE_ICACHE
|
||||
Xil_ICacheDisable();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
init_uart()
|
||||
{
|
||||
#ifdef STDOUT_IS_16550
|
||||
XUartNs550_SetBaud(STDOUT_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, UART_BAUD);
|
||||
XUartNs550_SetLineControlReg(STDOUT_BASEADDR, XUN_LCR_8_DATA_BITS);
|
||||
#endif
|
||||
/* Bootrom/BSP configures PS7/PSU UART to 115200 bps */
|
||||
}
|
||||
|
||||
void
|
||||
init_platform()
|
||||
{
|
||||
/*
|
||||
* If you want to run this example outside of SDK,
|
||||
* uncomment one of the following two lines and also #include "ps7_init.h"
|
||||
* or #include "ps7_init.h" at the top, depending on the target.
|
||||
* Make sure that the ps7/psu_init.c and ps7/psu_init.h files are included
|
||||
* along with this example source files for compilation.
|
||||
*/
|
||||
/* ps7_init();*/
|
||||
/* psu_init();*/
|
||||
enable_caches();
|
||||
init_uart();
|
||||
}
|
||||
|
||||
void
|
||||
cleanup_platform()
|
||||
{
|
||||
disable_caches();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __PLATFORM_H_
|
||||
#define __PLATFORM_H_
|
||||
|
||||
#ifndef SDT
|
||||
#include "platform_config.h"
|
||||
#endif
|
||||
|
||||
void init_platform();
|
||||
void cleanup_platform();
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user