![]() |
xilnvm
Vitis Drivers API Documentation
|
Macros | |
| #define | REVERSE_POLYNOMIAL (0x82F63B78U) |
| Polynomial used for CRC calculation. More... | |
Functions | |
| int | XNvm_BbramLockUsrDataWrite (void) |
| This function locks the user data written in BBRAM_8 that is making user data written in BBRAM as read only. More... | |
| int | XNvm_BbramWriteAesKey (const u8 *Key, u16 KeyLen) |
| This function does programming of key provided into BBRAM and validates CRC of the key stored in BBRAM with CRC of input key. More... | |
| int | XNvm_BbramWriteUsrData (u32 GeneralPurposeData) |
| Writes user provided 32-bit data to BBRAM. More... | |
| u32 | XNvm_BbramReadUsrData (void) |
| This function reads 32-bit user data from BBRAM_8 register. More... | |
| int | XNvm_BbramZeroize (void) |
| This function zeroizes the BBRAM. More... | |
| #define REVERSE_POLYNOMIAL (0x82F63B78U) |
Polynomial used for CRC calculation.
Referenced by XNvm_AesCrcCalc().
| int XNvm_BbramLockUsrDataWrite | ( | void | ) |
This function locks the user data written in BBRAM_8 that is making user data written in BBRAM as read only.
Write to BBRAM Lock register and readback to confirm if lock is successful. Return the status of the lock, Success if the lock is done else error.
References XNVM_BBRAM_ERROR_LOCK_USR_DATA_WRITE, and XNVM_BBRAM_MSW_LOCK.
| u32 XNvm_BbramReadUsrData | ( | void | ) |
This function reads 32-bit user data from BBRAM_8 register.
Read the 32 bit user data from the BBRAM_8 register and return it
| int XNvm_BbramWriteAesKey | ( | const u8 * | Key, |
| u16 | KeyLen | ||
| ) |
This function does programming of key provided into BBRAM and validates CRC of the key stored in BBRAM with CRC of input key.
| Key | - Pointer to hex buffer which is pointing to key |
| KeyLen | - XNVM_256_BITS_AES_KEY_LEN_IN_BYTES for 256-bit AES key |
Perform input parameter validation. Return appropriate error code if input parameters are invalid.
Assign the key address to local pointer.
Bring BBRAM to programming mode by writing Magic Word 0x757BDF0D to PGM_MODE register.
Write 256-bit AES Key to BBRAM registers BBRAM_0 to BBRAM_7.
Calculate CRC on input AES Key and write it to BBRAM_AES_CRC which triggers BBRAM CRC integrity check. Wait for AES_CRC_DONE bit to set in BBRAM_STATUS register with timeout of 1 second. If timed out return timeout error. If AES_CRC_PASS bit is set in BBRAM_STATUS register, return XST_SUCCESS else return CRC mismatch error.
Disable BBRAM programming mode by writing 0x00 to PGM_MODE register.
References XNvm_BbramZeroize().
| int XNvm_BbramWriteUsrData | ( | u32 | GeneralPurposeData | ) |
Writes user provided 32-bit data to BBRAM.
| GeneralPurposeData | - 32-bit user data to be written to BBRAM |
| int XNvm_BbramZeroize | ( | void | ) |
This function zeroizes the BBRAM.
Write 1 to BBRAM_CTRL register. Wait for BBRAM_ZEROIZED bit to set in BBRAM_STATUS register with timeout of 1 second. If timed out return timeout error. Return XST_SUCCESS.
References XNVM_BBRAM_BASE_ADDR, XNVM_BBRAM_CTRL_START_ZEROIZE, XNVM_BBRAM_ERROR_ZEROIZE_TIMEOUT, and XNVM_BBRAM_STATUS_REG.