Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: platforms: xlnx: Update machine from 'zynqmp_' to 'xlnx_' #305

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
130a908
examples: linux: zynqmp: Add IPI uio based API implementation
Mar 14, 2019
82f7603
examples: linux: add IPI with R5 rproc kick sysfs impelmentation
Mar 18, 2019
81ca995
examples: linux: zynqmp: Use IPI commit API
Mar 18, 2019
c2533b4
examples: linux: libmetal_amp_demod: add macro guards for IPI
Mar 27, 2019
9f4a838
examples: linux: zynqmp_r5: dynamically set TTC and IPI vars
Mar 27, 2019
6c174a7
examples: generic: zynqmp_r5: dynamically set TTC and IPI vars
Mar 27, 2019
1b5b5a5
examples: freertos: zynqmp_r5: dynamically set TTC and IPI vars
Mar 27, 2019
6b82085
libmetal: amp_demo: improve performance measurement
kernelchuk Oct 4, 2020
75159e7
examples: linux: add an option to set debug log level
kernelchuk Aug 10, 2021
c7edeb0
log: update ML_ERR, ML_INFO, ML_DBG macros
kernelchuk Jan 5, 2022
ed732a9
log: default to function, line number prefix
kernelchuk Nov 24, 2023
ee95b7a
test: linux: add test for multiple IO regions
Jun 6, 2022
2ac9c17
examples: freertos: define xInterruptController in System Device Tree…
bentheredonethat Aug 14, 2023
3ef1b92
examples: linux: zynqmp: Remove MB definition
bentheredonethat Sep 5, 2023
d988212
examples: generic: zynqmp_r5: Add symbols for System Device Flow flow
bentheredonethat Nov 13, 2024
68f4ba0
lib: generic: xlnx: Use CMAKE_C_FLAGS to determine if SDT symbol is p…
bentheredonethat Jan 29, 2024
5805b7f
examples: linux: zynqmp: Add Versal-NET IPI Values
bentheredonethat Jan 30, 2024
22e8f5f
examples: linux: zynqmp: Fix Typo in ZynqMP IPI Base address
bentheredonethat Feb 19, 2024
d381e62
examples: linux: zynqmp: Enable Values to be mutable
bentheredonethat Feb 27, 2024
3c27d85
examples: zynqmp_r5: CMake: Enable demo to build without libxil prese…
bentheredonethat Feb 27, 2024
8eca38f
examples: zynqmp_r5: CMake: Add SDT-required libs as link dependencies
bentheredonethat Aug 14, 2024
7ae1fe9
examples: freertos: zynqmp_r5: zynqmp_amp_demo: Add symbols for Syste…
bentheredonethat Sep 19, 2024
19ece34
examples: zynqmp_r5: Enable CMake to pass in app binary name
bentheredonethat Nov 13, 2024
9dbceb6
cmake: platforms: xlnx: Update machine from 'zynqmp_' to 'xlnx_'
bentheredonethat Aug 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if (WITH_ZEPHYR)
endif (WITH_ZEPHYR)

option (WITH_DEFAULT_LOGGER "Build with default logger" ON)
option (WITH_FUNC_LINE_LOG "Log with function name, line number prefix" OFF)
option (WITH_FUNC_LINE_LOG "Log with function name, line number prefix" ON)

option (WITH_DOC "Build with documentation" ON)

Expand Down
8 changes: 8 additions & 0 deletions cmake/platforms/xlnx-a53-freertos.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set (CMAKE_SYSTEM_PROCESSOR "aarch64" CACHE STRING "")
set (MACHINE "xlnx_a53" CACHE STRING "")
set (PROJECT_VENDOR "xlnx" CACHE STRING "")
set (CROSS_PREFIX "aarch64-none-elf-" CACHE STRING "")
set (CMAKE_C_FLAGS "" CACHE STRING "")

include (cross-freertos-gcc)

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set (CMAKE_SYSTEM_PROCESSOR "aarch64" CACHE STRING "")
set (MACHINE "zynqmp_a53" CACHE STRING "")
set (MACHINE "xlnx_a53" CACHE STRING "")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

set (PROJECT_VENDOR "xlnx" CACHE STRING "")
set (CROSS_PREFIX "aarch64-none-elf-" CACHE STRING "")
set (CMAKE_C_FLAGS "" CACHE STRING "")
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions cmake/platforms/xlnx-r5-freertos.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set (CMAKE_SYSTEM_PROCESSOR "arm" CACHE STRING "")
set (MACHINE "xlnx_r5" CACHE STRING "")
set (PROJECT_VENDOR "xlnx" CACHE STRING "")
set (CROSS_PREFIX "armr5-none-eabi-" CACHE STRING "")
set (CMAKE_C_FLAGS "-mfloat-abi=soft -mcpu=cortex-r5" CACHE STRING "")

include (cross-freertos-gcc)

10 changes: 10 additions & 0 deletions cmake/platforms/xlnx-r5-generic.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set (CMAKE_SYSTEM_PROCESSOR "arm" CACHE STRING "")
set (MACHINE "xlnx_r5" CACHE STRING "")
set (CROSS_PREFIX "armr5-none-eabi-" CACHE STRING "")
set (PROJECT_VENDOR "xlnx" CACHE STRING "")

# Xilinx SDK version earlier than 2017.2 use mfloat-abi=soft by default to generate libxil
set (CMAKE_C_FLAGS "-mfloat-abi=hard -mfpu=vfpv3-d16 -mcpu=cortex-r5" CACHE STRING "")

include (cross-generic-gcc)

8 changes: 0 additions & 8 deletions cmake/platforms/zynqmp-a53-freertos.cmake

This file was deleted.

8 changes: 0 additions & 8 deletions cmake/platforms/zynqmp-r5-freertos.cmake

This file was deleted.

10 changes: 0 additions & 10 deletions cmake/platforms/zynqmp-r5-generic.cmake

This file was deleted.

20 changes: 15 additions & 5 deletions examples/system/freertos/xlnx_r5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@ collect(PROJECT_LIB_DEPS xil)
collect(PROJECT_LIB_DEPS c)
collect(PROJECT_LIB_DEPS m)

get_property (HAS_SYSTEM_DT GLOBAL PROPERTY HAS_SYSTEM_DT)
if (HAS_SYSTEM_DT)
# SDT flow has broken up libxil into multiple libs. Below libs are required
# for compilation.
collect(PROJECT_LIB_DEPS xilstandalone)
collect(PROJECT_LIB_DEPS xiltimer)
endif(HAS_SYSTEM_DT)

set (_lib "xil")
find_library (_lib_path ${_lib})
if (NOT _lib_path)
message ( "external library ${_lib_path} not found" )
message ( "hint: you may need to pass -DCMAKE_LIBRARY_PATH=<path>" )
message ( FATAL_ERROR "library ${_lib} is required to build the examples" )
endif (NOT _lib_path)
if (NOT CMAKE_C_FLAGS MATCHES "SDT")
if (NOT _lib_path)
message ( "external library ${_lib_path} not found" )
message ( "hint: you may need to pass -DCMAKE_LIBRARY_PATH=<path>" )
message ( FATAL_ERROR "library ${_lib} is required to build the examples" )
endif (NOT _lib_path)
endif (NOT CMAKE_C_FLAGS MATCHES "SDT")
get_filename_component (_lib_path ${_lib_path} DIRECTORY)
collect (PROJECT_LIB_DIRS ${_lib_path})

Expand Down
24 changes: 22 additions & 2 deletions examples/system/freertos/xlnx_r5/amp_demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ set (_linker_script ${CMAKE_CURRENT_SOURCE_DIR}/lscript.ld)

set (_src_common ${CMAKE_CURRENT_SOURCE_DIR}/init_${PROJECT_SYSTEM}.c)
set (_app0 libmetal_amp_demod)
set (_src0 ${CMAKE_CURRENT_SOURCE_DIR}/${_app0}.c)

if (DEFINED CMAKE_PROJECT_NAME)
set (_app0 ${CMAKE_PROJECT_NAME})
endif(DEFINED CMAKE_PROJECT_NAME)

set (_src0 ${CMAKE_CURRENT_SOURCE_DIR}/libmetal_amp_demod.c)

list(APPEND _src0 ${CMAKE_CURRENT_SOURCE_DIR}/sys_init.c)
list(APPEND _src0 ${CMAKE_CURRENT_SOURCE_DIR}/shmem_demod.c)
list(APPEND _src0 ${CMAKE_CURRENT_SOURCE_DIR}/shmem_atomic_demod.c)
Expand All @@ -19,10 +25,24 @@ list(APPEND _src0 ${CMAKE_CURRENT_SOURCE_DIR}/ipi_latency_demod.c)
list(APPEND _src0 ${CMAKE_CURRENT_SOURCE_DIR}/shmem_latency_demod.c)
list(APPEND _src0 ${CMAKE_CURRENT_SOURCE_DIR}/shmem_throughput_demod.c)

include(CheckSymbolExists)
check_symbol_exists(SDT "bspconfig.h" HAS_SYSTEM_DT)
check_symbol_exists(VERSAL_NET "bspconfig.h" IS_VERSAL_NET)
if (HAS_SYSTEM_DT)
if (IS_VERSAL_NET)
set (_linker_script ${CMAKE_CURRENT_SOURCE_DIR}/lscript_sdt_versal_net.ld)
else()
set (_linker_script ${CMAKE_CURRENT_SOURCE_DIR}/lscript_sdt.ld)
endif(IS_VERSAL_NET)
endif(HAS_SYSTEM_DT)

if (DEFINED DEMO_LINK_FLAGS)
set (_deps "${_deps} ${DEMO_LINK_FLAGS}")
endif()

get_property (_linker_options GLOBAL PROPERTY TEST_LINKER_OPTIONS)
add_executable (${_app0}.elf ${_src0})
get_property (_ec_flgs GLOBAL PROPERTY "PROJECT_EC_FLAGS")
target_compile_options (${_app0}.elf PUBLIC ${_ec_flgs})
target_link_libraries(${_app0}.elf -Wl,-Map=${_app0}.map -Wl,--gc-sections -T\"${_linker_script}\" -Wl,--start-group ${_deps} -Wl,--end-group)
install (TARGETS ${_app0}.elf RUNTIME DESTINATION bin)

55 changes: 44 additions & 11 deletions examples/system/freertos/xlnx_r5/amp_demo/common.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*
* Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
* Copyright (c) 2017 - 2022, Xilinx Inc. and Contributors. All rights reserved.
* Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

#ifndef __COMMON_H__
#define __COMMON_H__
Expand All @@ -22,11 +23,46 @@
#include <sys/types.h>
#include "sys_init.h"

#if defined(PLATFORM_ZYNQMP)

#define TTC0_BASE_ADDR 0xff110000
#define TTC_DEV_NAME "ff110000.ttc"
#define IPI_MASK 0x1000000

#if XPAR_CPU_ID == 0
#define IPI_DEV_NAME "ff310000.ipi"
#define IPI_BASE_ADDR 0xff310000
#define IPI_IRQ_VECT_ID 65
#else
#define IPI_DEV_NAME "ff320000.ipi"
#define IPI_BASE_ADDR 0xff320000
#define IPI_IRQ_VECT_ID 66
#endif

#elif defined(versal)
#define TTC0_BASE_ADDR 0xFF0E0000
#define IPI_BASE_ADDR 0xFF340000
#define IPI_IRQ_VECT_ID 63
#define IPI_MASK 0x0000020
#define TTC_DEV_NAME "ff0e0000.ttc"
#define IPI_DEV_NAME "ff340000.ipi"

#elif defined(VERSAL_NET)

#define TTC0_BASE_ADDR 0xFD1C0000
#define IPI_BASE_ADDR 0xEB340000
#define IPI_IRQ_VECT_ID 90
#define IPI_MASK 0x0000020
#define TTC_DEV_NAME "fd1c0000.ttc"
#define IPI_DEV_NAME "eb340000.ipi"
#endif

/* Devices names */
#define BUS_NAME "generic"
#define IPI_DEV_NAME "ff310000.ipi"
#define SHM_DEV_NAME "3ed80000.shm"
#define TTC_DEV_NAME "ff110000.ttc"
#define SHM_DEV_NAME "3ed80000.shm"

#define INTC_DEVICE_ID XPAR_SCUGIC_0_DEVICE_ID
#define SHM_BASE_ADDR 0x3ED80000

/* IPI registers offset */
#define IPI_TRIG_OFFSET 0x0 /* IPI trigger reg offset */
Expand All @@ -36,9 +72,6 @@
#define IPI_IER_OFFSET 0x18 /* IPI interrupt enable reg offset */
#define IPI_IDR_OFFSET 0x1C /* IPI interrupt disable reg offset */

#define IPI_MASK 0x1000000 /* IPI mask for kick from APU.
We use PL0 IPI in this demo. */

/* TTC counter offsets */
#define XTTCPS_CLK_CNTRL_OFFSET 0x0 /* TTC counter clock control reg offset */
#define XTTCPS_CNT_CNTRL_OFFSET 0xC /* TTC counter control reg offset */
Expand Down Expand Up @@ -160,4 +193,4 @@
}

#endif /* __COMMON_H__ */

Check failure on line 196 in examples/system/freertos/xlnx_r5/amp_demo/common.h

View workflow job for this annotation

GitHub Actions / compliance review

TRAILING_WHITESPACE

examples/system/freertos/xlnx_r5/amp_demo/common.h:196 trailing whitespace

Check warning on line 196 in examples/system/freertos/xlnx_r5/amp_demo/common.h

View workflow job for this annotation

GitHub Actions / compliance review

LEADING_SPACE

examples/system/freertos/xlnx_r5/amp_demo/common.h:196 please, no spaces at the start of a line
Loading
Loading