feat: disabling non volatile counters in diphda

At this stage of development Non Volatile counters are not implemented
in the Diphda platform.

This commit disables their use during the Trusted Board Boot by
overriding the NV counters get/set functions.

Change-Id: I8dcbebe0281cc4d0837c283ff637e20b850988ef
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
This commit is contained in:
Abdellatif El Khlifi 2021-05-10 12:38:41 +01:00
parent bf3ce99371
commit 7f70cd2923
2 changed files with 29 additions and 0 deletions

View File

@ -30,3 +30,24 @@ int plat_get_rotpk_info(void *cookie, void **key_ptr, unsigned int *key_len,
{
return arm_get_rotpk_info(cookie, key_ptr, key_len, flags);
}
/*
* STUB overriding the non-volatile counter reading.
* NV counters are not implemented at this stage of development.
* Return: 0 = success
*/
int plat_get_nv_ctr(void *cookie, unsigned int *nv_ctr)
{
*nv_ctr = DIPHDA_FW_NVCTR_VAL;
return 0;
}
/*
* STUB overriding the non-volatile counter updating.
* NV counters are not implemented at this stage of development.
* Return: 0 = success
*/
int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr)
{
return 0;
}

View File

@ -16,6 +16,11 @@ PLAT_INCLUDES := -Iplat/arm/board/diphda/common/include \
-Iinclude/plat/arm/common \
-Iinclude/plat/arm/css/common/aarch64
DIPHDA_FW_NVCTR_VAL := 255
TFW_NVCTR_VAL := ${DIPHDA_FW_NVCTR_VAL}
NTFW_NVCTR_VAL := ${DIPHDA_FW_NVCTR_VAL}
override NEED_BL1 := no
override NEED_BL2 := yes
@ -64,5 +69,8 @@ $(eval $(call TOOL_ADD_PAYLOAD,${DIPHDA_TOS_FW_CONFIG},--tos-fw-config,${DIPHDA_
# Adding TARGET_PLATFORM as a GCC define (-D option)
$(eval $(call add_define,TARGET_PLATFORM_$(call uppercase,${TARGET_PLATFORM})))
# Adding DIPHDA_FW_NVCTR_VAL as a GCC define (-D option)
$(eval $(call add_define,DIPHDA_FW_NVCTR_VAL))
include plat/arm/common/arm_common.mk
include plat/arm/board/common/board_common.mk