From 7f70cd29235cc5e96ff6b5f509c7e4260bec5610 Mon Sep 17 00:00:00 2001 From: Abdellatif El Khlifi Date: Mon, 10 May 2021 12:38:41 +0100 Subject: [PATCH] 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 --- .../board/diphda/common/diphda_trusted_boot.c | 21 +++++++++++++++++++ plat/arm/board/diphda/platform.mk | 8 +++++++ 2 files changed, 29 insertions(+) diff --git a/plat/arm/board/diphda/common/diphda_trusted_boot.c b/plat/arm/board/diphda/common/diphda_trusted_boot.c index da8b87c6d..ddb41faa6 100644 --- a/plat/arm/board/diphda/common/diphda_trusted_boot.c +++ b/plat/arm/board/diphda/common/diphda_trusted_boot.c @@ -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; +} diff --git a/plat/arm/board/diphda/platform.mk b/plat/arm/board/diphda/platform.mk index 62d7184a3..5ff08620c 100644 --- a/plat/arm/board/diphda/platform.mk +++ b/plat/arm/board/diphda/platform.mk @@ -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