blob: f2a76f439ed3620abea282fafd9d851d9af8af20 [file] [log] [blame]
/****************************************************************************
*
* (C)Copyright 2015 Marvell. All Rights Reserved.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MARVELL.
* The copyright notice above does not evidence any actual or intended
* publication of such source code. This Module contains Proprietary
* Information of Marvell and should be treated as Confidential. The
* information in this file is provided for the exclusive use of the
* licensees of Marvell. Such users have the right to use, modify, and
* incorporate this code into products for purposes authorized by the
* license agreement provided they include this notice and the associated
* copyright notice with any such product.
*
* The information in this file is provided "AS IS" without warranty.
*
***************************************************************************/
#ifndef _GEU_PROVISIONING_H_
#define _GEU_PROVISIONING_H_
#include "tim.h"
#include "Provisioning.h"
#include "fuse_conf_spec.h"
#define DIGEST_WLEN_MAX 8
#define DEBUG_GEU (1)
#if DEBUG_GEU
#define GEU_UARTLOG(X) do { if (s_uart_logger) { s_uart_logger(X); } } while (0)
#else
#define GEU_UARTLOG(X)
#endif
static UINT_T s_blk_zero_active = 0;
static UINT_T s_blk_seven_active = 0;
typedef UINT_T (*logger)(UINT8_T* msg);
static logger s_uart_logger = 0;
// Internal Functions
static fuse_conf_spec_t GetFuseConfSpec(void* parameter);
// GEU LIB Provisioning Functions
extern UINT_T GEU_LIB_GetTSR(volatile UINT_T* tsr);
extern UINT_T GEU_LIB_ReadProfileFuse(pTIM ptim, UINT_T addr);
extern UINT_T GEU_LIB_BindPlatform(pTIM ptim, void* parameter);
extern UINT_T GEU_LIB_VerifyPlatform(pTIM ptim);
extern UINT_T GEU_LIB_PlatformBinded(pTIM ptim, void* parameter);
extern UINT_T GEU_LIB_BindJTAGKey(pTIM ptim, void* parameter);
extern UINT_T GEU_LIB_VerifyJTAGKey(pTIM ptim);
extern UINT_T GEU_LIB_ProgramRKEK(void* parameter);
extern UINT_T GEU_LIB_ProgramEC521DK(void* parameter);
extern UINT_T GEU_LIB_WritePlatformConfig(UINT_T* conf, UINT_T bit_cnt, fuse_type_enum type, pTIM ptim, void* parameter);
extern UINT_T GEU_LIB_ReadPlatformConfig(UINT_T* conf, UINT_T* bit_cnt, fuse_type_enum type, void* parameter);
extern UINT_T GEU_LIB_AutoConfigPlatform(pTIM ptim, void* parameter);
extern UINT_T GEU_LIB_ProgramUsbId(void* parameter);
extern UINT_T GEU_LIB_ProgramOemUid(void* parameter);
extern UINT_T GEU_LIB_ReadUsbId(UINT8_T* usb, UINT_T* len, void* parameter);
extern UINT_T GEU_LIB_ReadOEMUniqueId(UINT8_T* oem_id, UINT_T len, void* parameter);
extern UINT_T GEU_LIB_AdvanceLifeCycle(UINT_T* lc, void* parameter);
extern UINT_T GEU_LIB_ReadLifeCycle(UINT_T* lc, void* parameter);
extern UINT_T GEU_LIB_AdvanceVersion(UINT_T* ver, void* parameter);
extern UINT_T GEU_LIB_ReadVersion(UINT_T* ver, void* parameter);
extern UINT_T GEU_LIB_ProgramPIN(pTIM ptim);
extern UINT_T GEU_LIB_ProgramSecurityConfig(void* parameter, pTIM ptim);
extern UINT_T GEU_LIB_PlatformFusePrep(pFUSE_SET pFuses);
extern UINT_T GEU_LIB_CheckLifecycleAdvancement(void* parameter);
#endif /* _GEU_PROVISIONING_H_ */