ROM APIs. More...
Data Structures | |
| union | api_boot_arg_t |
| Enter Bootloader API argument. More... | |
| struct | exip_region_param_t |
| struct | exip_region_context_t |
| struct | otp_driver_interface_t |
| OTP driver interface. More... | |
| struct | xpi_ram_driver_interface_t |
| XPI RAM driver interface. More... | |
| struct | exip_driver_interface_t |
| EXIP driver interface. More... | |
| struct | bootloader_api_table_t |
| Bootloader API table. More... | |
Macros | |
| #define | HPM_XPI0_BASE (0xF3000000UL) |
| #define | HPM_XPI0 ((XPI_Type *) HPM_XPI0_BASE) |
| #define | API_BOOT_TAG (0xEBU) |
| #define | API_BOOT_SRC_OTP (0U) |
| #define | API_BOOT_SRC_PRIMARY (1U) |
| #define | API_BOOT_SRC_SERIAL_BOOT (2U) |
| #define | API_BOOT_SRC_ISP (3U) |
| #define | API_BOOT_PERIPH_AUTO (0U) |
| #define | API_BOOT_PERIPH_UART (1U) |
| #define | API_BOOT_PERIPH_USBHID (2U) |
| #define | ROM_API_TABLE_ROOT ((const bootloader_api_table_t *)0x2001FF00U) |
Functions | |
| static hpm_stat_t | rom_enter_bootloader (void *ctx) |
| Eneter specified Boot mode. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_get_config (XPI_Type *base, xpi_nor_config_t *nor_cfg, xpi_nor_config_option_t *cfg_option) |
| Get XPI NOR configuration via cfg_option. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_init (XPI_Type *base, xpi_nor_config_t *nor_config) |
| Initialize XPI NOR based on nor_config. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_erase (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t start, uint32_t length) |
| Erase specified FLASH region. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_erase_sector (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t start) |
| Erase specified FLASH sector in blocking way. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_erase_sector_nonblocking (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t start) |
| Erase specified FLASH sector in non-blocking way. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_erase_block (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t start) |
| Erase specified FLASH blcok in blocking way. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_erase_block_nonblocking (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t start) |
| Erase specified FLASH blcok in non-blocking way. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_erase_chip (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config) |
| Erase the whole FLASH in blocking way. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_erase_chip_nonblocking (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config) |
| Erase the whole FLASH in non-blocking way. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_program (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, const uint32_t *src, uint32_t dst_addr, uint32_t length) |
| Program data to specified FLASH address in blocking way. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_page_program_nonblocking (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, const uint32_t *src, uint32_t dst_addr, uint32_t length) |
| Page-Program data to specified FLASH address in non-blocking way. More... | |
| static hpm_stat_t | rom_xpi_nor_read (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t *dst, uint32_t start, uint32_t length) |
| Read data from specified FLASH address. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_auto_config (XPI_Type *base, xpi_nor_config_t *config, xpi_nor_config_option_t *cfg_option) |
| Automatically configure XPI NOR based on cfg_option. More... | |
| static hpm_stat_t | rom_xpi_nor_get_property (XPI_Type *base, xpi_nor_config_t *nor_cfg, uint32_t property_id, uint32_t *value) |
| Get XPI NOR properties. More... | |
| static hpm_stat_t | rom_xpi_nor_get_status (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t addr, uint16_t *out_status) |
| Return the status register value on XPI NOR FLASH. More... | |
| static void | rom_xpi_nor_power_on_sip_flash (XPI_Type *base) |
| Power on the SIP FLASH. More... | |
| static void | rom_xpi_nor_power_off_sip_flash (XPI_Type *base) |
| Power off the SIP FLASH. More... | |
| static void | rom_xpi_nor_enable_hybrid_mode (XPI_Type *base) |
| Enable Hybrid XPI mode. More... | |
| static void | rom_xpi_nor_disable_hybrid_mode (XPI_Type *base) |
| Disable Hybrid XPI mode. More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_post_erase_sector_nonblocking (XPI_Type *base, xpi_xfer_channel_t chn, xpi_nor_config_t *nor_cfg, uint32_t addr) |
| Post Erase Sector Nonblocking API (required only if Hybrid XPI mode is used) More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_post_erase_block_nonblocking (XPI_Type *base, xpi_xfer_channel_t chn, xpi_nor_config_t *nor_cfg, uint32_t addr) |
| Post Erase Block Nonblocking API (required only if Hybrid XPI mode is used) More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_post_erase_chip_nonblocking (XPI_Type *base, xpi_xfer_channel_t chn, xpi_nor_config_t *nor_cfg) |
| Post Erase Chip Nonblocking API (required only if Hybrid XPI mode is used) More... | |
| static ATTR_RAMFUNC hpm_stat_t | rom_xpi_nor_post_program_nonblocking (XPI_Type *base, xpi_xfer_channel_t chn, xpi_nor_config_t *nor_cfg, const uint32_t *src, uint32_t dst_addr, uint32_t length) |
| Post Page Program Nonblocking API (required only if Hybrid XPI mode is used) More... | |
| static ATTR_RAMFUNC bool | rom_xpi_nor_remap_config (XPI_Type *base, uint32_t start, uint32_t len, uint32_t offset) |
| Configure the XPI Address Remapping Logic. More... | |
| static ATTR_RAMFUNC void | rom_xpi_nor_remap_disable (XPI_Type *base) |
| Disable XPI Remapping logic. More... | |
| static ATTR_RAMFUNC bool | rom_xpi_nor_is_remap_enabled (XPI_Type *base) |
| Check whether XPI Remapping is enabled. More... | |
| static ATTR_RAMFUNC bool | rom_xpi_nor_exip_region_config (XPI_Type *base, uint32_t index, exip_region_param_t *param) |
| Configure Specified EXiP Region. More... | |
| static ATTR_RAMFUNC void | rom_xpi_nor_exip_region_disable (XPI_Type *base, uint32_t index) |
| Disable EXiP Feature on specified EXiP Region. More... | |
| static ATTR_RAMFUNC void | rom_xpi_nor_exip_enable (XPI_Type *base) |
| Enable global EXiP logic. More... | |
| static ATTR_RAMFUNC void | rom_xpi_nor_exip_disable (XPI_Type *base) |
| Disable global EXiP logic. More... | |
| static hpm_stat_t | rom_xpi_ram_get_config (XPI_Type *base, xpi_ram_config_t *ram_cfg, xpi_ram_config_option_t *cfg_option) |
| Get XPI RAM configuration based on cfg_option. More... | |
| static hpm_stat_t | rom_xpi_ram_init (XPI_Type *base, xpi_ram_config_t *ram_cfg) |
| Initialize XPI RAM. More... | |
ROM APIs.
| #define API_BOOT_PERIPH_AUTO (0U) |
Boot peripheral: Auto detected
| #define API_BOOT_PERIPH_UART (1U) |
Boot peripheral: UART
| #define API_BOOT_PERIPH_USBHID (2U) |
Boot Peripheral: USB-HID
| #define API_BOOT_SRC_ISP (3U) |
Boot source: ISP
| #define API_BOOT_SRC_OTP (0U) |
Boot source: OTP
| #define API_BOOT_SRC_PRIMARY (1U) |
Boot source: Primary
| #define API_BOOT_SRC_SERIAL_BOOT (2U) |
Boot source: Serial Boot
| #define API_BOOT_TAG (0xEBU) |
ROM API parameter tag
| #define HPM_XPI0 ((XPI_Type *) HPM_XPI0_BASE) |
XPI0 Base pointer
| #define HPM_XPI0_BASE (0xF3000000UL) |
XPI0 Base address
| #define ROM_API_TABLE_ROOT ((const bootloader_api_table_t *)0x2001FF00U) |
|
inlinestatic |
Eneter specified Boot mode.
| [in] | ctx | Enter bootloader context |
| status_invalid | Invalid parameters were detected |
|
inlinestatic |
Automatically configure XPI NOR based on cfg_option.
| [in] | base | XPI base address |
| [out] | config | XPI NOR configuration structure |
| [in] | cfg_option | XPI NOR configuration option |
|
inlinestatic |
Disable Hybrid XPI mode.
| [in] | base | XPI base address |
|
inlinestatic |
Enable Hybrid XPI mode.
| [in] | base | XPI base address |
|
inlinestatic |
Erase specified FLASH region.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI nOR configuration |
| [in] | start | Erase address start address |
| [in] | length | Region size to be erased |
|
inlinestatic |
Erase specified FLASH blcok in blocking way.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI NOR configuration |
| [in] | start | Block address |
|
inlinestatic |
Erase specified FLASH blcok in non-blocking way.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI NOR configuration |
| [in] | start | Block address |
|
inlinestatic |
Erase the whole FLASH in blocking way.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI NOR configuration |
|
inlinestatic |
Erase the whole FLASH in non-blocking way.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI NOR configuration |
|
inlinestatic |
Erase specified FLASH sector in blocking way.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI NOR configuration |
| [in] | start | Sector address |
|
inlinestatic |
Erase specified FLASH sector in non-blocking way.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI NOR configuration |
| [in] | start | Sector address |
|
inlinestatic |
Disable global EXiP logic.
| [in] | base | XPI base address |
|
inlinestatic |
Enable global EXiP logic.
| [in] | base | XPI base address |
|
inlinestatic |
Configure Specified EXiP Region.
| [in] | base | XPI base address |
| [in] | index | EXiP Region index |
| [in] | param | ExiP Region Parameter |
| true | All parameters are valid |
| false | Any parameter is invalid |
|
inlinestatic |
Disable EXiP Feature on specified EXiP Region.
| [in] | base | XPI base address |
| [in] | index | EXiP Region index |
|
inlinestatic |
Get XPI NOR configuration via cfg_option.
| [in] | base | XPI base address |
| [out] | nor_cfg | XPI NOR configuration structure |
| [in] | cfg_option | XPI NOR configuration option |
|
inlinestatic |
Get XPI NOR properties.
| [in] | base | XPI base address |
| [in] | nor_cfg | XPI NOR configuration structure |
| [in] | property_id | |
| [out] | value | property value retrieved by this API |
|
inlinestatic |
Return the status register value on XPI NOR FLASH.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI NOR configuration |
| [in] | addr | FLASH address offset |
| [out] | out_status | FLASH status register value |
|
inlinestatic |
Initialize XPI NOR based on nor_config.
| [in] | base | XPI base address |
| [in] | nor_config | XPI NOR configuration |
|
inlinestatic |
Check whether XPI Remapping is enabled.
| [in] | base | XPI base address |
| true | Remapping logic is enabled |
| false | Remapping logic is disabled |
|
inlinestatic |
Page-Program data to specified FLASH address in non-blocking way.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI NOR configuration |
| [in] | src | data source address |
| [in] | dst_addr | Destination FLASH address |
| [in] | length | length of data to be programmed |
|
inlinestatic |
Post Erase Block Nonblocking API (required only if Hybrid XPI mode is used)
| [in] | base | XPI base address |
| [in] | chn | XPI channel |
| [in] | nor_cfg | XPI NOR configuration context |
| [in] | addr | Sector address |
|
inlinestatic |
Post Erase Chip Nonblocking API (required only if Hybrid XPI mode is used)
| [in] | base | XPI base address |
| [in] | chn | XPI channel |
| [in] | nor_cfg | XPI NOR configuration context |
|
inlinestatic |
Post Erase Sector Nonblocking API (required only if Hybrid XPI mode is used)
| [in] | base | XPI base address |
| [in] | chn | XPI channel |
| [in] | nor_cfg | XPI NOR configuration context |
| [in] | addr | Sector address |
|
inlinestatic |
Post Page Program Nonblocking API (required only if Hybrid XPI mode is used)
| [in] | base | XPI base address |
| [in] | chn | XPI channel |
| [in] | nor_cfg | XPI NOR configuration context |
| [in] | src | Data source pointer |
| [in] | dst_addr | Destination address |
| [in] | length | Size of bytes to be written |
|
inlinestatic |
Power off the SIP FLASH.
| [in] | base | XPI base address |
|
inlinestatic |
Power on the SIP FLASH.
| [in] | base | XPI base address |
|
inlinestatic |
Program data to specified FLASH address in blocking way.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI NOR configuration |
| [in] | src | data source address |
| [in] | dst_addr | Destination FLASH address |
| [in] | length | length of data to be programmed |
|
inlinestatic |
Read data from specified FLASH address.
| [in] | base | XPI base address |
| [in] | channel | XPI transfer channel |
| [in] | nor_config | XPI NOR configuration |
| [in] | dst | Memory start address to store the data read out from FLASH |
| [in] | start | FLASH address for data read |
| [in] | length | length of data to be read out |
|
inlinestatic |
Configure the XPI Address Remapping Logic.
| [in] | base | XPI base address |
| [in] | start | Start Address (memory mapped address) |
| [in] | len | Size for the remapping region |
| [in] | offset | Relative address based on parameter "start" |
| true | is all parameters are valid |
| false | if any parameter is invalid |
|
inlinestatic |
Disable XPI Remapping logic.
| [in] | base | XPI base address |
|
inlinestatic |
Get XPI RAM configuration based on cfg_option.
| [in] | base | XPI base address |
| [out] | ram_cfg | XPI RAM configuration structure |
| [in] | cfg_option | XPI RAM configuration option |
|
inlinestatic |
Initialize XPI RAM.
| [in] | base | XPI base address |
| [in] | ram_cfg | XPI ram configuration |