See BOOTLOADER for more details.
Data Structures | |
struct | Bootloader_Params |
Parameters passed during Bootloader_open() More... | |
struct | Bootloader_Fxns |
Driver implementation callbacks. More... | |
struct | Bootloader_Config |
Bootloader driver configuration, these are filled by SysCfg based on the boot media selected. More... | |
struct | Bootloader_CpuInfo |
Data structure containing information related to a particular CPU, required for MCELF loading. More... | |
struct | Bootloader_BootImageInfo |
Data structure containing information related all CPUs, this will be filled by Bootloader_parseAndLoadMultiCoreELF. More... | |
struct | Bootloader_LoadImageParams |
Data structure containing necessary structs to load AppImage on different CPUs. More... | |
Functions | |
void | Bootloader_Params_init (Bootloader_Params *params) |
Initialize Bootloader params. More... | |
void | Bootloader_BootImageInfo_init (Bootloader_BootImageInfo *bootImageInfo) |
Initialize BootImage info. More... | |
void | Bootloader_CpuInfo_init (Bootloader_CpuInfo *cpuInfo) |
Initialize CPU info. More... | |
Bootloader_Handle | Bootloader_open (uint32_t instanceNum, Bootloader_Params *openParams) |
Open bootloader driver. More... | |
void | Bootloader_close (Bootloader_Handle handle) |
Close bootloader driver. More... | |
int32_t | Bootloader_runCpu (Bootloader_Handle handle, Bootloader_CpuInfo *cpuInfo) |
API to run a non-self CPU. More... | |
int32_t | Bootloader_runSelfCpu (Bootloader_Handle handle, Bootloader_BootImageInfo *bootImageInfo) |
API to boot self CPU. More... | |
void | Bootloader_JumpSelfCpu (void) |
API to jump self CPU. More... | |
int32_t | Bootloader_bootCpu (Bootloader_Handle handle, Bootloader_CpuInfo *cpuInfo) |
API to boot a non-self CPU. More... | |
int32_t | Bootloader_runSelfCpuWithLinux () |
API to boot self CPU with Linux. More... | |
uint32_t | Bootloader_getMulticoreImageSize (Bootloader_Handle handle) |
API to fetch the size of the multicore image. More... | |
uint32_t | Bootloader_isCorePresent (Bootloader_Handle handle, uint32_t cslCoreId) |
API to check if a particular core's ELF image is present in the multicore image. More... | |
uint32_t | Bootloader_getBootMedia (Bootloader_Handle handle) |
API to get the selected boot media in the bootloader instance. More... | |
void | Bootloader_ReservedMemInit (uint32_t startAddress, uint32_t regionlength) |
API to set the memory region of bootloader. More... | |
void | Bootloader_powerOffCpu (Bootloader_Handle handle, Bootloader_CpuInfo *cpuInfo) |
API to power off a core. More... | |
int32_t | Bootloader_parseAndLoadMultiCoreELF (Bootloader_Handle handle, Bootloader_BootImageInfo *bootImageInfo) |
API to parse and load a multicore ELF image for Flash, eMMC & SD bootmedia. More... | |
int32_t | Bootloader_UartParseAndLoadMultiCoreELF (Bootloader_Handle handle, Bootloader_BootImageInfo *bootImageInfo) |
API to parse and load a multicore ELF image for Uart bootmedia. More... | |
void | Bootloader_openDma () |
API to open DMA channel. More... | |
void | Bootloader_closeDma () |
API to close DMA channel. More... | |
Typedefs | |
typedef void * | Bootloader_Handle |
Handle to the Bootloader driver returned by Bootloader_open() More... | |
Enumerations | |
enum | Bootloader_AppImageLoadStatus { BOOTLOADER_IMAGE_NOT_LOADED, BOOTLOADER_IMAGE_LOADED } |
AppImage load status. More... | |
Macros | |
#define | BOOTLOADER_INVALID_ID ((uint32_t)0xDEADBABE) |
Invalid ID magic number to be used for initializations. More... | |
#define | BOOTLOADER_OPMODE_LOCKSTEP (0U) |
Operating mode type. More... | |
#define | BOOTLOADER_OPMODE_STANDALONE (1U) |
#define | BOOTLOADER_MEDIA_MEM ((uint32_t)0xB0070001) |
Boot media IDs. More... | |
#define | BOOTLOADER_MEDIA_FLASH ((uint32_t)0xB0070002) |
#define | BOOTLOADER_MEDIA_EMMC ((uint32_t)0xB0070003) |
#define | BOOTLOADER_MEDIA_SD ((uint32_t)0xB0070004) |
#define | BOOTLOADER_MEDIA_BUFIO ((uint32_t)0xB0070005) |
#define | BOOTLOADER_MEDIA_UART ((uint32_t)0xB0070006) |
Bootloader driver implementation callbacks | |
typedef int32_t(* | Bootloader_imgOpenFxn) (void *args, Bootloader_Params *params) |
Driver implementation to open a specific bootloader driver - Memory, OSPI, UART, MMCSD etc. More... | |
typedef int32_t(* | Bootloader_imgReadFxn) (void *dstAddr, uint32_t length, void *args) |
Driver implementation to read from boot media using a specific bootloader driver - Memory, OSPI, UART, MMCSD etc. More... | |
typedef uint32_t(* | Bootloader_imgOffsetFxn) (void *args) |
Driver implementation to get the current offset in the boot media. More... | |
typedef void(* | Bootloader_imgSeekFxn) (uint32_t location, void *args) |
Driver implementation to read from boot media using a specific bootloader driver - Memory, OSPI, UART, MMCSD etc. More... | |
typedef void(* | Bootloader_imgCloseFxn) (void *handle, void *args) |
Driver implementation to close a specific bootloader driver - Memory, OSPI, UART, MMCSD etc. More... | |
typedef int32_t(* | Bootloader_imgCustomFxn) (void *args) |
Driver implementation to enable a custom function for a specific bootloader driver - Memory, OSPI, UART, MMCSD etc. More... | |
#define BOOTLOADER_INVALID_ID ((uint32_t)0xDEADBABE) |
Invalid ID magic number to be used for initializations.
#define BOOTLOADER_OPMODE_LOCKSTEP (0U) |
Operating mode type.
#define BOOTLOADER_OPMODE_STANDALONE (1U) |
#define BOOTLOADER_MEDIA_MEM ((uint32_t)0xB0070001) |
Boot media IDs.
#define BOOTLOADER_MEDIA_FLASH ((uint32_t)0xB0070002) |
#define BOOTLOADER_MEDIA_EMMC ((uint32_t)0xB0070003) |
#define BOOTLOADER_MEDIA_SD ((uint32_t)0xB0070004) |
#define BOOTLOADER_MEDIA_BUFIO ((uint32_t)0xB0070005) |
#define BOOTLOADER_MEDIA_UART ((uint32_t)0xB0070006) |
typedef void* Bootloader_Handle |
Handle to the Bootloader driver returned by Bootloader_open()
typedef int32_t(* Bootloader_imgOpenFxn) (void *args, Bootloader_Params *params) |
Driver implementation to open a specific bootloader driver - Memory, OSPI, UART, MMCSD etc.
Typically this callback is hidden from the end application and is implemented when a new boot media needs to be supported.
args | [in] Boot media specific arguments, obtained from the config |
params | [in] User controllable params |
typedef int32_t(* Bootloader_imgReadFxn) (void *dstAddr, uint32_t length, void *args) |
Driver implementation to read from boot media using a specific bootloader driver - Memory, OSPI, UART, MMCSD etc.
Typically this callback is hidden from the end application and is implemented when a new boot media needs to be supported.
dstAddr | [in] Destination address to which the data is to be read into |
length | [in] Length in bytes of the data to be read |
args | [in] Boot media specific arguments, obtained from the config |
typedef uint32_t(* Bootloader_imgOffsetFxn) (void *args) |
Driver implementation to get the current offset in the boot media.
Typically this callback is hidden from the end application and is implemented when a new boot media needs to be supported.
args | [in] Boot media specific arguments, obtained from the config |
typedef void(* Bootloader_imgSeekFxn) (uint32_t location, void *args) |
Driver implementation to read from boot media using a specific bootloader driver - Memory, OSPI, UART, MMCSD etc.
Typically this callback is hidden from the end application and is implemented when a new boot media needs to be supported.
location | [in] Destination address to which read offset need to be moved |
args | [in] Boot media specific arguments, obtained from the config |
typedef void(* Bootloader_imgCloseFxn) (void *handle, void *args) |
Driver implementation to close a specific bootloader driver - Memory, OSPI, UART, MMCSD etc.
Typically this callback is hidden from the end application and is implemented when a new boot media needs to be supported.
handle | [in] Handle returned from Bootloader_imgOpen |
args | [in] Boot media specific arguments, obtained from the config |
typedef int32_t(* Bootloader_imgCustomFxn) (void *args) |
Driver implementation to enable a custom function for a specific bootloader driver - Memory, OSPI, UART, MMCSD etc.
Typically this callback is hidden from the end application and is implemented when a new boot media needs to be supported.
args | [in] Boot media specific arguments, obtained from the config |
void Bootloader_Params_init | ( | Bootloader_Params * | params | ) |
Initialize Bootloader params.
params | [out] Pointer to a Bootloader_Params structure |
void Bootloader_BootImageInfo_init | ( | Bootloader_BootImageInfo * | bootImageInfo | ) |
Initialize BootImage info.
bootImageInfo | [out] Pointer to a Bootloader_BootImageInfo structure |
void Bootloader_CpuInfo_init | ( | Bootloader_CpuInfo * | cpuInfo | ) |
Initialize CPU info.
cpuInfo | [out] Pointer to a Bootloader_CpuInfo structure |
Bootloader_Handle Bootloader_open | ( | uint32_t | instanceNum, |
Bootloader_Params * | openParams | ||
) |
Open bootloader driver.
Make sure the SOC periheral driver is open'ed before calling this API. Drivers_open function generated by SysCfg opens the underlying SOC peripheral driver, e.g OSPI.
Global variables Bootloader_Config gBootloaderConfig[]
and uint32_t gBootloaderConfigNum
is instantiated by SysCfg to describe the boot media and other configuration based on user selection in SysCfg.
instanceNum | [in] Index within Bootloader_Config gBootloaderConfig[] denoting the bootloader driver to open |
openParams | [in] Open parameters |
void Bootloader_close | ( | Bootloader_Handle | handle | ) |
Close bootloader driver.
handle | [in] Bootloader driver handle from Bootloader_open |
int32_t Bootloader_runCpu | ( | Bootloader_Handle | handle, |
Bootloader_CpuInfo * | cpuInfo | ||
) |
API to run a non-self CPU.
This API will run a non-self CPU, i.e a CPU on which the bootloader application is not running. This API is not applicable for cores from self cluster. They will be run by the Bootloader_runSelfCpu API. It is expected that this API be called after Bootloader_parseAndLoadMultiCoreELF API
handle | [in] Bootloader driver handle from Bootloader_open |
cpuInfo | [in] Data structure containing information regarding the CPU. This should have been filled by the Bootloader_parseAndLoadMultiCoreELF API |
int32_t Bootloader_runSelfCpu | ( | Bootloader_Handle | handle, |
Bootloader_BootImageInfo * | bootImageInfo | ||
) |
API to boot self CPU.
This API will boot self CPU, i.e a CPU on which the bootloader application is running.
handle | [in] Bootloader driver handle from Bootloader_open |
bootImageInfo | [in] Data structure of type Bootloader_BootImageInfo containing information regarding self CPU. This should have been filled by the Bootloader_parseAndLoadMultiCoreELF API |
void Bootloader_JumpSelfCpu | ( | void | ) |
API to jump self CPU.
This API will make self CPU jump to another code location, i.e a CPU on which the bootloader application is running. It is expected that this API be called after Bootloader_parseAndLoadMultiCoreELF API
int32_t Bootloader_bootCpu | ( | Bootloader_Handle | handle, |
Bootloader_CpuInfo * | cpuInfo | ||
) |
API to boot a non-self CPU.
This API will boot a non-self CPU, i.e a CPU on which the bootloader application is not running.
handle | [in] Bootloader driver handle from Bootloader_open |
cpuInfo | [in] Data structure containing information regarding the CPU. |
int32_t Bootloader_runSelfCpuWithLinux | ( | ) |
API to boot self CPU with Linux.
This API will boot self CPU, i.e a CPU on which the bootloader application is running. It is expected that this API be called after Bootloader_parseAndLoadMultiCoreELF API. This API does not perform a security handoff
uint32_t Bootloader_getMulticoreImageSize | ( | Bootloader_Handle | handle | ) |
API to fetch the size of the multicore image.
This API simply returns the internal global variable which gets updated everytime a section is loaded. So this API should only be called after all the mcelf loading is complete.
handle | Bootloader driver handle from Bootloader_open |
uint32_t Bootloader_isCorePresent | ( | Bootloader_Handle | handle, |
uint32_t | cslCoreId | ||
) |
API to check if a particular core's ELF image is present in the multicore image.
This API checks the csl core id against an internally maintained bitmap which will be populated after parsing the image. So this API should be called only after the multicore image is parsed.
handle | Bootloader driver handle from Bootloader_open |
cslCoreId | CSL core ID of the interested core |
uint32_t Bootloader_getBootMedia | ( | Bootloader_Handle | handle | ) |
API to get the selected boot media in the bootloader instance.
This API returns the selected boot media. This data will be filled by sysconfig
handle | [in] Bootloader driver handle from Bootloader_open |
void Bootloader_ReservedMemInit | ( | uint32_t | startAddress, |
uint32_t | regionlength | ||
) |
API to set the memory region of bootloader.
This API is used to set the memory region of bootloader.
startAddress | [in] Start address of the memory region for bootloader. |
regionlength | [in] Length of the memory region of bootloader. |
void Bootloader_powerOffCpu | ( | Bootloader_Handle | handle, |
Bootloader_CpuInfo * | cpuInfo | ||
) |
API to power off a core.
handle | Bootloader driver handle from Bootloader_open |
cpuInfo | [in] Data structure containing information regarding the CPU. |
int32_t Bootloader_parseAndLoadMultiCoreELF | ( | Bootloader_Handle | handle, |
Bootloader_BootImageInfo * | bootImageInfo | ||
) |
API to parse and load a multicore ELF image for Flash, eMMC & SD bootmedia.
When the booting is done through boot media like Flash, eMMC & SD, unlike loading via CCS, the application binaries for each core applicable are converted into a file format '.elf' and combined together into a multicore elf(.mcelf) binary. The bootloader needs to read this mcelf file, and load the binaries correctly into memories. This API helps in parsing the multicore elf file and loads the application binaries for each core from the boot media to the SOC memory. It also fills the metadata in the bootImageInfo structure passed.
handle | [in] Bootloader driver handle from Bootloader_open |
bootImageInfo | [in] Data structure of type Bootloader_BootImageInfo which will be filled |
int32_t Bootloader_UartParseAndLoadMultiCoreELF | ( | Bootloader_Handle | handle, |
Bootloader_BootImageInfo * | bootImageInfo | ||
) |
API to parse and load a multicore ELF image for Uart bootmedia.
When the booting is done through boot media like Uart, unlike loading via CCS, the application binaries for each core applicable are converted into a file format '.elf' and combined together into a multicore elf(.mcelf) binary. The bootloader needs to read this mcelf file which is being sent in chunks from host side, and load the segments correctly into memories. This API helps in receiving the multicore elf file meta from host, parsing the multicore elf file meta, requests the program segments from host, receive and loads the segments for each core from the boot media to the SOC memory. It also fills the metadata in the bootImageInfo structure passed.
handle | [in] Bootloader driver handle from Bootloader_open |
bootImageInfo | [in] Data structure of type Bootloader_BootImageInfo which will be filled |
void Bootloader_openDma | ( | ) |
API to open DMA channel.
void Bootloader_closeDma | ( | ) |
API to close DMA channel.