#ifndef _GEU_INTERFACE_H_ | |
#define _GEU_INTERFACE_H_ | |
/****************************************************************************** | |
* | |
* (C)Copyright 2005 - 2011 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. | |
******************************************************************************/ | |
// FUSE life cycles | |
#define K_LIFECYCLE_STATE_VIRGIN 0 | |
#define K_LIFECYCLE_STATE_CM 1 | |
#define K_LIFECYCLE_STATE_DM 2 | |
#define K_LIFECYCLE_STATE_DD 3 | |
#define K_LIFECYCLE_STATE_FA 4 | |
#define K_MRB_JTAG_PERM_DIS 5 | |
#define LIFECYCLE_CM (K_LIFECYCLE_STATE_CM) | |
#define LIFECYCLE_DM (K_LIFECYCLE_STATE_DM) | |
#define LIFECYCLE_DD (K_LIFECYCLE_STATE_DD) | |
#define LIFECYCLE_FA (K_LIFECYCLE_STATE_FA) | |
#define LIFECYCLE_JPD (K_MRB_JTAG_PERM_DIS) | |
// Fuse field sizes in bytes | |
//FB0 | |
#define K_AP_CONFIG_FUSE_SIZE 10 | |
#define K_CP_CONFIG_FUSE_SIZE 2 | |
#define K_APCP_CONFIG_FUSE_SIZE 12 | |
#define K_MP0_FUSE_SIZE 12 | |
#define K_APCPMP0_ECC_FUSE_SIZE 3 | |
//FB1 | |
#define K_RKEK_FUSE_SIZE 32 | |
//FB2/FB3 | |
#define K_OEM_HASH_FUSE_SIZE 32 | |
//FB4 | |
#define K_TRANSIT_KEY_ECC_FUSE_SIZE 4 | |
#define K_DEVICE_PIN_ECC_SIZE 1 | |
#define K_DFT_PASSWORD_CHANGE_FUSE_SIZE 1 | |
#define K_OEM_KEY1_ECC_FUSE_SIZE 4 | |
#define K_JTAG_KEY1_ECC_FUSE_SIZE 4 | |
#define K_MP1_FUSE_SIZE 12 | |
//FB5/FB6 | |
#define K_JTAG_HASH_FUSE_SIZE 32 | |
//FB7 | |
#define K_SECURITY_CONFIG_FUSE_SIZE 4 | |
#define K_USBID_FUSE_SIZE 4 | |
#define K_SECURITY_USB_ECC_FUSE_SIZE 1 | |
#define K_OEM_KEY0_ECC_FUSE_SIZE 4 | |
#define K_JTAG_KEY0_ECC_FUSE_SIZE 4 | |
#define K_OEM_UNIQUE_ID_FUSE_SIZE 8 | |
#define K_OEM_UNIQUE_ID_ECC_FUSE_SIZE 1 | |
//FB8/FB9 | |
#define K_EC521_KEY_FUSE_SIZE 32 | |
//FB10 | |
#define K_TRANSIT_KEY_FUSE_SIZE 32 | |
//FB11 | |
#define K_DEVICE_PIN_FUSE_SIZE 8 | |
#define K_SW_VERSION_FUSE_SIZE 8 | |
#define K_WTM_SE_MGMT_FUSE_SIZE 14 | |
//misc | |
#define K_FUSEBLOCK_SIZE 32 | |
#define K_SHA1_SIZE 20 | |
#define K_SHA256_SIZE 32 | |
#define K_SHA512_SIZE 64 | |
// Fuse field buffer sizes in bytes | |
// Data is always returned as a multiple of 4 bytes | |
#define K_AP_CONFIG_BUFFER_SIZE 12 | |
#define K_CP_CONFIG_BUFFER_SIZE 4 | |
#define K_MP0_BUFFER_SIZE 12 | |
#define K_USBID_BUFFER_SIZE 4 | |
#define K_SECURITY_CONFIG_BUFFER_SIZE 4 | |
#define K_OEM_HASH_BUFFER_SIZE 32 | |
#define K_JTAG_HASH_BUFFER_SIZE 32 | |
#define K_RKEK_BUFFER_SIZE 32 | |
#define K_FUSEBLOCK_BUFFER_SIZE 32 | |
#define K_OEM_UNIQUE_ID_BUFFER_SIZE 8 | |
#define K_OEM_UNIQUE_ID_ECC_BUFFER_SIZE 4 | |
#define K_SECURITY_USB_ECC_BUFFER_SIZE 4 | |
#define K_AP_CP_MP_ECC_BUFFER_SIZE 4 | |
// Fuse field sizes in bytes | |
#define K_PIN_FUSE_SIZE 8 | |
#define K_OEM_UID_FUSE_SIZE 8 | |
// Fuse Block Numbers | |
#define K_AP_CONFIG_FUSEBLOCK 0 | |
#define K_CP_CONFIG_FUSEBLOCK 0 | |
#define K_MP0_FUSEBLOCK 0 | |
#define K_APCPMP0_FUSEBLOCK 0 | |
#define K_ECC_FUSEBLOCK 0 | |
#define K_LIFECYCLE_CM_FUSEBLOCK 0 | |
#define K_LIFECYCLE_DM_FUSEBLOCK 0 | |
#define K_LIFECYCLE_FUSEBLOCK_CM_DM 0 | |
#define K_LIFECYCLE_DD_FUSEBLOCK 7 | |
#define K_LIFECYCLE_FA_FUSEBLOCK 7 | |
#define K_LIFECYCLE_FUSEBLOCK_DD_FA_JPD 7 | |
#define K_MRB_JTAG_PERM_DISABLE_FUSEBLOCK 7 | |
#define K_RKEK_FUSEBLOCK 1 | |
#define K_OEM_FUSEBLOCK 2 | |
#define K_SQU0_FUSEBLOCK 3 // Not Supported | |
#define K_SQU1_FUSEBLOCK 4 // Not Supported | |
#define K_SQU2_FUSEBLOCK 5 // Not Supported | |
#define K_JTAG_FUSEBLOCK 6 | |
#define K_USBID_FUSEBLOCK 7 | |
#define K_SECURITYCONFIG_FUSEBLOCK 7 | |
#define K_FB7_FUSEBLOCK 7 | |
#define K_OEM_UID_FUSEBLOCK 7 | |
#define K_OEM_UID_ECC_FUSEBLOCK 7 | |
#define K_NO_FUSEBLOCK 0xF | |
#define K_UNDEFINED_FUSEBLOCK K_NO_FUSEBLOCK | |
// Burn/Status Bit Masks/bits - This is an arbitrary internal | |
// status array that we use to determine which set we're burning | |
// and pass status internally. | |
#define K_AP_CONFIG_STATUS_BIT_MASK 0x00000001 | |
#define K_CP_CONFIG_STATUS_BIT_MASK 0x00000002 | |
#define K_MP0_STATUS_BIT_MASK 0x00000004 | |
#define K_APCPMP0_ECC_STATUS_BIT_MASK 0x00000008 | |
#define K_SOFTWARE_VERSION_STATUS_BIT_MASK 0x00000010 // Reserved | |
#define K_RKEK_STATUS_BIT_MASK 0x00000020 | |
#define K_OEM_KEY0_STATUS_BIT_MASK 0x00000040 | |
#define K_JTAG_KEY0_STATUS_BIT_MASK 0x00000080 | |
#define K_OEM_KEY0_ECC_STATUS_BIT_MASK 0x00000100 | |
#define K_FUSEBLOCK_LOCK_STATUS_BIT_MASK 0x00000200 | |
#define K_LOCK_STATUS_BIT_MASK 0x00000400 | |
#define K_OEM_UID_STATUS_BIT_MASK 0x00000800 | |
#define K_OEM_UID_ECC_STATUS_BIT_MASK 0x00001000 | |
#define K_SECURITY_CONFIG_STATUS_BIT_MASK 0x00002000 | |
#define K_USBID_STATUS_BIT_MASK 0x00004000 | |
#define K_SECURITY_USBID_ECC_STATUS_BIT_MASK 0x00008000 | |
#define K_LIFECYCLE_CM_STATUS_BIT_MASK 0x00010000 | |
#define K_LIFECYCLE_DM_STATUS_BIT_MASK 0x00020000 | |
#define K_LIFECYCLE_DD_STATUS_BIT_MASK 0x00040000 | |
#define K_LIFECYCLE_FA_STATUS_BIT_MASK 0x00080000 | |
#define K_LIFECYCLE_STATUS_BIT_MASK 0x00100000 | |
#define K_MRB_JTAG_PERM_DISABLE_STATUS_BIT_MASK 0x00200000 | |
#define K_JTAG_KEY0_ECC_STATUS_BIT_MASK 0x00400000 | |
// DebugStatus bits | |
#define K_FUSE_READY_TIMEOUT 0x10000000 | |
#define K_MULTIPLE_BURN_COUNT 0x20000000 | |
#define K_FUSE_BURN_TIMEOUT 0x40000000 | |
#define K_FUSE_WRONG_ACLK_SETTING 0x80000000 | |
// Lock Bit Masks | |
#define K_FB0_FUSE_LOCK_BIT_MASK 0x01 //Bit 0/Block0 | |
#define K_RKEK_FUSE_LOCK_BIT_MASK 0x02 //Bit 1/Block1 | |
#define K_OEM_FUSE_LOCK_BIT_MASK 0x04 //Bit 2/block2 | |
#define K_SQU0_FUSE_LOCK_BIT_MASK 0x08 //Bit 3/block3 | |
#define K_SQU1_FUSE_LOCK_BIT_MASK 0x10 //Bit 4/block4 | |
#define K_SQU2_FUSE_LOCK_BIT_MASK 0x20 //Bit 5/block5 | |
#define K_JTAG_FUSE_LOCK_BIT_MASK 0x40 //Bit 6/Block6 | |
#define K_FB7_FUSE_LOCK_BIT_MASK 0x80 //Bit 7/Block7 | |
// LifeCycle/Software Version | |
#define K_PHYSICAL_BITS_PER_LOGICAL_BIT 3 | |
#define K_LIFECYCLE_BITSIZE 16 | |
#define K_MAX_LIFECYCLE_LOGICAL_BITS K_LIFECYCLE_BITSIZE/K_PHYSICAL_BITS_PER_LOGICAL_BIT | |
#define K_SOFTWARE_VERSION_BITSIZE 32 | |
#define K_MAX_SOFTWARE_VERSION_LOGICAL_BITS K_SOFTWARE_VERSION_BITSIZE/K_PHYSICAL_BITS_PER_LOGICAL_BIT | |
// Fuse Burn Status | |
typedef struct GEU_FuseBurnStatus | |
{ | |
UINT_T FinalBurnStatus; | |
UINT_T CorrectedBurnStatus; | |
UINT_T RawBurnStatus; | |
UINT_T SavedBurnRequest; | |
//UINT_T LastUsedLogicalBitOffset; | |
UINT_T Oem_EccStatus; | |
UINT_T Jtag_EccStatus; | |
UINT_T ApCpMp_EccStatus; | |
UINT_T SecurityUSB_EccStatus; | |
UINT_T OemUid_EccStatus; | |
UINT_T DebugStatus; | |
}GEU_FuseBurnStatus_t; | |
#define TRUSTBOOT_BURN_EN 0x00000001 | |
// Note that All API's have UINT_T return values. | |
// NoError or an error defined in errors.h | |
/*********************************************************** | |
* Function: | |
* GEU_SetActiveFuseBlock | |
* Description: | |
* Sets the active fuse block for a set of operations. | |
* This restricts operations to the specifed fuseblock. | |
* Operations not targeted to the active fuseblock will fail. | |
* Notes: | |
* 1. The specified fuseblock must not be locked. | |
* 2. The sticky bit must not be set. | |
* 3. The GlobalFuseData structure (*pActveFuseBlock) is initialized. | |
* 4. The FuseBurnStatus structure (*pFuseBurnStatus) is initialized. | |
* 5. The SQU0, SQU1, and SQU2 fuseblocks are not supported. | |
* 6. Fuseblock numbers below are also supported | |
* K_NO_FUSEBLOCK | |
* K_UNDEFINED_FUSEBLOCK | |
* to allow clearing the internal data structures without specifying | |
* a legitimate fuseblock. | |
* 7. The ActiveFuseBlockField is initialize to K_UNDEFINED_FUSEBLOCK_FIELD | |
* | |
* Input: | |
* n - Fuse Block Number | |
* K_AP_CONFIG_FUSEBLOCK | |
* K_CP_CONFIG_FUSEBLOCK | |
* K_USBID_FUSEBLOCK | |
* K_APCPUSB_FUSEBLOCK | |
* K_LIFECYCLE_FUSEBLOCK | |
* K_SOFTWARE_VERSION_FUSEBLOCK | |
* K_RKEK_FUSEBLOCK | |
* K_OEM_FUSEBLOCK | |
* K_JTAG_FUSEBLOCK | |
* K_ECC_FUSEBLOCK | |
* K_FB7_FUSEBLOCK | |
* K_NO_FUSEBLOCK | |
* K_UNDEFINED_FUSEBLOCK | |
* Output: | |
* none | |
* Returns: | |
* FUSE_FuseBlockLocked | |
* FUSE_UnsupportedFuseBlock | |
************************************************************/ | |
UINT_T GEU_SetActiveFuseBlock(UINT_T n); | |
/*********************************************************** | |
* Function: | |
* GEU_ReadActiveFuseBlockNumber | |
* Description: | |
* Returns the Active Fuse Block number | |
* Input: | |
* none | |
* Output: | |
* none | |
* Returns: | |
* Active Fuse Block Number | |
************************************************************/// Reads back Active Fuse block number | |
UINT_T GEU_ReadActiveFuseBlockNumber(void); | |
/*********************************************************** | |
* Function: | |
* GEU_GenerateRandomNumber | |
* Description: | |
* Generates a 32 bit random number. | |
* Input: | |
* Seed - 8 bit Seed number. Range 0-255. Larger number takes | |
* less time to generate result. | |
* Output: | |
* none | |
* Returns: | |
* Returns 32 bit random number. | |
************************************************************/ | |
UINT_T GEU_GenerateRandomNumber (UINT_T Seed); | |
/*********************************************************** | |
* Function: | |
* GEU_ReadxxxFuseBits | |
* | |
* Description: | |
* Reads the specified (xxx) fuse bits. | |
* | |
* Input: | |
* pBuffer - Pointer to buffer to write the requested data. | |
* Size - Size of buffer in bytes must be larger than the | |
* specified field (must be larger than K_xxx_FUSE_SIZE). | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_BufferTooSmall | |
* | |
************************************************************/ | |
// GEU Fuse Read APIs | |
UINT_T GEU_ReadApConfigFuseBits(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_ReadCpConfigFuseBits(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_ReadUsbIdFuseBits(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_ReadOemHashKeyFuseBits(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_ReadOemJtagHashKeyFuseBits(UINT_T* pBuffer, UINT_T Size); | |
/*********************************************************** | |
* Function: | |
* GEU_ReadLifeCycle | |
* | |
* | |
* Input: | |
* none | |
* Output: | |
* none | |
* Returns: | |
* State value in the specified range. | |
* | |
************************************************************/ | |
UINT_T GEU_ReadLifeCycle(void); | |
/*********************************************************** | |
* Function: | |
* GEU_SetupApConfigFuseBits | |
* | |
* Description: | |
* - Confirms the Active FuseBlock and FuseBlockField conform to the | |
* ApCpMp fuseblock field. | |
* - Copies the caller supplied AP Config data to | |
* the appropriate offset in the GEU_FUSE_PROG_VALn register set. | |
* - Sets the ApConfig Burn Request. | |
* | |
* Note: AP/CP/MP must all be done in the same fuse burn to burn ECC. | |
* Input: | |
* pBuffer - pointer to a buffer containing the 80 bits of AP Config data | |
* Size - Size (in bytes) of the data to copy (Must be K_AP_CONFIG_FUSE_SIZE). | |
* | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_FuseBlockNotActive | |
* FUSE_FuseBlockFieldNotActive | |
* FUSE_BufferTooSmall | |
* | |
************************************************************/ | |
UINT_T GEU_SetupApConfigFuseBits(UINT_T* pBuffer, UINT_T Size); | |
/*********************************************************** | |
* Function: | |
* GEU_SetupCpConfigFuseBits | |
* | |
* Description: | |
* - Confirms the Active FuseBlock and FuseBlockField conform to the | |
* ApCpMp fuseblock field. | |
* - Copies the caller supplied CP Config data to | |
* the appropriate offset in the GEU_FUSE_PROG_VALn register set. | |
* - Sets the CpConfig Burn Request. | |
* | |
* Note: AP/CP/MP must all be done in the same fuse burn to burn ECC. | |
* Input: | |
* pBuffer - pointer to a buffer containing the 80 bits of AP Config data | |
* Size - Size (in bytes) of the data to copy (Must be K_CP_CONFIG_FUSE_SIZE). | |
* | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_FuseBlockNotActive | |
* FUSE_FuseBlockFieldNotActive | |
* FUSE_BufferTooSmall | |
* | |
************************************************************/ | |
UINT_T GEU_SetupCpConfigFuseBits(UINT_T* pBuffer, UINT_T Size); | |
/*********************************************************** | |
* Function: | |
* GEU_SetupUsbIdFuseBits | |
* | |
* Description: | |
* - Confirms the Active FuseBlock and FuseBlockField conform to the | |
* ApCpUsbId fuseblock field. | |
* - Copies the caller supplied UsbId data to | |
* the appropriate offset in the GEU_FUSE_PROG_VALn register set. | |
* - Sets the UsbId Burn Request. | |
* | |
* Note: AP/CP/USBID must all be done in the same fuse burn to burn ECC. | |
* Input: | |
* pBuffer - pointer to a buffer containing the 80 bits of UsbId data | |
* Size - Size (in bytes) of the data to copy (Must be K_USBID_FUSE_SIZE). | |
* | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_FuseBlockNotActive | |
* FUSE_FuseBlockFieldNotActive | |
* FUSE_BufferTooSmall | |
* | |
************************************************************/ | |
UINT_T GEU_SetupUsbIdFuseBits(UINT_T* pBuffer, UINT_T Size); | |
/*********************************************************** | |
* Function: | |
* GEU_SetupOemHashKeyFuseBits | |
* | |
* Description: | |
* - Confirms the Active FuseBlock and FuseBlockField conform to the | |
* Block 7 fuseblock field. | |
* - Copies the caller supplied OEM Hash Key data to | |
* the appropriate offset in the GEU_FUSE_PROG_VALn register set. | |
* - Sets the OEM Hash Key Burn Request. | |
* | |
* Input: | |
* pBuffer - pointer to a buffer containing the 256 bits of OEM Hash key data | |
* Size - Size (in bytes) of the data to copy (Must be K_OEM HASH_FUSE_SIZE). | |
* | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_FuseBlockNotActive | |
* FUSE_FuseBlockFieldNotActive | |
* FUSE_BufferTooSmall | |
* | |
************************************************************/ | |
UINT_T GEU_SetupOemHashKeyFuseBits(UINT_T* pBuffer, UINT_T Size); | |
/*********************************************************** | |
* Function: | |
* GEU_SetupOemJtagHashKeyFuseBits | |
* | |
* Description: | |
* - Confirms the Active FuseBlock and FuseBlockField conform to the | |
* JTAG fuseblock field. | |
* - Copies the caller supplied OEM JTAG Hash Key data to | |
* the appropriate offset in the GEU_FUSE_PROG_VALn register set. | |
* - Sets the JTAG Hash Key Burn Request. | |
* | |
* Input: | |
* pBuffer - pointer to a buffer containing the 256 bits of JTAG Hash key data | |
* Size - Size (in bytes) of the data to copy (Must be K_JTAG HASH_FUSE_SIZE). | |
* | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_FuseBlockNotActive | |
* FUSE_FuseBlockFieldNotActive | |
* FUSE_BufferTooSmall | |
* | |
************************************************************/ | |
UINT_T GEU_SetupOemJtagHashKeyFuseBits(UINT_T* pBuffer, UINT_T Size); | |
/*********************************************************** | |
* Function: | |
* GEU_SetupRkekFuseBits | |
* | |
* Description: | |
* - Confirms the Active FuseBlock and FuseBlockField conform to the | |
* RKEK fuseblock field. | |
* - Copies the caller supplied RKEK data to | |
* the appropriate offset in the GEU_FUSE_PROG_VALn register set. | |
* - Sets the RKEK Burn Request. | |
* | |
* Input: | |
* pBuffer - pointer to a buffer containing the 256 bits of OEM Hash key data | |
* Size - Size (in bytes) of the data to copy (Must be K_RKEK_FUSE_SIZE). | |
* | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_FuseBlockNotActive | |
* FUSE_FuseBlockFieldNotActive | |
* FUSE_BufferTooSmall | |
* | |
************************************************************/ | |
UINT_T GEU_SetupRkekFuseBits(UINT_T* pBuffer, UINT_T Size); | |
/*********************************************************** | |
* Function: | |
* GEU_SetupLifeCycleFuseBits | |
* GEU_SetupSoftwareVersionFuseBits | |
* | |
* Description: | |
* Encodes the specified state to the specified data field | |
* in a logical bitfield with the number of "1" bits | |
* equal to the state value. Each logical bit is encoded | |
* as a majority rule bitfield of 3 physical bits. | |
* If two or three physical bits are set the logical bit is "1". | |
* If zero or one physical bit is set the logical bit is "0". | |
* | |
* The LifeCycle state can range for 0 to 5. | |
* The SoftwareVersion state can range from 0 to 21. | |
* | |
* Note that fuse failures can limit the maximum value that | |
* can be programmed. | |
* | |
* Input: | |
* n - desired state value. Must be greater or equal to the current value. | |
* | |
* Output: | |
* none | |
* Returns: | |
* FUSE_FuseBlockNotActive | |
* FUSE_FuseBlockFieldNotActive | |
* FUSE_FuseBlockFieldOverflow (no more logical bits available to burn) | |
* FUSE_InvalidState (new value < current value) | |
* | |
************************************************************/ | |
UINT_T GEU_SetupSoftwareVersionFuseBits(UINT_T value); | |
UINT_T GEU_SetupLifeCycleFuseBits(UINT_T value); | |
/********************************************************** | |
* Function: | |
* GEU_BurnFuseBlock_ApCpMp | |
* Description: | |
* Burns the ApCpMp field in Fuseblock 0. This may burn one | |
* or more of the AP Config, CP Config, or MP subfields | |
* in the ApCpMp field. | |
* | |
* - Confirms that a burn request exists for one or more of the | |
* AP, CP, or Mp subfields. | |
* - Saves LifeCycle and Software Version state (for post burn validation). | |
* - Saves any of the the AP, CP, or Mp subfields that are not being burned. | |
* - Burns the fuseblock | |
* Validates burned subfields and retries if burn not successful. | |
* - Validates all subfields that were not burned to ensure no changes from the burn. | |
* | |
* Input: | |
* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure | |
* | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_BurnError | |
* | |
************************************************************/ | |
UINT_T GEU_BurnFuseBlock_ApCpMp(struct GEU_FuseBurnStatus * pFuseBurnStatus); | |
//UINT_T GEU_BurnFuseBlock_ApCpUsb(struct GEU_FuseBurnStatus * pFuseBurnStatus); | |
//UINT_T GEU_BurnFuseBlock_ApCp(struct GEU_FuseBurnStatus * pFuseBurnStatus); | |
/********************************************************** | |
* Function: | |
* GEU_BurnFuseBlock_OemHashKey | |
* GEU_BurnFuesBlock_JtagHashKey | |
* GEU_BurnFuesBlock_Rkek | |
* Description: | |
* Burns the specified field in the corresponding Fuseblock. | |
* - Confirms that a burn request exists for the specified field/fuseblock. | |
* - Burns the fuseblock | |
* Validates the burned field/fuseblock equals the setup data | |
* Retries if compare fails | |
* Input: | |
* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_BurnError | |
************************************************************/ | |
UINT_T GEU_BurnFuseBlock_OemHashKey(struct GEU_FuseBurnStatus * pUserFuseBurnStatus); | |
UINT_T GEU_BurnFuseBlock_Rkek(struct GEU_FuseBurnStatus * pUserFuseBurnStatus); | |
UINT_T GEU_BurnFuseBlock_OemJtagHashKey(struct GEU_FuseBurnStatus * pUserFuseBurnStatus); | |
/********************************************************** | |
* Function: | |
* GEU_BurnFuseBlock_LifeCycle | |
* Description: | |
* Burns the LifeCycle field in Fuseblock 0. | |
* - Confirms that a LifeCycle burn request exists | |
* - Saves Software Version state (for post burn validation). | |
* - Saves the AP, CP, and USB Id subfields (they are not being burned). | |
* - Burns the fuseblock | |
* Validates the burned LifeCycle state equals the requested state | |
* Retries to setup, and burn with the requested value until | |
* successful or available fuse bits are exhausted. | |
* - Validates all subfields that were not burned to ensure no changes from the burn. | |
* Input: | |
* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_BurnError | |
* Note: If a FUSE_BurnError occurs, one must check the FuseBurnStatus and verify that | |
* LastUsedLogicalBit is not at maximum (5). If it is, and a call to GEU_READ_LIFECYCLE | |
* does not return the desired value, then all available fuse bits have been used | |
* and it will not be possible to burn the requested value. | |
************************************************************/ | |
UINT_T GEU_BurnFuseBlock_LifeCycle(struct GEU_FuseBurnStatus * pUserFuseBurnStatus); | |
/********************************************************** | |
* Function: | |
* GEU_BurnFuseBlock_SoftwareVersion | |
* Description: | |
* Burns the SoftwareVersion field in Fuseblock 0. | |
* - Confirms that a SoftwareVersion burn request exists | |
* - Saves LifeCycle state (for post burn validation). | |
* - Saves the AP, CP, and USB Id subfields (they are not being burned). | |
* - Burns the fuseblock | |
* Validates the burned Software Version state equals the requested state | |
* Retries to setup, and burn with the requested value until | |
* successful or available fuse bits are exhausted. | |
* - Validates all subfields that were not burned to ensure no changes from the burn. | |
* Input: | |
* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_BurnError | |
* Note: If a FUSE_BurnError occurs, one must check the FuseBurnStatus and verify that | |
* LastUsedLogicalBit is not at maximum (21). If it is, and a call to GEU_READ_LIFECYCLE | |
* does not return the desired value, then all available fuse bits have been used | |
* and it will not be possible to burn the requested value. | |
************************************************************/ | |
UINT_T GEU_BurnFuseBlock_SoftwareVersion(struct GEU_FuseBurnStatus * pUserFuseBurnStatus); | |
/********************************************************** | |
* Function: | |
* GEU_BurnEcc | |
* Description: | |
* This function burns an ECC value for an ECC protected field. | |
* This function must be called immediately after burning the ECC protected field. | |
* | |
* This function first determines which ECC field must be burned based | |
* on the saved burn request in the FuseData structure. | |
* | |
* - Clears GEU_FUSE_PROG_VAL1 and VAL2 register sets. | |
* - Retrieves the saved ECC value from the last burn | |
* - and stores the ECC value in the appropriate field. | |
* - Burns the fuseblock | |
* - Validates all ECC fields using GEU_ECC_STATUS and checking | |
* for uncorrectable errors. | |
* - Retries teh burn if compare fails | |
* Input: | |
* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_BurnError | |
************************************************************/ | |
UINT_T GEU_BurnECC(struct GEU_FuseBurnStatus * pUserFuseBurnStatus); | |
/********************************************************** | |
* Function: | |
* GEU_LockFuseBlock | |
* Description: | |
* Locks a Fuse Block to prevent further programming | |
* FuseBlocks supported: 1(OEM), 2(RKEK), 6(JTAG), and 7(ECC) only | |
* Fuse Blocks 0, 3, 4, and 5 cannot be locked with this API | |
* Input: | |
* n- Fuse block to be locked | |
* pUserFuseBurnStatus - pointer to a buffer containing a FuseBurnStatus structure | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
* FUSE_BurnError | |
* FUSE_UnsupportedFuseBlock | |
************************************************************/ | |
UINT_T GEU_LockFuseBlock(UINT_T n, struct GEU_FuseBurnStatus * pUserFuseBurnStatus); | |
/*********************************************************** | |
* Function: | |
* GEU_SetFuseBlockStickyBit | |
* GEU_ReadFuseBlockStickyBit | |
* Description: | |
* Sets (or Reads) the Sticky bit for fuse block zero. | |
* Input: | |
* none | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
************************************************************/// Fuse block sticky bit | |
UINT_T GEU_SetFuseBlockStickyBit(UINT_T Reserved); // Reserved - StickyBit must be zero | |
UINT_T GEU_ReadFuseBlockStickyBit(UINT_T Reserved); // Reserved - StickyBit must be zero | |
/*********************************************************** | |
* Function: | |
* GEU_ReadFuseBlockLockState | |
* Description: | |
* Reads the lock state of the eight fuse blocks. | |
* Input: | |
* pBuffer - Pointer to buffer to write the requested data. | |
* Output: | |
* Returns eight bits of valid data int the specified buffer. | |
* 1 = Locked, 0 = Not Locked | |
* Bit 0 - Block 0 | |
* Bit 1 - Block 1 | |
* Bit 2 - Block 2 | |
* Bit 3 - Block 3 | |
* Bit 4 - Block 4 | |
* Bit 5 - Block 5 | |
* Bit 6 - Block 6 | |
* Bit 7 - Block 7 | |
* Returns: | |
* NoError | |
************************************************************/ | |
UINT_T GEU_ReadFuseBlockLockState(UINT_T* pBuffer); | |
/*********************************************************** | |
* Function: | |
* GEU_SetJtagEnable | |
* GEU_ReadJtagEnable | |
* Description: | |
* JTAG Control - Called by Trusted Boot Software to enable JTAG | |
* functionality through GEU until next power cycle. | |
* Sets bit 7 of GEU_CONFIG. | |
* Read returns the state of the bit. | |
* Input: | |
* none | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
************************************************************/ | |
UINT_T GEU_SetJtagEnable(void); | |
UINT_T GEU_ReadJtagEnable(void); | |
/*********************************************************** | |
* Function: | |
* GEU_ReadRegister | |
* Description: | |
* Generic function to read any register. | |
* Input: | |
* registerAddress - address of register to read. | |
* pBuffer - address to store the register contents. | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
************************************************************/ | |
UINT_T GEU_ReadRegister(UINT_T registerAddress, UINT_T * pBuffer); | |
UINT_T GEU_WriteRegister(UINT_T registerAddress, UINT_T value); | |
/*********************************************************** | |
* Function: | |
* GEU_EnableFuseBurnPower | |
* Description: | |
* Enable power supply for fuse programming | |
* Input: | |
* none | |
* Output: | |
* none | |
* Returns: | |
* NoError | |
************************************************************/ | |
UINT_T GEU_EnableFuseBurnPower(void); | |
/* | |
* API specified by Paul for newly added functions | |
*/ | |
UINT_T GEU_ReadOemUidFuseBits(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_ReadOemUidEcc(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_SetupUidFuseBits(UINT_T* pBuffer, UINT_T Size); | |
//UINT_T GEU_SetupUidEccFuseBits(void); | |
UINT_T GEU_SetupUidEccFuseBits(void); | |
UINT_T GEU_BurnFuseBlock_OemUid (struct GEU_FuseBurnStatus* pUserFuseBurnStatus); | |
UINT_T GEU_BurnFuseBlock_OemUidEcc (struct GEU_FuseBurnStatus* pUserFuseBurnStatus); | |
UINT_T GEU_BurnApCpMpEccFuseBits(struct GEU_FuseBurnStatus* pUserFuseBurnStatus); | |
UINT_T GEU_BurnFuseBlock_SecurityUSBID(struct GEU_FuseBurnStatus * pUserFuseBurnStatus); | |
UINT_T GEU_BurnFuseBlock_SecurityUSBIDECC(struct GEU_FuseBurnStatus * pUserFuseBurnStatus); | |
//UINT_T GEU_ReadLifeCycle(void); | |
UINT_T GEU_ReadManufacturingParameterBitsInFB0(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_SetupMpFuseBits(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_SetupSecurityConfigUsbIdEccFuseBits(void); | |
UINT_T GEU_SetupApCpMpEccFuseBits(void); | |
UINT_T GEU_SetupApCpUsbIdEccFuseBits(void); | |
UINT_T GEU_BurnApCpUsbIDEccFuseBits (struct GEU_FuseBurnStatus* pUserFuseBurnStatus); | |
UINT_T GEU_ReadManufacturingParameterBitsInFB0(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_SetupSecurityConfigFuseBits(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_ReadSecurityConfigFuseBits(UINT_T* pBuffer, UINT_T Size); | |
UINT_T GEU_BurnApCpEccFuseBits(struct GEU_FuseBurnStatus* pUserFuseBurnStatus); | |
#endif //_GEU_INTERFACE_H_ |