![]() |
xilskey
Vitis Drivers API Documentation
|
This file contains the PS eFUSE API's to program/read the eFUSE array.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a rpoolla 04/26/13 First release 1.02a hk 10/28/13 Added API to read status register.PR# 735957 2.00 hk 23/01/14 Changed PS efuse error codes for voltage out of range. 2.1 sk 04/03/15 Initialized RSAKeyReadback with Zeros CR# 829723. 3.00 vns 31/07/15 Removed redundant code to initialise timer. 4.00 vns 09/10/15 Added DFT control bits programming fecility for eFuse PS on Zynq. PR#862778 Added Conditional compilation to support Zynq Mp also. 5.00 vns 27/01/16 Fixed array out of bounds error CR #931207 6.0 vns 29/06/16 Added Margin 2 read verification after programming every Zynq's eFUSE PS bit CR #953052. vns 07/17/16 Fixed CR# 954260, Modified XilSKey_EfusePs_Write API to program eFUSE protect bit after programming DFT bits 6.6 vns 06/06/18 Added doxygen tags 6.8 vns 08/29/19 Initialized Status variables 7.2 am 07/13/21 Fixed doxygen warnings
Functions | |
| u32 | XilSKey_EfusePs_Write (XilSKey_EPs *InstancePtr) |
| This function is used to write to the PS eFUSE. More... | |
| u32 | XilSKey_EfusePs_Read (XilSKey_EPs *InstancePtr) |
| This function is used to read the PS eFUSE. More... | |
| void | XilSKey_EfusePs_GenerateMatrixMap (void) |
| This function is used to generate the matrix map of the G and H for hamming code (31,26). More... | |
| void | XilSKey_EfusePs_EccEncode (const u8 *InData, u8 *Ecc) |
| This function is used to encode the incoming data byte. More... | |
| u8 | XilSKey_EfusePs_EccDecode (const u8 *Corrupt, u8 *Syndrome) |
| This function is used to decode the incoming encoded byte. More... | |
| u32 | XilSKey_EfusePs_ControllerConfig (u8 CtrlMode, u32 RefClk, u8 ReadMode) |
| This function is used to set the controller mode, read mode along with the read and program strobe width values based on the reference clock. More... | |
| u8 | XilSKey_EfusePs_IsAddressXilRestricted (u32 Addr) |
| This function is used to check whether eFuse bit is xilinx reserved bit or not. More... | |
| void | XilSKey_EfusePs_ControllerSetReadWriteEnable (u32 ReadWriteEnable) |
| This function is used to enable the read/write/program the eFUSE array. More... | |
| u32 | XilSKey_EfusePs_ReadEfuseBit (u32 Addr, u8 *Data) |
| This function is used to read the eFuse bit value. More... | |
| u32 | XilSKey_EfusePs_WriteEfuseBit (u32 Addr) |
| This function is used to program the eFuse bit value. More... | |
| u32 | XilSKey_EfusePs_ReadStatus (XilSKey_EPs *InstancePtr, u32 *StatusBits) |
| This function is used to read the PS efuse status register. More... | |
Variables | |
| u8 | Matrix [31][5] |
| PS eFUSE Matrix. More... | |
| u8 | ErrorCodeIndex [32] |
| Error Code Array. More... | |
| u32 XilSKey_EfusePs_ControllerConfig | ( | u8 | CtrlMode, |
| u32 | RefClk, | ||
| u8 | ReadMode | ||
| ) |
This function is used to set the controller mode, read mode along with the read and program strobe width values based on the reference clock.
| CtrlMode | is the mode of the controller
|
| RefClk | is the CPU 1x reference clock frequency. Clock frequency can be between 20MHz to 100MHz specified in Hz |
| ReadMode | is the read mode of the controller
|
Test Cases: Check single mode in CFG Reg Check redundancy mode in CFG Reg Check strobe width values for write mode Check strobe width values for various read mode Check Normal Read mode setting in CFG Reg Check Margin 1 Read mode setting in CFG Reg Check Margin 2 Read mode setting in CFG Reg Boundary Conditions
Check the parameters Mode can be Single or Redundancy mode
Ref Clock should be between 20MHz - 60MHz
3 read modes are supported
Set the controller mode
Set the controller read mode
Program the Strobe width values for read and write 12us is required for write and 150ns is required for read PGM_STBW = ceiling(12us/ref_clk period) RD_STBW = ceiling(150ns/ref_clk period)
References XSK_EFUSEPS_CONFIG_REG, XSK_EFUSEPS_CONFIG_TSU_H_A, XSK_EFUSEPS_ERROR_CONTROLLER_MODE, XSK_EFUSEPS_ERROR_READ_MODE, XSK_EFUSEPS_ERROR_REF_CLOCK, XSK_EFUSEPS_PGM_STBW_REG, XSK_EFUSEPS_PRGM_STROBE_WIDTH, XSK_EFUSEPS_RD_STBW_REG, XSK_EFUSEPS_RD_STROBE_WIDTH, XSK_EFUSEPS_REFCLK_LOW_FREQ, and XSK_EFUSEPS_SINGLE_MODE.
Referenced by XilSKey_EfusePs_Read(), and XilSKey_EfusePs_Write().
| void XilSKey_EfusePs_ControllerSetReadWriteEnable | ( | u32 | ReadWriteEnable | ) |
This function is used to enable the read/write/program the eFUSE array.
| ReadWriteEnable | 0x1 - Enable programming 0x2 - Enable read 0x4 - Enable write |
Test Cases
Reset the values Disable programming Disable reading Disable writing
References XSK_EFUSEPS_CONTROL_PS_EN, XSK_EFUSEPS_CONTROL_RD_DIS, XSK_EFUSEPS_CONTROL_REG, XSK_EFUSEPS_CONTROL_WR_DIS, and XSK_EFUSEPS_ENABLE_PROGRAMMING.
Referenced by XilSKey_EfusePs_Read(), and XilSKey_EfusePs_Write().
| u8 XilSKey_EfusePs_EccDecode | ( | const u8 * | Corrupt, |
| u8 * | Syndrome | ||
| ) |
This function is used to decode the incoming encoded byte.
| Corrupt | is the input encoded data. It has 26 bit data with 5 bit parity data |
| Syndrome | is the output updated with the parity error information. |
TDD Cases: Check the parameters Check the decode with out any error Check the decode with 1 bit error Check the decode with 2 bit error Check the decode for boundary cases Check for memory corruption
References ErrorCodeIndex, and Matrix.
| void XilSKey_EfusePs_EccEncode | ( | const u8 * | InData, |
| u8 * | Ecc | ||
| ) |
This function is used to encode the incoming data byte.
It uses hamming (31,26) algorithm. 26 bits are encoded to 31 bits
| InData | is 26 bit input data with each bit represented in one byte |
| Ecc | is the 31 bit encoded data with each bit represented in one byte |
TDD Cases: Check the parameters Check the encoded data for different input data Check the input data for boundary cases Check for memory corruption
References Matrix.
| void XilSKey_EfusePs_GenerateMatrixMap | ( | void | ) |
This function is used to generate the matrix map of the G and H for hamming code (31,26).
G is [31,5] and defined as [A|I], I is identity matrix of [5,5].
TDD Cases: Check the generated matrix Check the memory corruption of the generated matrix
References ErrorCodeIndex, and Matrix.
| u8 XilSKey_EfusePs_IsAddressXilRestricted | ( | u32 | Addr | ) |
This function is used to check whether eFuse bit is xilinx reserved bit or not.
| Addr | is the address of the eFuse bit. |
Test Cases: with different address values Boundary values for addr
Check for xilinx test bits
Check for xilinx reserved bits
References XSK_EFUSEPS_APB_TRIM_BITS_START_ADDR, XSK_EFUSEPS_APB_TRIM_BITS_START_ADDR_2ND_HALF, XSK_EFUSEPS_APB_XILINX_RSVD_TEST_BIT_x20, and XSK_EFUSEPS_APB_XILINX_RSVD_TEST_BIT_x23F.
Referenced by XilSKey_EfusePs_ReadEfuseBit(), and XilSKey_EfusePs_WriteEfuseBit().
| u32 XilSKey_EfusePs_ReadEfuseBit | ( | u32 | Addr, |
| u8 * | Data | ||
| ) |
This function is used to read the eFuse bit value.
Before using this function set the controller mode and read mode as required. Also, strobe width values are to be set properly based on the reference clock for successful reading
| Addr | is the address of the eFuse bit. |
| Data | has the read eFuse value stored in it. |
Test Cases Read in Single mode Read in redundancy mode Read for restricted address Boundary Checks for address
References XilSKey_EfusePs_IsAddressXilRestricted(), and XSK_EFUSEPS_ERROR_ADDRESS_XIL_RESTRICTED.
| u32 XilSKey_EfusePs_WriteEfuseBit | ( | u32 | Addr | ) |
This function is used to program the eFuse bit value.
Before using this function set the controller mode and read mode as required. Also, strobe width values are to be set properly based on the reference clock for successful programming
| Addr | is the address of the eFuse bit. |
Test Cases Write in Single mode Write in redundancy mode Write for restricted address Boundary Checks for address Strobe width are not proper (Check if it makes sense)
Check if Address is restricted
Send success when bit is already programmed
Providing 15us delay Timer takes 100ns as slice. 15us = 150 * 100ns
References XilSKey_Efuse_IsTimerExpired(), XilSKey_Efuse_SetTimeOut(), XilSKey_EfusePs_IsAddressXilRestricted(), and XSK_EFUSEPS_ERROR_ADDRESS_XIL_RESTRICTED.
| u8 ErrorCodeIndex[32] |
Error Code Array.
Referenced by XilSKey_EfusePs_EccDecode(), and XilSKey_EfusePs_GenerateMatrixMap().
| u8 Matrix[31][5] |
PS eFUSE Matrix.
Referenced by XilSKey_EfusePs_EccDecode(), XilSKey_EfusePs_EccEncode(), and XilSKey_EfusePs_GenerateMatrixMap().