plat/arm/board/common/board_arm_trusted_boot.c
/*
 * Store a new non-volatile counter value in the counter specified by the OID
 * in the cookie. This function is not expected to be called if the Lifecycle
 * state is RMA as the values in the certificate are expected to always match
 * the nvcounter values. But if called when the LCS is RMA, the underlying
 * helper functions will return success but without updating the counter.
 *
 * Return: 0 = success, Otherwise = error
 */
Store a new non-volatile counter value in the counter specified by the OID
in the cookie. This function is not expected to be called if the Lifecycle
state is RMA as the values in the certificate are expected to always match
the nvcounter values. But if called when the LCS is RMA, the underlying
helper functions will return success but without updating the counter.

0 = success, Otherwise = error
Store a new non - volatile counter value in the counter specified by the OID in the cookie . This function is not expected to be called if the Lifecycle state is RMA as the values in the certificate are expected to always match the nvcounter values . But if called when the LCS is RMA the underlying helper functions will return success but without updating the counter . 0 = success Otherwise = error
int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr)
{
	CCError_t error = CC_FAIL;
	if (strcmp(cookie, TRUSTED_FW_NVCOUNTER_OID) == 0) {
		error = NVM_SetSwVersion(PLAT_CRYPTOCELL_BASE,
				CC_SW_VERSION_COUNTER1, nv_ctr);
	} else if (strcmp(cookie, NON_TRUSTED_FW_NVCOUNTER_OID) == 0) {
		error = NVM_SetSwVersion(PLAT_CRYPTOCELL_BASE,
				CC_SW_VERSION_COUNTER2, nv_ctr);
	}
	return (error != CC_OK);
}
int plat_set_nv_ctr ( void * cookie , unsigned int nv_ctr ) { CCError_t error = CC_FAIL ; if ( strcmp ( cookie , TRUSTED_FW_NVCOUNTER_OID ) == 0 ) { error = NVM_SetSwVersion ( PLAT_CRYPTOCELL_BASE , CC_SW_VERSION_COUNTER1 , nv_ctr ) ; } else if ( strcmp ( cookie , NON_TRUSTED_FW_NVCOUNTER_OID ) == 0 ) { error = NVM_SetSwVersion ( PLAT_CRYPTOCELL_BASE , CC_SW_VERSION_COUNTER2 , nv_ctr ) ; } return ( error != CC_OK ) ; }
Store a new non-volatile counter value in the counter specified by the OID
 in the cookie.
Store a new non - volatile counter value in the counter specified by the OID in the cookie .