11#include "fsl_common.h"
25#define FSL_SSARC_DRIVER_VERSION (MAKE_VERSION(2, 1, 0))
28#define SSARC_INT_STATUS_ALL \
29 (SSARC_LP_INT_STATUS_ADDR_ERR_MASK | SSARC_LP_INT_STATUS_AHB_ERR_MASK | SSARC_LP_INT_STATUS_SW_REQ_DONE_MASK | \
30 SSARC_LP_INT_STATUS_TIMEOUT_MASK | SSARC_LP_INT_STATUS_GROUP_CONFLICT_MASK)
144#if defined(__cplusplus)
160static inline uint32_t SSARC_GetDescriptorRegisterAddress(
SSARC_HP_Type *base, uint32_t index)
162 assert(index < SSARC_HP_SRAM0_COUNT);
164 return (base->DESC[index].SRAM0);
174static inline uint32_t SSARC_GetDescriptorRegisterData(
SSARC_HP_Type *base, uint32_t index)
176 assert(index < SSARC_HP_SRAM0_COUNT);
178 return (base->DESC[index].SRAM1);
218static inline void SSARC_GroupDeinit(
SSARC_LP_Type *base, uint8_t groupID)
220 assert(groupID < SSARC_LP_DESC_CTRL0_COUNT);
222 base->GROUPS[groupID].DESC_CTRL1 &= ~SSARC_LP_DESC_CTRL1_GP_EN_MASK;
234static inline void SSARC_LockGroupDomain(
SSARC_LP_Type *base, uint8_t groupID)
236 assert(groupID < SSARC_LP_DESC_CTRL0_COUNT);
238 base->GROUPS[groupID].DESC_CTRL1 |= SSARC_LP_DESC_CTRL1_DL_MASK;
250static inline void SSARC_LockGroupWrite(
SSARC_LP_Type *base, uint8_t groupID)
252 assert(groupID < SSARC_LP_DESC_CTRL0_COUNT);
254 base->GROUPS[groupID].DESC_CTRL1 |= SSARC_LP_DESC_CTRL1_WL_MASK;
266static inline void SSARC_LockGroupRead(
SSARC_LP_Type *base, uint8_t groupID)
268 assert(groupID < SSARC_LP_DESC_CTRL0_COUNT);
270 base->GROUPS[groupID].DESC_CTRL1 |= SSARC_LP_DESC_CTRL1_RL_MASK;
302 base->CTRL |= SSARC_LP_CTRL_SW_RESET_MASK;
303 base->CTRL &= ~SSARC_LP_CTRL_SW_RESET_MASK;
314static inline void SSARC_EnableHardwareRequest(
SSARC_LP_Type *base,
bool enable)
318 base->CTRL &= ~SSARC_LP_CTRL_DIS_HW_REQ_MASK;
322 base->CTRL |= SSARC_LP_CTRL_DIS_HW_REQ_MASK;
341static inline uint32_t SSARC_GetStatusFlags(
SSARC_LP_Type *base)
343 return ((base->INT_STATUS) & SSARC_INT_STATUS_ALL);
356static inline void SSARC_ClearStatusFlags(
SSARC_LP_Type *base, uint32_t mask)
358 base->INT_STATUS = mask;
367static inline uint32_t SSARC_GetErrorIndex(
SSARC_LP_Type *base)
369 return (base->INT_STATUS & SSARC_LP_INT_STATUS_ERR_INDEX_MASK);
390static inline void SSARC_SetTimeoutValue(
SSARC_LP_Type *base, uint32_t value)
392 base->HP_TIMEOUT = value;
401static inline uint32_t SSARC_GetTimeoutValue(
SSARC_LP_Type *base)
403 return base->HP_TIMEOUT;
420static inline uint16_t SSARC_GetHardwareRequestRestorePendingGroup(
SSARC_LP_Type *base)
422 return (uint16_t)(((base->HW_GROUP_PENDING) & SSARC_LP_HW_GROUP_PENDING_HW_RESTORE_PENDING_MASK) >>
423 SSARC_LP_HW_GROUP_PENDING_HW_RESTORE_PENDING_SHIFT);
432static inline uint16_t SSARC_GetHardwareRequestSavePendingGroup(
SSARC_LP_Type *base)
434 return (uint16_t)(((base->HW_GROUP_PENDING) & SSARC_LP_HW_GROUP_PENDING_HW_SAVE_PENDING_MASK) >>
435 SSARC_LP_HW_GROUP_PENDING_HW_SAVE_PENDING_SHIFT);
444static inline uint16_t SSARC_GetSoftwareRequestRestorePendingGroup(
SSARC_LP_Type *base)
446 return (uint16_t)(((base->SW_GROUP_PENDING) & SSARC_LP_SW_GROUP_PENDING_SW_RESTORE_PENDING_MASK) >>
447 SSARC_LP_SW_GROUP_PENDING_SW_RESTORE_PENDING_SHIFT);
456static inline uint16_t SSARC_GetSoftwareRequestSavePendingGroup(
SSARC_LP_Type *base)
458 return (uint16_t)(((base->SW_GROUP_PENDING) & SSARC_LP_SW_GROUP_PENDING_SW_SAVE_PENDING_MASK) >>
459 SSARC_LP_SW_GROUP_PENDING_SW_SAVE_PENDING_SHIFT);
466#if defined(__cplusplus)
enum _ssarc_power_domain_name ssarc_power_domain_name_t
Structure for the SSARC mapping.
enum _ssarc_descriptor_register_size ssarc_descriptor_register_size_t
The size of the register to be saved/restored.
enum _ssarc_software_trigger_mode ssarc_software_trigger_mode_t
Software trigger mode.
_ssarc_software_trigger_mode
Software trigger mode.
Definition: fsl_ssarc.h:101
enum _ssarc_descriptor_operation ssarc_descriptor_operation_t
The operation of the descriptor.
void SSARC_TriggerSoftwareRequest(SSARC_LP_Type *base, uint8_t groupID, ssarc_software_trigger_mode_t mode)
Triggers software request.
Definition: fsl_ssarc.c:170
_ssarc_descriptor_register_size
The size of the register to be saved/restored.
Definition: fsl_ssarc.h:53
struct _ssarc_group_config ssarc_group_config_t
The configuration of the group.
_ssarc_interrupt_status_flags
The enumeration of ssarc status flags.
Definition: fsl_ssarc.h:36
struct _ssarc_descriptor_config ssarc_descriptor_config_t
The configuration of descriptor.
void SSARC_GroupInit(SSARC_LP_Type *base, uint8_t groupID, const ssarc_group_config_t *config)
Inits the selected group.
Definition: fsl_ssarc.c:136
_ssarc_descriptor_type
The type of operation.
Definition: fsl_ssarc.h:77
enum _ssarc_descriptor_type ssarc_descriptor_type_t
The type of operation.
enum _ssarc_save_restore_order ssarc_save_restore_order_t
The order of the restore/save operation.
_ssarc_save_restore_order
The order of the restore/save operation.
Definition: fsl_ssarc.h:92
_ssarc_descriptor_operation
The operation of the descriptor.
Definition: fsl_ssarc.h:63
void SSARC_SetDescriptorConfig(SSARC_HP_Type *base, uint32_t index, const ssarc_descriptor_config_t *config)
Sets the configuration of the descriptor.
Definition: fsl_ssarc.c:102
@ kSSARC_TriggerRestoreRequest
Definition: fsl_ssarc.h:104
@ kSSARC_TriggerSaveRequest
Definition: fsl_ssarc.h:102
@ kSSARC_DescriptorRegister32bitWidth
Definition: fsl_ssarc.h:56
@ kSSARC_DescriptorRegister8bitWidth
Definition: fsl_ssarc.h:54
@ kSSARC_DescriptorRegister16bitWidth
Definition: fsl_ssarc.h:55
@ kSSARC_TimeoutFlag
Definition: fsl_ssarc.h:44
@ kSSARC_SoftwareRequestDoneFlag
Definition: fsl_ssarc.h:41
@ kSSARC_AHBErrorFlag
Definition: fsl_ssarc.h:39
@ kSSARC_AddressErrorFlag
Definition: fsl_ssarc.h:37
@ kSSARC_GroupConflictFlag
Definition: fsl_ssarc.h:46
@ kSSARC_ReadValueWriteBack
Definition: fsl_ssarc.h:78
@ kSSARC_Polling0
Definition: fsl_ssarc.h:84
@ kSSARC_RMWAnd
Definition: fsl_ssarc.h:82
@ kSSARC_Polling1
Definition: fsl_ssarc.h:85
@ kSSARC_RMWOr
Definition: fsl_ssarc.h:81
@ kSSARC_DelayCycles
Definition: fsl_ssarc.h:83
@ kSSARC_WriteFixedValue
Definition: fsl_ssarc.h:80
@ kSSARC_ProcessFromStartToEnd
Definition: fsl_ssarc.h:93
@ kSSARC_ProcessFromEndToStart
Definition: fsl_ssarc.h:94
@ kSSARC_SaveEnableRestoreEnable
Definition: fsl_ssarc.h:69
@ kSSARC_SaveDisableRestoreEnable
Definition: fsl_ssarc.h:67
@ kSSARC_SaveDisableRestoreDisable
Definition: fsl_ssarc.h:64
@ kSSARC_SaveEnableRestoreDisable
Definition: fsl_ssarc.h:65
Definition: MIMXRT1166_cm4.h:81233
Definition: MIMXRT1166_cm4.h:81355
The configuration of descriptor.
Definition: fsl_ssarc.h:112
ssarc_descriptor_register_size_t size
Definition: fsl_ssarc.h:116
ssarc_descriptor_operation_t operation
Definition: fsl_ssarc.h:117
ssarc_descriptor_type_t type
Definition: fsl_ssarc.h:118
uint32_t data
Definition: fsl_ssarc.h:114
uint32_t address
Definition: fsl_ssarc.h:113
The configuration of the group.
Definition: fsl_ssarc.h:125
ssarc_power_domain_name_t powerDomain
Definition: fsl_ssarc.h:135
ssarc_save_restore_order_t saveOrder
Definition: fsl_ssarc.h:130
uint32_t highestAddress
Definition: fsl_ssarc.h:136
uint32_t startIndex
Definition: fsl_ssarc.h:127
uint32_t lowestAddress
Definition: fsl_ssarc.h:137
ssarc_save_restore_order_t restoreOrder
Definition: fsl_ssarc.h:129
ssarc_cpu_domain_name_t cpuDomain
Definition: fsl_ssarc.h:126
uint8_t restorePriority
Definition: fsl_ssarc.h:131
uint32_t endIndex
Definition: fsl_ssarc.h:128
uint8_t savePriority
Definition: fsl_ssarc.h:133
Definition: deflate.c:114