Skip to content

Commit

Permalink
optee ftpm: CFG_TA_FTPM_RPMB_STORAGE selects RPMB storage
Browse files Browse the repository at this point in the history
Adds configuration switch CFG_TA_FTPM_RPMB_STORAGE that, when enable,
makes fTPM OP-TEE TA to explicitly use the eMMC RPMB secure storage of
OP-TEE instead of OP-TEE private storage which depends on OP-TEE
configuration. The configuration switch is default disabled for
compatibility reasons.

Signed-off-by: Etienne Carriere <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
  • Loading branch information
etienne-lms committed Dec 18, 2024
1 parent ea90e5a commit 85bc88d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions platform/NVMem.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ _plat__NvInitFromStorage()
objID = s_StorageObjectID + i;

// Attempt to open TEE persistent storage object.
Result = TEE_OpenPersistentObject(TEE_STORAGE_PRIVATE,
Result = TEE_OpenPersistentObject(CFG_FTPM_TA_TEE_STORAGE_ID,
(void *)&objID,
sizeof(objID),
TA_STORAGE_FLAGS,
Expand All @@ -175,7 +175,7 @@ _plat__NvInitFromStorage()
}

// Storage object was not found, create it.
Result = TEE_CreatePersistentObject(TEE_STORAGE_PRIVATE,
Result = TEE_CreatePersistentObject(CFG_FTPM_TA_TEE_STORAGE_ID,
(void *)&objID,
sizeof(objID),
TA_STORAGE_FLAGS,
Expand Down Expand Up @@ -313,7 +313,7 @@ _plat__NvWriteBack()
// Force storage stack to update its backing store
TEE_CloseObject(s_NVStore[i]);

Result = TEE_OpenPersistentObject(TEE_STORAGE_PRIVATE,
Result = TEE_OpenPersistentObject(CFG_FTPM_TA_TEE_STORAGE_ID,
(void *)&objID,
sizeof(objID),
TA_STORAGE_FLAGS,
Expand Down
3 changes: 3 additions & 0 deletions sub.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CFG_FTPM_EMULATE_PPI ?= n
CFG_FTPM_TA_TEE_STORAGE_ID ?= TEE_STORAGE_PRIVATE

#
# The fTPM needs to overwrite some of the header files used in the
Expand Down Expand Up @@ -77,6 +78,8 @@ cflags-platform/EventLogPrint.c-y += -Wno-pointer-arith
cflags-platform/EventLogPrint.c-y += -Wno-format-truncation
cflags-platform/EventLogPrint.c-y += -Wno-restrict

cppflags-y += -DCFG_FTPM_TA_TEE_STORAGE_ID=$(CFG_FTPM_TA_TEE_STORAGE_ID)

srcs-y += platform/AdminPPI.c
srcs-y += platform/Cancel.c
srcs-y += platform/Clock.c
Expand Down

0 comments on commit 85bc88d

Please sign in to comment.