Intel® Quark™ Microcontroller Software Interface
1.4.0
Intel® Quark™ Microcontroller BSP
|
Flash Protection Region control. More...
Data Structures | |
struct | qm_fpr_config_t |
Flash Protection Region configuration structure. More... | |
Enumerations | |
enum | qm_fpr_en_t { QM_FPR_DISABLE, QM_FPR_ENABLE, QM_FPR_LOCK_DISABLE, QM_FPR_LOCK_ENABLE } |
FPR enable type. More... | |
enum | qm_fpr_viol_mode_t { FPR_VIOL_MODE_INTERRUPT = 0, FPR_VIOL_MODE_RESET, FPR_VIOL_MODE_PROBE } |
FPR violation mode type. More... | |
enum | qm_flash_region_type_t { QM_MAIN_FLASH_SYSTEM = 0, QM_MAIN_FLASH_DATA, QM_MAIN_FLASH_NUM } |
FPR region type. More... | |
enum | qm_fpr_read_allow_t { QM_FPR_HOST_PROCESSOR, QM_FPR_SENSOR_SUBSYSTEM, QM_FPR_DMA = BIT(2), QM_FPR_OTHER_AGENTS } |
FPR read allow type. More... | |
Functions | |
int | qm_fpr_set_config (const qm_flash_t flash, const qm_fpr_id_t id, const qm_fpr_config_t *const cfg, const qm_flash_region_type_t region) |
Configure a Flash controller's Flash Protection Region. More... | |
int | qm_fpr_set_violation_policy (const qm_fpr_viol_mode_t mode, const qm_flash_t flash, qm_fpr_callback_t fpr_cb, void *data) |
Configure FPR violation behaviour. More... | |
int | qm_fpr_save_context (const qm_flash_t flash, qm_fpr_context_t *const ctx) |
Save FPR context. More... | |
int | qm_fpr_restore_context (const qm_flash_t flash, const qm_fpr_context_t *const ctx) |
Restore FPR context. More... | |
Flash Protection Region control.
enum qm_fpr_en_t |
enum qm_fpr_read_allow_t |
enum qm_fpr_viol_mode_t |
int qm_fpr_restore_context | ( | const qm_flash_t | flash, |
const qm_fpr_context_t *const | ctx | ||
) |
Restore FPR context.
Restore the configuration of the specified FPR peripheral after exiting sleep. The Flash peripheral linked to the FPR restored needs to be restored as well by calling qm_flash_restore_context().
FPR configuration is lost after sleep and can therefore be modified even if this configuration was locked before sleep. To support persistent configuration, the configuration must be restored when resuming as part of the bootloader.
[in] | flash | Flash index. |
[in] | ctx | FPR context structure. This must not be NULL. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 197 of file qm_fpr.c.
References qm_flash_reg_t::fpr_rd_cfg, and qm_fpr_context_t::fpr_rd_cfg.
int qm_fpr_save_context | ( | const qm_flash_t | flash, |
qm_fpr_context_t *const | ctx | ||
) |
Save FPR context.
Save the configuration of the specified FPR peripheral before entering sleep. The Flash peripheral linked to the FPR saved needs to be saved as well by calling qm_flash_save_context().
FPR configuration is lost after sleep and can therefore be modified even if this configuration was locked before sleep. To support persistent configuration, the configuration must be restored when resuming as part of the bootloader.
[in] | flash | Flash index. |
[out] | ctx | FPR context structure. This must not be NULL. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 182 of file qm_fpr.c.
References qm_flash_reg_t::fpr_rd_cfg, and qm_fpr_context_t::fpr_rd_cfg.
int qm_fpr_set_config | ( | const qm_flash_t | flash, |
const qm_fpr_id_t | id, | ||
const qm_fpr_config_t *const | cfg, | ||
const qm_flash_region_type_t | region | ||
) |
Configure a Flash controller's Flash Protection Region.
[in] | flash | Which Flash controller to configure. |
[in] | id | FPR identifier. |
[in] | cfg | FPR configuration. |
[in] | region | The region of Flash to be configured. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 34 of file qm_fpr.c.
References qm_fpr_config_t::allow_agents, qm_fpr_config_t::en_mask, qm_flash_reg_t::fpr_rd_cfg, qm_fpr_config_t::low_bound, QM_MAIN_FLASH_DATA, QM_MAIN_FLASH_NUM, QM_MAIN_FLASH_SYSTEM, and qm_fpr_config_t::up_bound.
int qm_fpr_set_violation_policy | ( | const qm_fpr_viol_mode_t | mode, |
const qm_flash_t | flash, | ||
qm_fpr_callback_t | fpr_cb, | ||
void * | data | ||
) |
Configure FPR violation behaviour.
[in] | mode | (generate interrupt, warm reset, enter probe mode). |
[in] | flash | controller. |
[in] | fpr_cb | for interrupt mode (only). |
[in] | data | user callback data for interrupt mode (only). |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 70 of file qm_fpr.c.
References FPR_VIOL_MODE_INTERRUPT, and FPR_VIOL_MODE_PROBE.