Skip to content

Commit fd411d4

Browse files
committed
Build: Accommodate tf-psa-crypto-driver repository
- Switch cc3xx driver to use a dedicated PSA crypto driver repository - Remove cc3xx driver from rse/driver/cc3xx directory Signed-off-by: Anton Komlev <anton.komlev@arm.com> Change-Id: I3cecb86b5dd566db71a6b0d8c2123ee501675bfd
1 parent 553f21c commit fd411d4

134 files changed

Lines changed: 42 additions & 32405 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

platform/ext/accelerator/cc312/CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ endif()
1919
# The config files need to access crypto accelerator configurations.
2020
target_include_directories(psa_crypto_library_config
2121
INTERFACE
22-
${CMAKE_CURRENT_SOURCE_DIR}
22+
.
2323
)
2424

2525
# CC log level is controlled indirectly through the SP log level. When SP log is
@@ -31,6 +31,9 @@ else()
3131
set(CC_LOG_ENABLED $<CONFIG:Debug,relwithdebinfo>)
3232
endif()
3333

34+
# Fetch PSA Crypto drivers from external repository
35+
add_subdirectory(${PLATFORM_DIR}/ext/target/arm/drivers/cc3xx cc3xx-src)
36+
3437
################################ BL2 ###########################################
3538

3639
if (BL2)
@@ -46,7 +49,7 @@ if (BL2)
4649
set(CC3XX_TARGET_PREFIX bl2_)
4750
set(SAVED_BUILD_TYPE ${CMAKE_BUILD_TYPE})
4851
set(CMAKE_BUILD_TYPE ${TF_PSA_CRYPTO_BUILD_TYPE})
49-
add_subdirectory(${PLATFORM_DIR}/ext/target/arm/drivers/cc3xx ${CMAKE_CURRENT_BINARY_DIR}/${CC3XX_TARGET_PREFIX}cc3xx)
52+
add_subdirectory(${CC3XX_DRIVER_PATH} ${CC3XX_TARGET_PREFIX}cc3xx)
5053
set(CMAKE_BUILD_TYPE ${SAVED_BUILD_TYPE})
5154

5255
target_link_libraries(bl2_crypto
@@ -56,7 +59,7 @@ if (BL2)
5659

5760
target_include_directories(bl2_crypto_config
5861
INTERFACE
59-
${CMAKE_CURRENT_SOURCE_DIR}
62+
.
6063
)
6164

6265
target_link_libraries(${CC3XX_TARGET_PREFIX}cc3xx_psa_driver_api
@@ -102,7 +105,7 @@ if (TFM_PARTITION_CRYPTO)
102105
set(CC312_DRIVER_API_TARGET ${CC3XX_TARGET_PREFIX}cc3xx_psa_driver_api)
103106
set(CC3XX_PLATFORM_INTERFACE platform_s)
104107

105-
add_subdirectory(${PLATFORM_DIR}/ext/target/arm/drivers/cc3xx ${CMAKE_CURRENT_BINARY_DIR}/${CC3XX_TARGET_PREFIX}cc3xx)
108+
add_subdirectory(${CC3XX_DRIVER_PATH} ${CC3XX_TARGET_PREFIX}cc3xx)
106109

107110
target_sources(crypto_service_crypto_hw
108111
PRIVATE
@@ -121,12 +124,12 @@ if (TFM_PARTITION_CRYPTO)
121124
target_sources(crypto_service_crypto_hw
122125
PRIVATE
123126
cc312.c
124-
$<$<BOOL:${CC_LOG_ENABLED}>:${CMAKE_CURRENT_SOURCE_DIR}/cc312_log.c>
127+
$<$<BOOL:${CC_LOG_ENABLED}>:cc312_log.c>
125128
)
126129

127130
target_include_directories(crypto_service_crypto_hw
128131
PUBLIC
129-
${CMAKE_CURRENT_SOURCE_DIR}
132+
.
130133
)
131134

132135
target_link_libraries(crypto_service_crypto_hw
@@ -147,7 +150,7 @@ if (TFM_PARTITION_CRYPTO)
147150

148151
target_sources(${CC312_LIB_PREFIX}cc312
149152
PRIVATE
150-
$<$<BOOL:${CC_LOG_ENABLED}>:${CMAKE_CURRENT_SOURCE_DIR}/cc312_log.c>
153+
$<$<BOOL:${CC_LOG_ENABLED}>:cc312_log.c>
151154
)
152155

153156
target_compile_options(${CC312_LIB_PREFIX}cc312

platform/ext/target/arm/drivers/cc3xx/CMakeLists.txt

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,25 @@
55
#
66
#-------------------------------------------------------------------------------
77

8-
set(CC3XX_TARGET_NAME ${CC3XX_TARGET_PREFIX}cc3xx)
8+
cmake_minimum_required(VERSION 3.21)
99

10-
add_subdirectory(low_level_driver)
11-
add_subdirectory(psa_driver_api)
10+
include(FetchContent)
11+
set(FETCHCONTENT_QUIET FALSE)
1212

13-
if (TEST_CC3XX)
14-
add_subdirectory(tests)
15-
endif()
13+
# Default configuration of cc3xx repository
14+
set(PSA_CRYPTO_DRIVER_PATH DOWNLOAD CACHE PATH "Path to cc3xx Crypto driver (or DOWNLOAD to fetch automatically")
15+
set(PSA_CRYPTO_DRIVER_NAME vendor/arm/cc3xx CACHE STRING "PSA Crypto driver name")
16+
17+
fetch_remote_library(
18+
LIB_NAME cc3xx
19+
LIB_SOURCE_PATH_VAR PSA_CRYPTO_DRIVER_PATH
20+
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
21+
LIB_BASE_DIR "${CMAKE_BINARY_DIR}/driver"
22+
FETCH_CONTENT_ARGS
23+
GIT_REPOSITORY https://git.trustedfirmware.org/shared/tf-psa-crypto-drivers
24+
GIT_TAG main
25+
GIT_SHALLOW TRUE
26+
GIT_PROGRESS TRUE
27+
)
28+
29+
set(CC3XX_DRIVER_PATH ${PSA_CRYPTO_DRIVER_PATH}/${PSA_CRYPTO_DRIVER_NAME} CACHE PATH "CC3XX Crypto driver path")

platform/ext/target/arm/drivers/cc3xx/common/cc3xx_error.h

Lines changed: 0 additions & 68 deletions
This file was deleted.

platform/ext/target/arm/drivers/cc3xx/common/cc3xx_log.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

platform/ext/target/arm/drivers/cc3xx/common/cc3xx_stdlib.c

Lines changed: 0 additions & 66 deletions
This file was deleted.

platform/ext/target/arm/drivers/cc3xx/common/cc3xx_stdlib.h

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)