plat/arm/board/common/board_arm_trusted_boot.c
/*
 * Return the non-volatile counter value stored in the platform. The cookie
 * will contain the OID of the counter in the certificate.
 *
 * Return: 0 = success, Otherwise = error
 */
Return the non-volatile counter value stored in the platform. The cookie
will contain the OID of the counter in the certificate.

0 = success, Otherwise = error
Return the non - volatile counter value stored in the platform . The cookie will contain the OID of the counter in the certificate . 0 = success Otherwise = error
int plat_get_nv_ctr(void *cookie, unsigned int *nv_ctr)
{
	const char *oid;
	uint32_t *nv_ctr_addr;
	assert(cookie != NULL);
	assert(nv_ctr != NULL);
	oid = (const char *)cookie;
	if (strcmp(oid, TRUSTED_FW_NVCOUNTER_OID) == 0) {
		nv_ctr_addr = (uint32_t *)TFW_NVCTR_BASE;
	} else if (strcmp(oid, NON_TRUSTED_FW_NVCOUNTER_OID) == 0) {
		nv_ctr_addr = (uint32_t *)NTFW_CTR_BASE;
	} else {
		return 1;
	}
	*nv_ctr = (unsigned int)(*nv_ctr_addr);
	return 0;
}
int plat_get_nv_ctr ( void * cookie , unsigned int * nv_ctr ) { const char * oid ; uint32_t * nv_ctr_addr ; assert ( cookie != NULL ) ; assert ( nv_ctr != NULL ) ; oid = ( const char * ) cookie ; if ( strcmp ( oid , TRUSTED_FW_NVCOUNTER_OID ) == 0 ) { nv_ctr_addr = ( uint32_t * ) TFW_NVCTR_BASE ; } else if ( strcmp ( oid , NON_TRUSTED_FW_NVCOUNTER_OID ) == 0 ) { nv_ctr_addr = ( uint32_t * ) NTFW_CTR_BASE ; } else { return 1 ; } * nv_ctr = ( unsigned int ) ( * nv_ctr_addr ) ; return 0 ; }
Return the non-volatile counter value stored in the platform.
Return the non - volatile counter value stored in the platform .