RTEMS 6.1-rc4
Loading...
Searching...
No Matches
fsl_bee.h
1/*
2 * Copyright 2017, 2019 NXP
3 * All rights reserved.
4 *
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8
9#ifndef _FSL_BEE_H_
10#define _FSL_BEE_H_
11
12#include "fsl_common.h"
13
19/*******************************************************************************
20 * Definitions
21 *******************************************************************************/
22
50#define FSL_BEE_DRIVER_VERSION (MAKE_VERSION(2, 0, 2))
54typedef enum _bee_aes_mode
55{
57 kBEE_AesCtrMode = 1U
59
61typedef enum _bee_region
62{
64 kBEE_Region1 = 1U
66
69{
73
76{
80
83{
89
92{
99 kBEE_IdleFlag = BEE_STATUS_BEE_IDLE_MASK
101
103typedef struct _bee_region_config
104{
111 uint32_t region1Bot;
112 uint32_t region1Top;
116
117/*******************************************************************************
118 * API
119 ******************************************************************************/
120#if defined(__cplusplus)
121extern "C" {
122#endif
123
131void BEE_Init(BEE_Type *base);
132
141void BEE_Deinit(BEE_Type *base);
142
150static inline void BEE_Enable(BEE_Type *base)
151{
152 base->CTRL |= BEE_CTRL_BEE_ENABLE_MASK;
153}
154
162static inline void BEE_Disable(BEE_Type *base)
163{
164 base->CTRL &= ~BEE_CTRL_BEE_ENABLE_MASK;
165}
166
187
197
212status_t BEE_SetRegionKey(BEE_Type *base, bee_region_t region, const uint8_t *key, size_t keySize);
213
225status_t BEE_SetRegionNonce(BEE_Type *base, bee_region_t region, const uint8_t *nonce, size_t nonceSize);
226
237uint32_t BEE_GetStatusFlags(BEE_Type *base);
238
246void BEE_ClearStatusFlags(BEE_Type *base, uint32_t mask);
247
248#if defined(__cplusplus)
249}
250#endif
251
254#endif /* _FSL_BEE_H_ */
_bee_status_flags
BEE status flags.
Definition: fsl_bee.h:92
void BEE_ClearStatusFlags(BEE_Type *base, uint32_t mask)
Clears the BEE status flags.
Definition: fsl_bee.c:299
_bee_ac_prot_enable
BEE ac prot enable.
Definition: fsl_bee.h:69
_bee_endian_swap_enable
BEE endian swap enable.
Definition: fsl_bee.h:76
bee_security_level region0SecLevel
Definition: fsl_bee.h:109
bee_security_level region1SecLevel
Definition: fsl_bee.h:110
enum _bee_security_level bee_security_level
BEE security level.
bee_endian_swap_enable endianSwapEn
Definition: fsl_bee.h:114
void BEE_Init(BEE_Type *base)
Resets BEE module to factory default values.
Definition: fsl_bee.c:49
_bee_security_level
BEE security level.
Definition: fsl_bee.h:83
bee_aes_mode_t region1Mode
Definition: fsl_bee.h:106
uint32_t BEE_GetStatusFlags(BEE_Type *base)
Gets the BEE status flags.
Definition: fsl_bee.c:287
void BEE_Deinit(BEE_Type *base)
Resets BEE module, clears keys for both regions and disables clock to the BEE.
Definition: fsl_bee.c:66
bee_aes_mode_t region0Mode
Definition: fsl_bee.h:105
enum _bee_aes_mode bee_aes_mode_t
BEE aes mode.
_bee_region
BEE region.
Definition: fsl_bee.h:62
uint32_t region0AddrOffset
Definition: fsl_bee.h:107
enum _bee_status_flags bee_status_flags_t
BEE status flags.
void BEE_SetConfig(BEE_Type *base, const bee_region_config_t *config)
Sets BEE configuration.
Definition: fsl_bee.c:122
enum _bee_ac_prot_enable bee_ac_prot_enable
BEE ac prot enable.
_bee_aes_mode
BEE aes mode.
Definition: fsl_bee.h:55
status_t BEE_SetRegionNonce(BEE_Type *base, bee_region_t region, const uint8_t *nonce, size_t nonceSize)
Loads the nonce for selected region into BEE nonce registers.
Definition: fsl_bee.c:245
enum _bee_region bee_region_t
BEE region.
uint32_t region1AddrOffset
Definition: fsl_bee.h:108
bee_ac_prot_enable accessPermission
Definition: fsl_bee.h:113
status_t BEE_SetRegionKey(BEE_Type *base, bee_region_t region, const uint8_t *key, size_t keySize)
Loads the AES key for selected region into BEE key registers.
Definition: fsl_bee.c:175
enum _bee_endian_swap_enable bee_endian_swap_enable
BEE endian swap enable.
uint32_t region1Top
Definition: fsl_bee.h:112
uint32_t region1Bot
Definition: fsl_bee.h:111
void BEE_GetDefaultConfig(bee_region_config_t *config)
Loads default values to the BEE region configuration structure.
Definition: fsl_bee.c:95
struct _bee_region_config bee_region_config_t
BEE region configuration structure.
@ kBEE_Reg0ReadSecViolation
Definition: fsl_bee.h:94
@ kBEE_Reg1AccessViolation
Definition: fsl_bee.h:98
@ kBEE_ReadIllegalAccess
Definition: fsl_bee.h:95
@ kBEE_IdleFlag
Definition: fsl_bee.h:99
@ kBEE_DisableAbortFlag
Definition: fsl_bee.h:93
@ kBEE_Reg1ReadSecViolation
Definition: fsl_bee.h:96
@ kBEE_Reg0AccessViolation
Definition: fsl_bee.h:97
@ kBEE_AccessProtEnabled
Definition: fsl_bee.h:71
@ kBEE_AccessProtDisabled
Definition: fsl_bee.h:70
@ kBEE_EndianSwapDisabled
Definition: fsl_bee.h:77
@ kBEE_EndianSwapEnabled
Definition: fsl_bee.h:78
@ kBEE_SecurityLevel1
Definition: fsl_bee.h:85
@ kBEE_SecurityLevel0
Definition: fsl_bee.h:84
@ kBEE_SecurityLevel3
Definition: fsl_bee.h:87
@ kBEE_SecurityLevel2
Definition: fsl_bee.h:86
@ kBEE_Region1
Definition: fsl_bee.h:64
@ kBEE_Region0
Definition: fsl_bee.h:63
@ kBEE_AesCtrMode
Definition: fsl_bee.h:57
@ kBEE_AesEcbMode
Definition: fsl_bee.h:56
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
Definition: MIMXRT1052.h:3775
BEE region configuration structure.
Definition: fsl_bee.h:104
Definition: deflate.c:114