2727#
2828
2929# Set the mbed TLS release to import (this can/should be edited before import)
30- MBED_TLS_RELEASE ?= mbedtls-2.20.0d1
30+ MBED_TLS_RELEASE ?= mbedtls-2.22.0
3131MBED_TLS_REPO_URL ?=
[email protected] :ARMmbed/mbedtls.git
3232
3333# Translate between mbed TLS namespace and mbed namespace
@@ -36,9 +36,20 @@ TARGET_SRC:=$(TARGET_PREFIX)src
3636TARGET_INC: =$(TARGET_PREFIX ) inc
3737TARGET_TESTS: =$(TARGET_PREFIX ) TESTS
3838
39+ # A folder structure is introduced here for targets that have both a Secure
40+ # Processing Environment (SPE) targets and Non-secure Processing Environment
41+ # (NSPE). Documentation for each folder as follows:
42+ # COMPONENT_PSA_SRV_IMPL - Include secure service implementation code. For
43+ # example PSA Crypto or PSA Secure Time implementations
44+ TARGET_SRV_IMPL: =$(TARGET_PREFIX ) /platform/COMPONENT_PSA_SRV_IMPL
45+ # COMPONENT_NSPE - Include code that compiles ONLY to the NSPE image and never
46+ # compiles to the SPE image
47+ TARGET_NSPE: =$(TARGET_SRV_IMPL ) /COMPONENT_NSPE
48+
3949# mbed TLS source directory - hidden from mbed via TARGET_IGNORE
4050MBED_TLS_DIR: =TARGET_IGNORE/mbedtls
4151MBED_TLS_API: =$(MBED_TLS_DIR ) /include/mbedtls
52+ CRYPTO_API: =$(MBED_TLS_DIR ) /include/psa
4253MBED_TLS_GIT_CFG =$(MBED_TLS_DIR ) /.git/config
4354
4455.PHONY : all deploy deploy-tests rsync mbedtls clean update
@@ -57,10 +68,24 @@ rsync:
5768 rm -rf $(TARGET_INC )
5869 mkdir -p $(TARGET_INC )
5970 rsync -a --delete $(MBED_TLS_API ) $(TARGET_INC )
71+ rsync -a --delete --exclude=' crypto_struct.h' $(CRYPTO_API ) $(TARGET_INC ) /
6072 #
6173 # Copying licenses
6274 cp $(MBED_TLS_DIR ) /LICENSE $(TARGET_PREFIX )
6375 #
76+ # Copying Mbed Crypto into Mbed OS...
77+ rm -rf $(TARGET_SRV_IMPL )
78+
79+ mkdir -p $(TARGET_SRV_IMPL)
80+ mkdir -p $(TARGET_NSPE)
81+
82+ rsync -a --delete $(CRYPTO_API)/crypto_struct.h $(TARGET_NSPE)/
83+ rsync -a --delete $(MBED_TLS_DIR)/library/psa_*.c $(TARGET_SRV_IMPL)/
84+ rsync -a --delete $(MBED_TLS_DIR)/library/psa_*.h $(TARGET_SRV_IMPL)/
85+ #
86+ # Remove PSA-specific C & H files (they go into $(TARGET_SRV_IMPL))
87+ rm -rf $(TARGET_SRC)/psa_*.c
88+ rm -rf $(TARGET_SRC)/psa_*.h
6489
6590deploy : rsync
6691 #
@@ -110,3 +135,4 @@ clean:
110135 rm -rf $(TARGET_SRC )
111136 rm -rf $(TARGET_INC )
112137 rm -rf $(MBED_TLS_DIR )
138+ rm -rf $(TARGET_SRV_IMPL )
0 commit comments