![]() |
![]() |
The section has a list of all internal functions which are used internally by the SBL module. More...
Functions | |
| void | SBL_bufferMgmt (uint32_t inputBuffer[], uint32_t bufferLen, uint8_t isLastBufferLcl) |
| static void | SBL_applyConfigFile (uint32_t *bufferPtr, uint32_t bufferLen) |
| static void | SBL_updateVarHeaderStateEnd (void) |
| static void | SBL_readRPRCHeaderStateUpdate (uint32_t bytesRead) |
| static uint32_t | SBL_extractRPRCHeader (uint32_t readPtrLcl[], uint32_t bufferLen) |
| static uint32_t | SBL_readRPRCHeader (uint32_t *bufferPtr, uint32_t bufferLenIp) |
| static uint32_t | SBL_handleSectionDwldComplete (void) |
| static uint32_t | SBL_readRPRCSecContent (uint32_t *bufferPtr, uint32_t bufferLenIp) |
| static uint32_t | SBL_readAlignmentBytes (uint32_t *bufferPtr, uint32_t bufferLenIp) |
| static uint32_t | SBL_extractRPRCSecHeader (uint32_t readPtrLcl[]) |
| static uint32_t | SBL_updateVarSectionHeaderStateEnd (void) |
| static uint32_t | SBL_readRPRCSecHeader (uint32_t *bufferPtr, uint32_t bufferLenIp) |
| void | SBL_parserInitialization (void) |
| uint32_t | SBL_imageParser (uint32_t *bufferPtr, uint32_t bufferLen) |
| void | SBL_imageAuthParamsInit (void) |
| int32_t | SBL_imageValidationCheck (uint32_t *readPtr, uint32_t bufferLen) |
| static void | copyCode (uint32_t *dest, uint32_t *src, uint32_t length) |
| void | _system_pre_init (void) |
| int | main (void) |
| static uint32_t | SBL_imageDetailParse (uint32_t bufferPtrLcl[]) |
| uint32_t | SBL_metaHeaderParser (uint32_t bufferPtr[]) |
| static uint32_t | SBL_stateMetaHeaderParser (uint32_t readPtrLcl[]) |
| static uint32_t | SBL_stateRPRCDownloadParse (uint32_t readPtrLcl[], uint32_t bufferLen) |
| void | SBL_multicoreImageParser (void) |
| static void | SBL_switchBuffer () |
| void | SBL_bufferMgmtTask (UArg arg0, UArg arg1) |
| int32_t | SBL_imageLoader (QSPIFlash_Handle qspiFlashHandle, uint32_t flashAddr) |
| int32_t | SBL_imageFlasher (QSPIFlash_Handle qspiFlashHandle, uint32_t flashAddr) |
| void | SBL_initTask (UArg arg0, UArg arg1) |
| void | SBL_init (void) |
| static int32_t | SBL_verifyCRC (uint8_t *dataBuffer, uint32_t dataLength, uint32_t verifyCRC) |
| static void | SBL_discardInput (void) |
| void | SBL_transportInit (void) |
| void | SBL_transportDeinit (void) |
| int32_t | SBL_transportConfig (void) |
| int32_t | SBL_transportRead (uint8_t *buffer, uint32_t size) |
| void | SBL_printf (const uint8_t *pcFormat,...) |
| int32_t | SBL_transportDownloadFile (QSPIFlash_Handle qspiFlashHandle, uint32_t flashAddr, uint32_t maxSize) |
| void | SBL_platformInit (void) |
| void | SBL_mpuConfigDefault (void) |
| void | SBL_mpuConfigBSS (bool enable) |
| uint32_t | SBL_calculateImageOffset (uint32_t sectionPtr, uint32_t sectionLen) |
The section has a list of all internal functions which are used internally by the SBL module.
| void _system_pre_init | ( | void | ) |
Description
This function is called on reset. It copies the code deom TCMA to TCMB memory. All the SBL routines run in TCMB memory. The variables used are defined in the linker command file.
| Not | Applicable |
|
static |
Description
Code copy routine
| Not | Applicable |
| int main | ( | void | ) |
Description
Entry point into the application code. This is the only code that runs in TCMA memory. Calls the SBL initialization routine that will run in TCMB memory.
| Not | Applicable. |
|
static |
Description
Apply config file. This function implements the state m/c for the RPRC image parser.
| [in] | bufferPtr | Config file buffer pointer. |
| [in] | bufferLen | Data length. |
| Number | of bytes read. |
| void SBL_bufferMgmt | ( | uint32_t | inputBuffer[], |
| uint32_t | bufferLen, | ||
| uint8_t | isLastBufferLcl | ||
| ) |
Description
This is the buffer management function that manages the input buffers. It invokes the parsing routine when the buffer is full.
| [in] | inputBuffer | Input data to sent from the interface |
| [in] | bufferLen | Length of the input buffer |
| [in] | isLastBufferLcl | Flag to indicate the the last buffer |
| Not | applicable |
| void SBL_bufferMgmtTask | ( | UArg | arg0, |
| UArg | arg1 | ||
| ) |
Description
Manages the parsing of buffers
| [in] | arg0 | Task Arg0 |
| [in] | arg1 | Task Arg1 |
| Not | Applicable. |
| uint32_t SBL_calculateImageOffset | ( | uint32_t | sectionPtr, |
| uint32_t | sectionLen | ||
| ) |
Description
This function calculates the RAM file offset.
| [in] | sectionPtr | Section start address. |
| [in] | sectionLen | Section Length. |
| RAM | Offset |
|
static |
Description
This function is used to discard the incoming UART stream incase an error is detected.
| Not | Applicable. |
|
static |
Description
Used to extract the RPRC header.
| [in] | readPtrLcl | Buffer pointer. |
| [in] | bufferLen | Buffer length. |
| Number | of bytes read. |
|
static |
Description
This function is used to extract the section header.
| [in] | readPtrLcl | Buffer pointer |
| Number | of bytes read. |
|
static |
Description
Used to update globals on sectionDwld complete.
| Number | of bytes read. |
| void SBL_imageAuthParamsInit | ( | void | ) |
Description
Initializes the decryption parameters to reset state.
| Not | applicable |
|
static |
Description
This function extracts the image details from Meta Header.
| [in] | bufferPtrLcl | Buffer pointer. |
| Number | of bytes read. |
| int32_t SBL_imageFlasher | ( | QSPIFlash_Handle | qspiFlashHandle, |
| uint32_t | flashAddr | ||
| ) |
Description
This function download the application meta imageover over a device peripheral. It does the following:
| [in] | qspiFlashHandle | Handle of QSPI Flash module. |
| [in] | flashAddr | Address of SFLASH location where the application meta image is written to. |
| Success | - 0 |
| Error | - SBL Error code |
| int32_t SBL_imageLoader | ( | QSPIFlash_Handle | qspiFlashHandle, |
| uint32_t | flashAddr | ||
| ) |
Description
Downloads the Application Metaimage from FLASH to respective RAMs
| [in] | qspiFlashHandle | Handle of QSPI Flash module. |
| [in] | flashAddr | Address of SFLASH location where the application meta image is written to. |
| Success | - 0 |
| Error | - SBL Error code |
| uint32_t SBL_imageParser | ( | uint32_t * | bufferPtr, |
| uint32_t | bufferLen | ||
| ) |
Description
This function implements the state m/c for the RPRC image parser.
| [in] | bufferPtr | Input buffer for parsing |
| [in] | bufferLen | Input buffer data length |
| Number | of bytes used. |
| int32_t SBL_imageValidationCheck | ( | uint32_t * | readPtr, |
| uint32_t | bufferLen | ||
| ) |
Description
Authenticates and validates the image.
| [in] | readPtr | Input data that has to be validated. |
| [in] | bufferLen | Data length in bytes. |
| Success | - 0 |
| Error | - SBL Error code |
| void SBL_init | ( | void | ) |
Description
Called from main.c that runs in TCMA memory. It initializes the SOC, Configures MPU, halts DSS, performs platform related intializations and launches the init task.
| Not | Applicable. |
| void SBL_initTask | ( | UArg | arg0, |
| UArg | arg1 | ||
| ) |
Description
Decides whether the application acts as meta Image Flasher or Image Loader based upon user input.
| [in] | arg0 | Task Arg0 |
| [in] | arg1 | Task Arg1 |
| Not | Applicable. |
| uint32_t SBL_metaHeaderParser | ( | uint32_t | bufferPtr[] | ) |
Description
This function implements the parser for the meta header.
| [in] | bufferPtr | Pointer to the buffer containing the meta header. |
| Number | of bytes read. |
| void SBL_mpuConfigBSS | ( | bool | enable | ) |
Description
This function configures the MPU for BSS regions.
| [in] | enable | Flag to enable or disable the MPU settings for BSS regions. |
| Not | applicable. |
| void SBL_mpuConfigDefault | ( | void | ) |
Description
The function is used to initialize MPU (Memory Protection Unit) settings. This is valid only for the R4. Information about MPU programming is available at:-
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0363g/Chdcahcf.html.
BSS Memory will be configured when the BSS sections are updated. In the default MPU configuration, these sections are marked as reserved.
| Not | applicable |
| void SBL_multicoreImageParser | ( | void | ) |
Description
This function implements the state machine for the Meta Image parsing.
| Not | applicable. |
| void SBL_parserInitialization | ( | void | ) |
Description
This function is the initialization function for all the parser variables.
| Not | applicable. |
| void SBL_platformInit | ( | void | ) |
Description
Platform specific intializations.
| Not | applicable |
| void SBL_printf | ( | const uint8_t * | pcFormat, |
| ... | |||
| ) |
Description
Takes the Formatted input string and dumps it on the UART console
| Not | Applicable |
|
static |
Description
This function returns number of alignment bytes used.
| [in] | bufferPtr | Pointer to the buffer that contains data for parsing. |
| [in] | bufferLenIp | Buffer length in bytes. |
| Number | of bytes read. |
|
static |
Description
RPRC Image header parser. This function implements the state m/c for the RPRC image header parser.
| [in] | bufferPtr | Pointer to the buffer used for parsing. |
| [in] | bufferLenIp | Buffer length in bytes. |
| Number | of bytes read. |
|
static |
Description
Used to read RPRC header header state update.
| [in] | bytesRead | Number of bytes used. |
| Not | applicable. |
|
static |
Description
This function process the RPRC image section content.
| [in] | bufferPtr | Pointer to the buffer that contains data for parsing. |
| [in] | bufferLenIp | Buffer length in bytes. |
| Number | of bytes read. |
|
static |
Description
This function implements the state m/c for the RPRC image section header parser.
| [in] | bufferPtr | Pointer to the buffer that contains data for parsing. |
| [in] | bufferLenIp | Buffer length in bytes. |
| Number | of bytes read. |
|
static |
Description
This function parses the Meta Header.
| [in] | readPtrLcl | Pointer to the input buffer. |
| Number | of bytes read. |
|
static |
Description
This function parses the RPRC image.
| [in] | readPtrLcl | Pointer to the input buffer. |
| [in] | bufferLen | Input buffer length. |
| Number | of bytes read. |
|
inlinestatic |
Description
Switches between Ping and Pong Buffer
| Not | Applicable. |
| int32_t SBL_transportConfig | ( | void | ) |
Description
Opens the UART instance in the specified mode.
| Success | - 0 |
| Error | - SBL Error code |
| void SBL_transportDeinit | ( | void | ) |
Description
This function de-initializes the UART interface that is used as transport to download the file.
| Not | Applicable. |
| int32_t SBL_transportDownloadFile | ( | QSPIFlash_Handle | qspiFlashHandle, |
| uint32_t | flashAddr, | ||
| uint32_t | maxSize | ||
| ) |
Description
This function downloads the application meta image file over UART using XMODEM. The downloaded file is written to SFLASH pointed to by the flash address. XMODEM receive routine is implemented based on the following sender<->receiver handshake. NAK and CAN handshake is not shown below.
RECEIVER ("s -k foo.bar") SENDER ("foo.bar open x.x minutes")
C
STX 01 FE Data[1024] CRC CRC
ACK
STX 02 FD Data[1024] CRC CRC
ACK
SOH 03 FC Data[128] CRC CRC
ACK
SOH 04 FB Data[100] CPMEOF[28] CRC CRC
ACK
EOT
ACK
| [in] | qspiFlashHandle | Handle of QSPI Flash module. |
| [in] | flashAddr | Address of SFLASH location where the application meta image is written to. |
| [in] | maxSize | Maximum size of meta image. |
| Success | - Number of bytes read. |
| Error | - SBL Error code. |
| void SBL_transportInit | ( | void | ) |
Description
This function initializes the UART interface that is used as transport to download the file.
| Not | Applicable. |
| int32_t SBL_transportRead | ( | uint8_t * | buffer, |
| uint32_t | size | ||
| ) |
Description
This function is used to read a input character from the UART peripheral.
| Not | Applicable. |
|
static |
Description
Used to update globals at the end of RPRC header.
| Not | applicable. |
|
static |
Description
Used to update the globals in end sectionHeader.
| Image | offset. |
|
static |
Description
This function is used to verify the CRC or checksum of a block of data.
| [in] | dataBuffer | Pointer to the data buffer. |
| [in] | dataLength | Size of the data buffer. |
| [in] | verifyCRC | Flag indicating whether CRC or checksum has to be verified. |
| Success | - 0 |
| Error | - SBL Error code |