27
27
#
28
28
29
29
# 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
31
31
MBED_TLS_REPO_URL ?= git@github.com:ARMmbed/mbedtls.git
32
32
33
33
# Translate between mbed TLS namespace and mbed namespace
@@ -36,9 +36,23 @@ TARGET_SRC:=$(TARGET_PREFIX)src
36
36
TARGET_INC: =$(TARGET_PREFIX ) inc
37
37
TARGET_TESTS: =$(TARGET_PREFIX ) TESTS
38
38
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_SPE - Include code that compiles ONLY to the SPE image and never
46
+ # compiles to the NSPE image
47
+ TARGET_SPE: =$(TARGET_PREFIX ) /platform/COMPONENT_SPE
48
+ # COMPONENT_NSPE - Include code that compiles ONLY to the NSPE image and never
49
+ # compiles to the SPE image
50
+ TARGET_NSPE: =$(TARGET_SRV_IMPL ) /COMPONENT_NSPE
51
+
39
52
# mbed TLS source directory - hidden from mbed via TARGET_IGNORE
40
53
MBED_TLS_DIR: =TARGET_IGNORE/mbedtls
41
54
MBED_TLS_API: =$(MBED_TLS_DIR ) /include/mbedtls
55
+ CRYPTO_API: =$(MBED_TLS_DIR ) /include/psa
42
56
MBED_TLS_GIT_CFG =$(MBED_TLS_DIR ) /.git/config
43
57
44
58
.PHONY : all deploy deploy-tests rsync mbedtls clean update
@@ -57,10 +71,27 @@ rsync:
57
71
rm -rf $(TARGET_INC )
58
72
mkdir -p $(TARGET_INC )
59
73
rsync -a --delete $(MBED_TLS_API ) $(TARGET_INC )
74
+ rsync -a --delete --exclude=' crypto_struct.h' $(CRYPTO_API ) $(TARGET_INC ) /
60
75
#
61
76
# Copying licenses
62
77
cp $(MBED_TLS_DIR ) /LICENSE $(TARGET_PREFIX )
63
78
#
79
+ # Copying Mbed Crypto into Mbed OS...
80
+ rm -rf $(TARGET_SRV_IMPL )
81
+ rm -rf $(TARGET_SPE )
82
+
83
+ mkdir -p $(TARGET_SRV_IMPL)
84
+ mkdir -p $(TARGET_SPE)
85
+ mkdir -p $(TARGET_NSPE)
86
+
87
+ rsync -a --delete $(CRYPTO_API)/crypto_struct.h $(TARGET_NSPE)/
88
+ rsync -a --delete $(CRYPTO_API)/crypto_struct.h $(TARGET_SPE)/crypto_struct_spe.h
89
+ rsync -a --delete $(MBED_TLS_DIR)/library/psa_*.c $(TARGET_SRV_IMPL)/
90
+ rsync -a --delete $(MBED_TLS_DIR)/library/psa_*.h $(TARGET_SRV_IMPL)/
91
+ #
92
+ # Remove PSA-specific C & H files (they go into $(TARGET_SRV_IMPL))
93
+ rm -rf $(TARGET_SRC)/psa_*.c
94
+ rm -rf $(TARGET_SRC)/psa_*.h
64
95
65
96
deploy : rsync
66
97
#
@@ -110,3 +141,5 @@ clean:
110
141
rm -rf $(TARGET_SRC )
111
142
rm -rf $(TARGET_INC )
112
143
rm -rf $(MBED_TLS_DIR )
144
+ rm -rf $(TARGET_SRV_IMPL )
145
+ rm -rf $(TARGET_SPE )
0 commit comments