RTEMS 6.1-rc4
Loading...
Searching...
No Matches
fsl_ssarc.h
1/*
2 * Copyright 2020-2021 NXP
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#ifndef _FSL_SSARC_H_
9#define _FSL_SSARC_H_
10
11#include "fsl_common.h"
12
18/*******************************************************************************
19 * Definitions
20 ******************************************************************************/
21
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)
31
36{
37 kSSARC_AddressErrorFlag = SSARC_LP_INT_STATUS_ADDR_ERR_MASK,
39 kSSARC_AHBErrorFlag = SSARC_LP_INT_STATUS_AHB_ERR_MASK,
41 kSSARC_SoftwareRequestDoneFlag = SSARC_LP_INT_STATUS_SW_REQ_DONE_MASK,
44 kSSARC_TimeoutFlag = SSARC_LP_INT_STATUS_TIMEOUT_MASK,
46 kSSARC_GroupConflictFlag = SSARC_LP_INT_STATUS_GROUP_CONFLICT_MASK,
47};
48
53{
58
63{
65 kSSARC_SaveEnableRestoreDisable = SSARC_HP_SRAM2_SV_EN_MASK,
67 kSSARC_SaveDisableRestoreEnable = SSARC_HP_SRAM2_RT_EN_MASK,
69 kSSARC_SaveEnableRestoreEnable = (SSARC_HP_SRAM2_RT_EN_MASK | SSARC_HP_SRAM2_SV_EN_MASK),
72
77{
81 kSSARC_RMWOr = 0x02U,
82 kSSARC_RMWAnd = 0x03U,
87
92{
96
101{
102 kSSARC_TriggerSaveRequest = SSARC_LP_DESC_CTRL1_SW_TRIG_SV_MASK,
104 kSSARC_TriggerRestoreRequest = SSARC_LP_DESC_CTRL1_SW_TRIG_RT_MASK,
107
112{
113 uint32_t address;
114 uint32_t data;
120
125{
126 ssarc_cpu_domain_name_t cpuDomain;
127 uint32_t startIndex;
128 uint32_t endIndex;
133 uint8_t savePriority;
136 uint32_t highestAddress;
137 uint32_t lowestAddress;
139
140/*******************************************************************************
141 * API
142 ******************************************************************************/
143
144#if defined(__cplusplus)
145extern "C" {
146#endif
147
160static inline uint32_t SSARC_GetDescriptorRegisterAddress(SSARC_HP_Type *base, uint32_t index)
161{
162 assert(index < SSARC_HP_SRAM0_COUNT);
163
164 return (base->DESC[index].SRAM0);
165}
166
174static inline uint32_t SSARC_GetDescriptorRegisterData(SSARC_HP_Type *base, uint32_t index)
175{
176 assert(index < SSARC_HP_SRAM0_COUNT);
177
178 return (base->DESC[index].SRAM1);
179}
180
190
210void SSARC_GroupInit(SSARC_LP_Type *base, uint8_t groupID, const ssarc_group_config_t *config);
211
218static inline void SSARC_GroupDeinit(SSARC_LP_Type *base, uint8_t groupID)
219{
220 assert(groupID < SSARC_LP_DESC_CTRL0_COUNT);
221
222 base->GROUPS[groupID].DESC_CTRL1 &= ~SSARC_LP_DESC_CTRL1_GP_EN_MASK;
223}
224
234static inline void SSARC_LockGroupDomain(SSARC_LP_Type *base, uint8_t groupID)
235{
236 assert(groupID < SSARC_LP_DESC_CTRL0_COUNT);
237
238 base->GROUPS[groupID].DESC_CTRL1 |= SSARC_LP_DESC_CTRL1_DL_MASK;
239}
240
250static inline void SSARC_LockGroupWrite(SSARC_LP_Type *base, uint8_t groupID)
251{
252 assert(groupID < SSARC_LP_DESC_CTRL0_COUNT);
253
254 base->GROUPS[groupID].DESC_CTRL1 |= SSARC_LP_DESC_CTRL1_WL_MASK;
255}
256
266static inline void SSARC_LockGroupRead(SSARC_LP_Type *base, uint8_t groupID)
267{
268 assert(groupID < SSARC_LP_DESC_CTRL0_COUNT);
269
270 base->GROUPS[groupID].DESC_CTRL1 |= SSARC_LP_DESC_CTRL1_RL_MASK;
271}
272
284
300static inline void SSARC_ResetWholeBlock(SSARC_LP_Type *base)
301{
302 base->CTRL |= SSARC_LP_CTRL_SW_RESET_MASK;
303 base->CTRL &= ~SSARC_LP_CTRL_SW_RESET_MASK;
304}
305
314static inline void SSARC_EnableHardwareRequest(SSARC_LP_Type *base, bool enable)
315{
316 if (enable)
317 {
318 base->CTRL &= ~SSARC_LP_CTRL_DIS_HW_REQ_MASK;
319 }
320 else
321 {
322 base->CTRL |= SSARC_LP_CTRL_DIS_HW_REQ_MASK;
323 }
324}
325
341static inline uint32_t SSARC_GetStatusFlags(SSARC_LP_Type *base)
342{
343 return ((base->INT_STATUS) & SSARC_INT_STATUS_ALL);
344}
345
356static inline void SSARC_ClearStatusFlags(SSARC_LP_Type *base, uint32_t mask)
357{
358 base->INT_STATUS = mask;
359}
360
367static inline uint32_t SSARC_GetErrorIndex(SSARC_LP_Type *base)
368{
369 return (base->INT_STATUS & SSARC_LP_INT_STATUS_ERR_INDEX_MASK);
370}
371
390static inline void SSARC_SetTimeoutValue(SSARC_LP_Type *base, uint32_t value)
391{
392 base->HP_TIMEOUT = value;
393}
394
401static inline uint32_t SSARC_GetTimeoutValue(SSARC_LP_Type *base)
402{
403 return base->HP_TIMEOUT;
404}
405
420static inline uint16_t SSARC_GetHardwareRequestRestorePendingGroup(SSARC_LP_Type *base)
421{
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);
424}
425
432static inline uint16_t SSARC_GetHardwareRequestSavePendingGroup(SSARC_LP_Type *base)
433{
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);
436}
437
444static inline uint16_t SSARC_GetSoftwareRequestRestorePendingGroup(SSARC_LP_Type *base)
445{
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);
448}
449
456static inline uint16_t SSARC_GetSoftwareRequestSavePendingGroup(SSARC_LP_Type *base)
457{
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);
460}
461
466#if defined(__cplusplus)
467}
468#endif
469
474#endif /* _FSL_SSARC_H_ */
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