![]() |
xilskey
Vitis Drivers API Documentation
|
Contains jtag, efuse and bbram related API's.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a rpoolla 04/26/13 First release 1.01a hk 09/18/13 Added BBRAM functionality. Following API's added: int JtagServerInitBbram(XilSKey_Bbram *InstancePtr) int Bbram_Init(XilSKey_Bbram *InstancePtr) int Bbram_ProgramKey(XilSKey_Bbram *InstancePtr) int Bbram_VerifyKey(XilSKey_Bbram *InstancePtr) void Bbram_DeInit(void) 2.1 kvn 04/01/15 Fixed warnings. CR#716453.
3.00 vns 31/07/15 Added efuse functionality for Ultrascale.
4.00 vns 09/10/15 Modified JtagWrite API as per IEEE 1149.1 standard
added TCK toggle after RTI state change where programming
will start and toggled TCK again at exit of RTI state to
stop programming. CR#885421.
5.0 vns 01/07/16 Modified JtagWrite_Ultrascale API as per IEEE 1149.1
standard added TCK toggle after RTI state change where
programming will start and ends programming at
TCK toggle after DR_SELECT state. CR #924262
Modified JtagServerInitBbram to support Ultrascale
BBRAM programming, added Bbram_Init_Ultra,
Bbram_ProgramKey_Ultra, Bbram_VerifyKey_Ultra
and Bbram_DeInit_Ultra APIs
6.0 vns 07/07/16 Initialized hardware module connections
Modified JtagWrite_Ultrascale API, to handover
programming sequence to hardware module to take care
of eFUSE programming.
Once Hardware module is triggered, JTAG state will be
entering to IDLE state and will wait for 5us and
toggles TCK pin at 1Mhz frequency. Finally it exists
when jtag state is navigated to DR SELECT by making
END pin to High state.
Modified return type of JtagWrite_Ultrascale API to int
for returning FAILURE on timeout.
vns 07/28/16 Modified Bbram_ProgramKey_Ultra API to program control
word based on user inputs.
6.4 vns 02/27/18 Added support for virtex and virtex ultrascale plus
6.7 psl 03/18/19 Modified code to mask most significant nibble which
represents production version for ultrascale plus.
03/20/19 Added eFuse/BBRAM key write support for SSIT devices.
psl 03/29/19 Added Support for user configurable GPIO for jtag
control.
arc 04/04/19 Fixed CPP warnings.
psl 04/15/19 Corrected zynq Dap ID.
6.8 psl 06/26/19 Added support for user to add IDCODE, IR_length, SLR Nos,
device series for different devices.
psl 08/23/19 Added Debug define to avoid writing of eFuse.
6.9 vns 03/18/20 Fixed Armcc compilation errors
7.0 am 10/04/20 Resolved MISRA C violations
7.1 am 11/29/20 Resolved MISRA C violations
7.1 kpt 04/08/21 Ignored product version of user defined IDCODE when comparing
with the tap code read from Jtag
7.2 am 07/13/21 Fixed doxygen warnings
7.5 ng 07/13/23 added SDT support Macros | |
| #define | js_printf dummy_printf |
| Dummy PRINTF. More... | |
| #define | DEFAULT_FREQUENCY 10000000 |
| Default frequency. More... | |
| #define | MAX_FREQUENCY 30000000 |
| Maximum frequency. More... | |
| #define | ZYNQ_DAP_ID 0x0ba00477 |
| DAP Id. More... | |
| #define | KINTEX_ULTRA_MB_DAP_ID 0x03822093 |
| Kintex Ultrascale microblaze TAP ID. More... | |
| #define | KINTEX_ULTRAPLUS_DAP_ID 0x04A62093 |
| Kintex Ultrascale plus microblaze TAP ID. More... | |
| #define | VIRTEX110_ULTRA_MB_DAP_ID 0x03931093 |
| VIRTEX 110 Ultrascale microblaze TAP id. More... | |
| #define | VIRTEX108_ULTRA_MB_DAP_ID 0x03842093 |
| VIRTEX 108 Ultrascale microblaze TAP id. More... | |
| #define | VIRTEX_ULTRAPLUS_DAP_ID 0x04b31093 |
| VIRTEX Ultrascale plus microblaze TAP id. More... | |
| #define | VIRTEX_ULTRAPLUS_VC13P_DAP_ID 0x04B51093 |
| XCVU13P VIRTEX Ultrascale Plus microblaze TAP id. More... | |
| #define | ZYNQ_ULTRAPLUS_PL_DAP_ID 0x0484A093 |
| Zynq Ultrascale plus TAP ID. More... | |
| #define | set_last_error(JS,...) js_set_last_error(&(JS)->js.base, __VA_ARGS__) |
| Set last error. More... | |
Functions | |
| void | dummy_printf (const char *ctrl1,...) |
| function prototype of dummy_printf More... | |
| void | GpioConfig (unsigned long addr, unsigned long mask, unsigned long val) |
| This function performs Gpio Configuration. More... | |
| void | JtagInitGpio (XilSKey_ModuleSelection Module) |
| This function performs Gpio Jtag initialization. More... | |
| int | getByteCountFromBitCount (int bitCount) |
| This function calculates ByteCount From BitCount. More... | |
| u32 | calcInstr (u8 Instr, u8 cmd) |
| This function calculates instructions. More... | |
| unsigned int | getNavigateTAPValue (unsigned char startState, unsigned char endState) |
| This function calculates Navigate TAPValue. More... | |
| void | navigateTAP (unsigned char startState, unsigned char endState) |
| This function performs NavigateTAP. More... | |
| void | jtagShiftTDI (unsigned char tdiData, unsigned char *tdoData, int clkCount, int exitState) |
| This function performs Jtag shift TDI operation. More... | |
| int | jtagShiftTDIBits (unsigned char *tdiBuf, unsigned char *tdoBuf, int bitCount, js_state_t endState, unsigned int flags) |
| This function will be used to shift long bits. More... | |
| int | jtag_setPreAndPostPads (js_port_t *port_arg, int irPrePadBits, int irPostPadBits, int drPrePadBits, int drPostPadBits) |
| This function sets Jtag Pre and Post Pads. More... | |
| int | jtag_navigate (js_port_t *port, js_state_t state) |
| This function performs Jtag navigate operation. More... | |
| int | jtag_shift (js_port_t *port_arg, unsigned char mode, int bits, unsigned char *wrBuffer, unsigned char *rdBuffer, js_state_t state) |
| This function takes care of padding Must be set up with pre/post ir/dr info. More... | |
| int | open_port (js_lib_server_t *server, js_port_descr_t *port_descr, js_lib_port_t **result) |
| This function performs open port operation. More... | |
| js_server_t * | js_init_zynq () |
| < Prototype declarations for Xilskey jscmd APIs More... | |
| void | JtagWrite (unsigned char row, unsigned char bit) |
| JTAG Server Write routine. More... | |
| void | JtagRead (unsigned char row, unsigned int *row_data, unsigned char marginOption) |
| JTAG Server Read routine. More... | |
| int | JtagValidateMioPins (XilSKey_ModuleSelection Module) |
| This function validates MIO pins. More... | |
| int | JtagServerInit (XilSKey_EPl *InstancePtr) |
| JTAG Server Initialization routine. More... | |
| int | JtagServerInitBbram (XilSKey_Bbram *InstancePtr) |
| This function initializes JTAG server for use in BBRAM algorithm. More... | |
| int | Bbram_Init (void) |
| This function implements the BBRAM algorithm initialization. More... | |
| int | Bbram_ProgramKey (XilSKey_Bbram *InstancePtr) |
| This function implements the BBRAM program key. More... | |
| int | Bbram_VerifyKey (XilSKey_Bbram *InstancePtr) |
| This function implements the BBRAM verify key. More... | |
| void | Bbram_DeInit (void) |
| This function does de-initialization. More... | |
| void | Jtag_Read_Sysmon (u8 Row, u32 *Row_Data) |
| This function reads temperature and voltage of Ultrascale. More... | |
| int | JtagWrite_Ultrascale (u8 Row, u8 Bit, u8 Page, u8 Redundant) |
| This function blows the fuse of Ultrascale with provided parameters. More... | |
| void | JtagRead_Ultrascale (u8 Row, u32 *RowData, u8 MarginOption, u8 Page, u8 Redundant) |
| This function reads entire row of Ultrascale's EFUSE. More... | |
| void | JtagRead_Status_Ultrascale (u32 *Rowdata) |
| This function reads the status row of Ultrascale's EFUSE and updates the pointer. More... | |
| u32 | JtagAES_Check_Ultrascale (u32 *Crc, u8 MarginOption) |
| This function verifies the AES key of Ultrascale's EFUSE with provided CRC value. More... | |
| void | Bbram_Close_Ultra (void) |
| This function close UltraScale. More... | |
Xilskey jscmd API declarations | |
| |
| int | setPin (int pin, int value) |
| < Prototype declarations for Xilskey jscmd APIs More... | |
| int | readPin (int pin) |
Variables | |
| XilSKey_JtagSlr | XilSKeyJtag |
| JTAG Tap Instance. More... | |
| XSKEfusePl_Fpga | PlFpgaFlag |
| For Storing Fpga series. More... | |
| const unsigned int | JTAGNavigateTable [256] |
| File generated by JTAG.EXE. More... | |
| #define DEFAULT_FREQUENCY 10000000 |
Default frequency.
| #define js_printf dummy_printf |
Dummy PRINTF.
Referenced by JtagInitGpio(), JtagServerInit(), JtagServerInitBbram(), jtagShiftTDIBits(), and navigateTAP().
| #define KINTEX_ULTRA_MB_DAP_ID 0x03822093 |
Kintex Ultrascale microblaze TAP ID.
| #define KINTEX_ULTRAPLUS_DAP_ID 0x04A62093 |
Kintex Ultrascale plus microblaze TAP ID.
| #define MAX_FREQUENCY 30000000 |
Maximum frequency.
| #define set_last_error | ( | JS, | |
| ... | |||
| ) | js_set_last_error(&(JS)->js.base, __VA_ARGS__) |
Set last error.
Referenced by open_port().
| #define VIRTEX108_ULTRA_MB_DAP_ID 0x03842093 |
VIRTEX 108 Ultrascale microblaze TAP id.
| #define VIRTEX110_ULTRA_MB_DAP_ID 0x03931093 |
VIRTEX 110 Ultrascale microblaze TAP id.
| #define VIRTEX_ULTRAPLUS_DAP_ID 0x04b31093 |
VIRTEX Ultrascale plus microblaze TAP id.
| #define VIRTEX_ULTRAPLUS_VC13P_DAP_ID 0x04B51093 |
XCVU13P VIRTEX Ultrascale Plus microblaze TAP id.
| #define ZYNQ_DAP_ID 0x0ba00477 |
DAP Id.
| #define ZYNQ_ULTRAPLUS_PL_DAP_ID 0x0484A093 |
Zynq Ultrascale plus TAP ID.
| void Bbram_Close_Ultra | ( | void | ) |
This function close UltraScale.
References calcInstr(), jtag_navigate(), jtag_shift(), setPin(), and XilSKeyJtag.
Referenced by main().
| void Bbram_DeInit | ( | void | ) |
This function does de-initialization.
De-initialization.
References calcInstr(), jtag_navigate(), jtag_setPreAndPostPads(), jtag_shift(), and XilSKeyJtag.
| int Bbram_Init | ( | void | ) |
This function implements the BBRAM algorithm initialization.
BBRAM Algorithm - Initialization.
- XST_FAILURE - In case of failure - XST_SUCCESS - In case of Success
References calcInstr(), jtag_navigate(), jtag_setPreAndPostPads(), jtag_shift(), XilSKey_Efuse_IsTimerExpired(), XilSKey_Efuse_SetTimeOut(), and XilSKeyJtag.
| int Bbram_ProgramKey | ( | XilSKey_Bbram * | InstancePtr | ) |
This function implements the BBRAM program key.
BBRAM Algorithm - Program key.
| InstancePtr | - instance pointer |
- XST_FAILURE - In case of failure - XST_SUCCESS - In case of Success
References calcInstr(), jtag_navigate(), jtag_setPreAndPostPads(), jtag_shift(), setPin(), and XilSKeyJtag.
| int Bbram_VerifyKey | ( | XilSKey_Bbram * | InstancePtr | ) |
This function implements the BBRAM verify key.
BBRAM Algorithm - Verify key.
Program and verify key have to be done together; These API's cannot be used independently.
| InstancePtr | - instance pointer |
- XST_FAILURE - In case of failure - XST_SUCCESS - In case of Success
References calcInstr(), jtag_navigate(), jtag_setPreAndPostPads(), jtag_shift(), setPin(), and XilSKeyJtag.
| u32 calcInstr | ( | u8 | Instr, |
| u8 | cmd | ||
| ) |
This function calculates instructions.
References XilSKeyJtag.
Referenced by Bbram_Close_Ultra(), Bbram_DeInit(), Bbram_Init(), Bbram_ProgramKey(), Bbram_VerifyKey(), Jtag_Read_Sysmon(), JtagAES_Check_Ultrascale(), JtagRead(), JtagRead_Status_Ultrascale(), JtagRead_Ultrascale(), JtagWrite(), and JtagWrite_Ultrascale().
| void dummy_printf | ( | const char * | ctrl1, |
| ... | |||
| ) |
function prototype of dummy_printf
| int getByteCountFromBitCount | ( | int | bitCount | ) |
This function calculates ByteCount From BitCount.
Referenced by jtag_shift(), and jtagShiftTDIBits().
| unsigned int getNavigateTAPValue | ( | unsigned char | startState, |
| unsigned char | endState | ||
| ) |
This function calculates Navigate TAPValue.
References JTAGNavigateTable.
Referenced by navigateTAP().
| void GpioConfig | ( | unsigned long | addr, |
| unsigned long | mask, | ||
| unsigned long | val | ||
| ) |
This function performs Gpio Configuration.
Referenced by JtagInitGpio().
| js_server_t* js_init_zynq | ( | void | ) |
< Prototype declarations for Xilskey jscmd APIs
References open_port().
Referenced by JtagServerInit(), and JtagServerInitBbram().
| int jtag_navigate | ( | js_port_t * | port, |
| js_state_t | state | ||
| ) |
This function performs Jtag navigate operation.
References js_port_struct::root_node.
Referenced by Bbram_Close_Ultra(), Bbram_DeInit(), Bbram_Init(), Bbram_ProgramKey(), Bbram_VerifyKey(), Jtag_Read_Sysmon(), JtagAES_Check_Ultrascale(), JtagRead(), JtagRead_Status_Ultrascale(), JtagRead_Ultrascale(), JtagWrite(), JtagWrite_Ultrascale(), and open_port().
| void Jtag_Read_Sysmon | ( | u8 | Row, |
| u32 * | Row_Data | ||
| ) |
This function reads temperature and voltage of Ultrascale.
| Row | specifies the row number to read. |
| Row_Data | is a pointer to a variable, to store the read value of given row. |
References calcInstr(), jtag_navigate(), jtag_shift(), setPin(), and XilSKeyJtag.
Referenced by XilSKey_EfusePs_XAdcReadTemperatureAndVoltage().
| int jtag_setPreAndPostPads | ( | js_port_t * | port_arg, |
| int | irPrePadBits, | ||
| int | irPostPadBits, | ||
| int | drPrePadBits, | ||
| int | drPostPadBits | ||
| ) |
This function sets Jtag Pre and Post Pads.
Referenced by Bbram_DeInit(), Bbram_Init(), Bbram_ProgramKey(), Bbram_VerifyKey(), JtagRead(), and JtagWrite().
| int jtag_shift | ( | js_port_t * | port_arg, |
| unsigned char | mode, | ||
| int | bits, | ||
| unsigned char * | wrBuffer, | ||
| unsigned char * | rdBuffer, | ||
| js_state_t | state | ||
| ) |
This function takes care of padding Must be set up with pre/post ir/dr info.
References getByteCountFromBitCount(), and js_port_struct::root_node.
Referenced by Bbram_Close_Ultra(), Bbram_DeInit(), Bbram_Init(), Bbram_ProgramKey(), Bbram_VerifyKey(), Jtag_Read_Sysmon(), JtagAES_Check_Ultrascale(), JtagRead(), JtagRead_Status_Ultrascale(), JtagRead_Ultrascale(), JtagWrite(), and JtagWrite_Ultrascale().
| u32 JtagAES_Check_Ultrascale | ( | u32 * | Crc, |
| u8 | MarginOption | ||
| ) |
This function verifies the AES key of Ultrascale's EFUSE with provided CRC value.
| Crc | is a pointer to a 32 bit variable which holds the expected AES key's CRC. |
| MarginOption | is a variable which tells the margin option in which read operation to be performed. |
References calcInstr(), jtag_navigate(), jtag_shift(), PlFpgaFlag, and XilSKeyJtag.
| void JtagInitGpio | ( | XilSKey_ModuleSelection | Module | ) |
This function performs Gpio Jtag initialization.
References GpioConfig(), and js_printf.
Referenced by JtagServerInit(), and JtagServerInitBbram().
| void JtagRead | ( | unsigned char | row, |
| unsigned int * | row_data, | ||
| unsigned char | marginOption | ||
| ) |
JTAG Server Read routine.
References calcInstr(), jtag_navigate(), jtag_setPreAndPostPads(), jtag_shift(), and XilSKeyJtag.
| void JtagRead_Status_Ultrascale | ( | u32 * | Rowdata | ) |
This function reads the status row of Ultrascale's EFUSE and updates the pointer.
| Rowdata | is a pointer to a 32 bit variable which stores the status register value read from EFUSE status register. |
References calcInstr(), jtag_navigate(), jtag_shift(), XilSKey_Efuse_ReverseHex(), and XilSKeyJtag.
| void JtagRead_Ultrascale | ( | u8 | Row, |
| u32 * | RowData, | ||
| u8 | MarginOption, | ||
| u8 | Page, | ||
| u8 | Redundant | ||
| ) |
This function reads entire row of Ultrascale's EFUSE.
| Row | specifies the row number of EFUSE. |
| MarginOption | is a variable which tells the margin option in which read operation to be performed. |
| Page | tell the page of EFUSE in which the given row is located. |
| Redundant | is a flag to specify the bit to be programmed is Normal bit or Redundant bit.
|
References calcInstr(), jtag_navigate(), jtag_shift(), PlFpgaFlag, and XilSKeyJtag.
| int JtagServerInit | ( | XilSKey_EPl * | InstancePtr | ) |
JTAG Server Initialization routine.
References XilSKey_EPl::FpgaFlag, XilSKey_EPl::GpioInputCh, XilSKey_EPl::GpioOutPutCh, XilSKey_EPl::HwmGpioEnd, XilSKey_EPl::HwmGpioReady, XilSKey_EPl::HwmGpioStart, js_init_zynq(), js_printf, XilSKey_EPl::JtagGpioID, XilSKey_EPl::JtagGpioTCK, XilSKey_EPl::JtagGpioTDI, XilSKey_EPl::JtagGpioTDO, XilSKey_EPl::JtagGpioTMS, JtagInitGpio(), XilSKey_EPl::JtagMioMuxSel, XilSKey_EPl::JtagMioTCK, XilSKey_EPl::JtagMioTDI, XilSKey_EPl::JtagMioTDO, XilSKey_EPl::JtagMioTMS, XilSKey_EPl::JtagMuxSelLineDefVal, JtagValidateMioPins(), XilSKey_EPl::MasterSlr, XilSKey_EPl::NumSlr, and XilSKeyJtag.
| int JtagServerInitBbram | ( | XilSKey_Bbram * | InstancePtr | ) |
This function initializes JTAG server for use in BBRAM algorithm.
JTAG Server Initialization routine for Bbram.
| InstancePtr | - instance pointer |
- XST_FAILURE - In case of failure - XST_SUCCESS - In case of Success
References js_init_zynq(), js_printf, JtagInitGpio(), JtagValidateMioPins(), and XilSKeyJtag.
| void jtagShiftTDI | ( | unsigned char | tdiData, |
| unsigned char * | tdoData, | ||
| int | clkCount, | ||
| int | exitState | ||
| ) |
This function performs Jtag shift TDI operation.
References setPin().
Referenced by jtagShiftTDIBits().
| int jtagShiftTDIBits | ( | unsigned char * | tdiBuf, |
| unsigned char * | tdoBuf, | ||
| int | bitCount, | ||
| js_state_t | endState, | ||
| unsigned int | flags | ||
| ) |
This function will be used to shift long bits.
References getByteCountFromBitCount(), js_printf, and jtagShiftTDI().
| int JtagValidateMioPins | ( | XilSKey_ModuleSelection | Module | ) |
This function validates MIO pins.
Referenced by JtagServerInit(), and JtagServerInitBbram().
| void JtagWrite | ( | unsigned char | row, |
| unsigned char | bit | ||
| ) |
JTAG Server Write routine.
References calcInstr(), jtag_navigate(), jtag_setPreAndPostPads(), jtag_shift(), setPin(), XilSKey_Efuse_IsTimerExpired(), XilSKey_Efuse_SetTimeOut(), and XilSKeyJtag.
| int JtagWrite_Ultrascale | ( | u8 | Row, |
| u8 | Bit, | ||
| u8 | Page, | ||
| u8 | Redundant | ||
| ) |
This function blows the fuse of Ultrascale with provided parameters.
| Row | specifies the row number of EFUSE to blow. |
| Bit | Specifies the bit location in the given row. |
| Page | tell the page of EFUSE in which the given row is located. |
| Redundant | is a flag to specify the bit to be programmed is Normal bit or Redundant bit.
|
References calcInstr(), jtag_navigate(), jtag_shift(), PlFpgaFlag, setPin(), TimerTicksfor1000ns, XilSKey_Efuse_IsTimerExpired(), XilSKey_Efuse_StartTimer(), and XilSKeyJtag.
| void navigateTAP | ( | unsigned char | startState, |
| unsigned char | endState | ||
| ) |
This function performs NavigateTAP.
References getNavigateTAPValue(), js_printf, and setPin().
| int open_port | ( | js_lib_server_t * | server, |
| js_port_descr_t * | port_descr, | ||
| js_lib_port_t ** | result | ||
| ) |
This function performs open port operation.
References js_lib_server_struct::base, js_node_struct::idcode, js_node_struct::is_active, js_node_struct::is_tap, jtag_navigate(), js_node_struct::name, js_node_struct::port, set_last_error, and setPin().
Referenced by js_init_zynq().
| int setPin | ( | int | pin, |
| int | value | ||
| ) |
< Prototype declarations for Xilskey jscmd APIs
Referenced by Bbram_Close_Ultra(), Bbram_ProgramKey(), Bbram_VerifyKey(), Jtag_Read_Sysmon(), jtagShiftTDI(), JtagWrite(), JtagWrite_Ultrascale(), navigateTAP(), and open_port().
| const unsigned int JTAGNavigateTable[256] |
File generated by JTAG.EXE.
This are the tms values and the corresponding bit counts to navigate quickly from any state to any state.
Referenced by getNavigateTAPValue().
| XSKEfusePl_Fpga PlFpgaFlag |
For Storing Fpga series.
Referenced by JtagAES_Check_Ultrascale(), JtagRead_Ultrascale(), and JtagWrite_Ultrascale().
| XilSKey_JtagSlr XilSKeyJtag |
JTAG Tap Instance.
Referenced by Bbram_Close_Ultra(), Bbram_DeInit(), Bbram_Init(), Bbram_ProgramKey(), Bbram_VerifyKey(), calcInstr(), Jtag_Read_Sysmon(), JtagAES_Check_Ultrascale(), JtagRead(), JtagRead_Status_Ultrascale(), JtagRead_Ultrascale(), JtagServerInit(), JtagServerInitBbram(), JtagWrite(), and JtagWrite_Ultrascale().