Hardware Libraries  20.1
Arria 10 SoC Hardware Manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Flash Erase

Description

The functions in this group are used to erase selected portions of a flash device.

Functions

ALT_STATUS_CODE alt_qspi_query_erase_options (uint32_t *options)
 
ALT_STATUS_CODE alt_qspi_query_erase_span (uint32_t address, uint32_t size, uint32_t *actual_address, uint32_t *actual_size)
 
ALT_STATUS_CODE alt_qspi_erase_chip (void)
 
ALT_STATUS_CODE alt_qspi_erase (uint32_t address, uint32_t size)
 
ALT_STATUS_CODE alt_qspi_erase_sector (const uint32_t addr)
 
ALT_STATUS_CODE alt_qspi_replace (uint32_t dst, const void *src, size_t size, char *bank_buffer, uint32_t buffer_size)
 

Function Documentation

ALT_STATUS_CODE alt_qspi_query_erase_options ( uint32_t *  options)

This function queries the available erase sizes

Each bit that is set signifies an erase size available

Parameters
optionsA pointer to a 32 bit integer which will contain the erase sizes
Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.
ALT_STATUS_CODE alt_qspi_query_erase_span ( uint32_t  address,
uint32_t  size,
uint32_t *  actual_address,
uint32_t *  actual_size 
)

Determine how much qspi memory actually needs to be erased for erasing a specific area *

Parameters
addressThe qspi address that you want to erase
sizeThe amount of qspi memory that you want to erase
actualaddress Pointer to store the first qspi address that would be erased
actual_sizePoint to store the actual size that would be erased
Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.
ALT_STATUS_CODE alt_qspi_erase_chip ( void  )

Erase the entire qspi memory

Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.
ALT_STATUS_CODE alt_qspi_erase ( uint32_t  address,
uint32_t  size 
)

Erase a portion of flash

Parameters
addressThe qspi address that you want to erase
sizeThe amount of qspi memory that you want to erase
Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.
ALT_STATUS_CODE alt_qspi_erase_sector ( const uint32_t  addr)

This function erases the designated flash device sector.

This function erases the flash device sector containing the designated flash address. Any address within the sector is valid.

Parameters
addrA flash address contained within the the sector to be erased.
Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.
ALT_STATUS_CODE alt_qspi_replace ( uint32_t  dst,
const void *  src,
size_t  size,
char *  bank_buffer,
uint32_t  buffer_size 
)

This function erases the designated flash device sector.

This function erases the flash device sector containing the designated flash address. Any address within the sector is valid.

Parameters
dstThe destination flash address to begin writing data to.
srcThe source address to start writing data from.
sizeThe requested number of data bytes to write to the flash device.
bank_bufferA pointer to a buffer bug enough to store a qspi sector used for storing data between erasing and rewriting. The size of this buffer should be at least twice get_smallest_sector_size()
Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.