1.11.2.5. Functions
Prototype: | librsu_init(void) |
Parameters: | - |
Return: | Return 0 for success, or otherwise return error code 22 |
Description: | Initialize the LibRSU HAL API |
Prototype: | librsu_exit (void) |
Parameters: | - |
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Stop the LibRSU HAL API, and close the Mailbox Client Intel FPGA IP if opened. |
Prototype: | rsu_slot_count (void) |
Parameters: | - |
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Get the number of defined slots. |
Prototype: | rsu_slot_by_name (char *name) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Get slot number based on name. |
Prototype: | rsu_slot_get_info (int slot, struct rsu_slot_info *info) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Get the attributes of a slot. |
Prototype: | rsu_slot_size (int slot) |
Parameters: |
|
Return: | Return the size of the slot in bytes for success, or otherwise return error code22 |
Description: | Get the size of a slot. |
Prototype: | rsu_slot_priority (int slot) |
Parameters: |
|
Return: | Return the priority of the slot for success, or otherwise return error code22 |
Description: | Get the load priority of a slot. Priority of zero means the slot has no priority and is disabled. The slot with priority of one has the highest priority. |
Prototype: | rsu_slot_erase (int slot) |
Parameters: | slot – slot number |
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Erase all data in a slot to prepare for programming. Remove the slot if it is in the CPB. |
Prototype: | rsu_slot_program_buf (int slot, void *buf, int size) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Program a slot using Intel FPGA bitstream data from a buffer and enter slot into CPB as highest priority. The slot must be erased first. |
Prototype: | rsu_slot_program_callback(int slot, rsu_data_callback callback) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | This function is to program and verify a slot using Intel FPGA config data provided by a callback function. Enter the slot (partition) into the CPB. |
Prototype: | rsu_slot_verify_buf (int slot, void *buf, int size) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Verify FPGA config data in a slot against a buffer. |
Prototype: | rsu_slot_verify_callback(int slot, rsu_data_callback callback) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Verify a slot using Intel FPGA bitstream provided by a callback function. |
Prototype: | rsu_slot_copy_to_buf(int slot, alt_u64 address) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Read the data in a slot and write to a buffer. |
Prototype: | rsu_slot_enable (int slot) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Set the selected slot as the highest priority. |
Prototype: | rsu_slot_disable (int slot) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Remove the selected slot from the priority scheme, but the slot data remains.. |
Prototype: | rsu_slot_load (int slot) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Request the selected slot to be loaded immediately. |
Prototype: | rsu_slot_load_factory (void) |
Parameters: | - |
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Request the factory image to be loaded immediately. |
Prototype: | rsu_slot_rename (int slot, char *name) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Rename the selected slot. |
Prototype: | rsu_slot_create (char *name, alt_u64 address, unsigned int size) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Create a new slot to the SPT, using unused space. |
Prototype: | rsu_slot_delete (int slot) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Delete the selected slot from SPT. |
Prototype: | rsu_status_log (struct rsu_status_info *info) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Copy firmware status log into the rsu_status_info structure. |
Prototype: | rsu_clear_error_status (void) |
Parameters: | - |
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Clear the error fields from the current status log. |
Prototype: | rsu_dcmf_version (alt_u32 *version) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Retrieve the version of each of the four decision firmware copies in flash. |
Prototype: | rsu_max_retry (alt_u8 *value) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Retrieve the max_retry parameter from flash. |
Prototype: | rsu_dcmf_status (int *status) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Determine whether decision firmware copies are corrupted in flash, with the currently used decision firmware being used as reference. The status is an array of four values, one for each decision firmware copy. A value of 0 means the copy is fine, anything else means the copy is corrupted. |
Prototype: | rsu_create_empty_cpb (void) |
Parameters: | - |
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Create an empty CPB, which includes the CPB header only. All entries are marked as unused. |
Prototype: | rsu_restore_cpb (alt_u64 address) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Restore CPB from a buffer in memory. The buffer must contain the 4096 bytes of CPB data, followed by 4 bytes containing the CRC32 checksum of the data. |
Prototype: | rsu_save_cpb (alt_u64 address) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Save CPB to a memory buffer. A total of 4100 bytes are written: 4096 bytes for the data, plus 4 bytes with a CRC32 checksum of the data. |
Prototype: | rsu_restore_spt (alt_u64 address) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Restore SPT from a buffer in memory. The buffer must contain the 4096 bytes of SPT data, followed by 4 bytes containing the CRC32 checksum of the data. |
Prototype: | rsu_save_spt (alt_u64 address) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Save SPT to an address in memory. A total of 4100 bytes are written: 4096 bytes for the data, plus 4 bytes with a CRC32 checksum of the data. |
Prototype: | rsu_running_factory (int *factory) |
Parameters: |
|
Return: | Return 0 for success, or otherwise return error code22 |
Description: | Determine if current running image is factory image. |
22 Refer to Error Codes for more information.