-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
f8c606ae20452ba6df087224da81ee226eea78b1 Change-Id: Ib140fe5bdd1444c0813a1c4b853fcc05a56d860f
- Loading branch information
Showing
162 changed files
with
170,701 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) 2022-2024 Atmosic | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_include_directories( | ||
include | ||
include/arm | ||
include/armgcc | ||
include/reg | ||
) | ||
|
||
if (CONFIG_ATM_ENABLE_NSC_EXAMPLE) | ||
zephyr_include_directories( | ||
examples/spe/src/cust_sec_func | ||
) | ||
endif() | ||
|
||
add_subdirectory(lib) | ||
add_subdirectory(drivers) | ||
|
||
zephyr_linker_sources(NOINIT noinit.ld) | ||
zephyr_linker_sources(RAMFUNC_SECTION ramfunc-section.ld) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
******************************************************************************* | ||
* | ||
* @file atm33-mbedtls-config.h | ||
* | ||
* @brief mbedtls glue for Atmosic HW engines | ||
* | ||
* Copyright (C) Atmosic 2023 | ||
* | ||
******************************************************************************* | ||
*/ | ||
|
||
#pragma once | ||
|
||
#ifdef CONFIG_ATM_AES_HW | ||
|
||
#define MBEDTLS_AES_SETKEY_ENC_ALT | ||
#define MBEDTLS_AES_SETKEY_DEC_ALT | ||
#define MBEDTLS_AES_ENCRYPT_ALT | ||
#define MBEDTLS_AES_DECRYPT_ALT | ||
|
||
#endif | ||
|
||
#ifdef CONFIG_ATM_SHA2_HW | ||
|
||
#define MBEDTLS_SHA256_ALT | ||
|
||
#endif | ||
|
||
#ifdef CONFIG_ATM_UECC | ||
|
||
#define MBEDTLS_ECDSA_GENKEY_ALT | ||
#define MBEDTLS_ECDSA_SIGN_ALT | ||
#define MBEDTLS_ECDSA_VERIFY_ALT | ||
#undef MBEDTLS_ECP_DP_SECP384R1_ENABLED | ||
#undef MBEDTLS_ECP_DP_SECP521R1_ENABLED | ||
#undef MBEDTLS_ECP_DP_SECP192K1_ENABLED | ||
#undef MBEDTLS_ECP_DP_SECP224K1_ENABLED | ||
#undef MBEDTLS_ECP_DP_BP256R1_ENABLED | ||
#undef MBEDTLS_ECP_DP_BP384R1_ENABLED | ||
#undef MBEDTLS_ECP_DP_BP512R1_ENABLED | ||
#undef MBEDTLS_ECP_DP_CURVE25519_ENABLED | ||
#undef MBEDTLS_ECP_DP_CURVE448_ENABLED | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# Copyright (c) 2023-2024 Atmosic | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_include_directories( | ||
atm_bp_clock | ||
dma | ||
flash | ||
rep_vec | ||
sec_cache | ||
sec_jrnl | ||
sec_reset | ||
spi | ||
timer | ||
trng | ||
) | ||
|
||
if (CONFIG_ATM_PLF_DEBUG) | ||
zephyr_compile_definitions( | ||
CFG_PLF_DEBUG | ||
) | ||
zephyr_sources( | ||
user_debug.c | ||
) | ||
endif () | ||
|
||
if (CONFIG_ADC OR CONFIG_BT OR CONFIG_ENTROPY_ATM_TRNG OR CONFIG_PM) | ||
zephyr_include_directories( | ||
reset | ||
workarounds | ||
) | ||
zephyr_sources( | ||
reset/reset.c | ||
workarounds/workarounds.c | ||
) | ||
endif () | ||
|
||
if ((CONFIG_BT OR CONFIG_ENTROPY_ATM_TRNG) AND CONFIG_USE_ATMWSTK) | ||
zephyr_include_directories( | ||
atmwstk | ||
) | ||
zephyr_sources( | ||
atmwstk/atmwstk.c | ||
) | ||
endif () | ||
|
||
if (CONFIG_TRUSTED_EXECUTION_SECURE OR CONFIG_SOC_FLASH_ATM_RRAM) | ||
zephyr_include_directories( | ||
rram_rom_prot | ||
) | ||
zephyr_sources( | ||
rram_rom_prot/rram_rom_prot.c | ||
) | ||
endif () | ||
|
||
if (CONFIG_TRUSTED_EXECUTION_SECURE) | ||
zephyr_sources( | ||
sec_cache/sec_cache.c | ||
sec_jrnl/sec_jrnl.c | ||
) | ||
|
||
if (NOT CONFIG_MCUBOOT) | ||
zephyr_include_directories( | ||
at_tz_mpc | ||
sec_dev_lockout | ||
) | ||
zephyr_sources( | ||
at_tz_mpc/at_tz_mpc.c | ||
sec_dev_lockout/sec_dev_lockout.c | ||
sec_reset/sec_reset.c | ||
) | ||
endif () | ||
endif () | ||
|
||
if ((CONFIG_TRUSTED_EXECUTION_NONSECURE AND (CONFIG_SOC_FLASH_ATM OR CONFIG_BT OR CONFIG_ENTROPY_ATM_TRNG OR CONFIG_PM OR CONFIG_ADC)) OR (CONFIG_TRUSTED_EXECUTION_SECURE AND NOT CONFIG_BOOTLOADER_MCUBOOT)) | ||
zephyr_sources( | ||
atm_bp_clock/atm_bp_clock.c | ||
spi/spi.c | ||
) | ||
endif () | ||
|
||
if (CONFIG_ATM_AES_HW OR CONFIG_ATM_SHA2_HW OR CONFIG_ATM_UECC) | ||
zephyr_include_directories( | ||
../config | ||
) | ||
zephyr_link_libraries(mbedTLS) | ||
endif () | ||
|
||
if (CONFIG_ATM_AES_HW) | ||
zephyr_include_directories( | ||
atm_aes | ||
) | ||
zephyr_sources( | ||
atm_aes/atm_aes.c | ||
atm_aes/aes_alt.c | ||
) | ||
endif () | ||
|
||
if (CONFIG_ATM_SHA2_HW OR CONFIG_ATM_SHA2_HW_BOOTUTIL) | ||
zephyr_include_directories( | ||
atm_sha2 | ||
) | ||
zephyr_sources( | ||
atm_sha2/atm_sha2.c | ||
) | ||
endif () | ||
if (CONFIG_ATM_SHA2_HW) | ||
zephyr_sources( | ||
atm_sha2/sha256_alt.c | ||
) | ||
endif () | ||
|
||
if (CONFIG_ATM_UECC) | ||
zephyr_include_directories( | ||
micro-ecc | ||
) | ||
zephyr_sources( | ||
micro-ecc/ecdsa_alt.c | ||
) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (c) 2023-2024 Atmosic | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
config ATM_AES_HW | ||
bool "Hardware accelerator for AES" | ||
default y | ||
depends on MBEDTLS_CIPHER_AES_ENABLED && !USERSPACE | ||
select MBEDTLS_USER_CONFIG_ENABLE | ||
|
||
config ATM_SHA2_HW | ||
bool "Hardware accelerator for SHA256 hash" | ||
default n | ||
depends on MBEDTLS_HASH_SHA256_ENABLED && !USERSPACE | ||
select MBEDTLS_USER_CONFIG_ENABLE | ||
|
||
config ATM_SHA2_HW_BOOTUTIL | ||
bool "Hardware accelerator for SHA256 hash supporting bootutil API (only used by MCUBOOT)" | ||
default n | ||
|
||
config ATM_UECC | ||
bool "Optimized ECC library" | ||
default n | ||
depends on MBEDTLS_ECDSA_C | ||
|
||
config MBEDTLS_USER_CONFIG_FILE | ||
default "atm33-mbedtls-config.h" if ATM_AES_HW || ATM_SHA2_HW || ATM_UECC |
Oops, something went wrong.