RTEMS: bsps/arm/atsam/include/libchip/include/icm.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
icm.h
1/* ---------------------------------------------------------------------------- */
2/* Atmel Microcontroller Software Support */
3/* SAM Software Package License */
4/* ---------------------------------------------------------------------------- */
5/* Copyright (c) 2015, Atmel Corporation */
6/* */
7/* All rights reserved. */
8/* */
9/* Redistribution and use in source and binary forms, with or without */
10/* modification, are permitted provided that the following condition is met: */
11/* */
12/* - Redistributions of source code must retain the above copyright notice, */
13/* this list of conditions and the disclaimer below. */
14/* */
15/* Atmel's name may not be used to endorse or promote products derived from */
16/* this software without specific prior written permission. */
17/* */
18/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
19/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
21/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
22/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
24/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
25/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
26/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
28/* ---------------------------------------------------------------------------- */
29
30#ifndef _ICM_
31#define _ICM_
32
33/*------------------------------------------------------------------------------
34 * Headers
35 *------------------------------------------------------------------------------*/
36
37#include "chip.h"
38
39
40/*------------------------------------------------------------------------------*/
41/* Definition */
42/*------------------------------------------------------------------------------*/
43#define ICM_RCFG_CDWBN (0x1u << 0)
45#define ICM_RCFG_WRAP (0x1u << 1)
47#define ICM_RCFG_EOM (0x1u << 2)
49#define ICM_RCFG_RHIEN (0x1u << 4)
51#define ICM_RCFG_DMIEN (0x1u << 5)
53#define ICM_RCFG_BEIEN (0x1u << 6)
55#define ICM_RCFG_WCIEN (0x1u << 7)
57#define ICM_RCFG_ECIEN (0x1u << 8)
59#define ICM_RCFG_SUIEN (0x1u << 9)
61#define ICM_RCFG_PROCDLY (0x1u << 10)
63#define ICM_RCFG_UALGO_Pos 12
64#define ICM_RCFG_UALGO_Msk (0x7u << ICM_RCFG_UALGO_Pos)
66#define ICM_RCFG_ALGO_SHA1 (0x0u << 12)
68#define ICM_RCFG_ALGO_SHA256 (0x1u << 12)
70#define ICM_RCFG_ALGO_SHA224 (0x4u << 12)
72#define ICM_RCFG_MRPROT_Pos 24
73#define ICM_RCFG_MRPROT_Msk (0x3fu << ICM_RCFG_MRPROT_Pos)
75#define ICM_RCFG_MRPROT(value) \
76 ((ICM_RCFG_MRPROT_Msk & ((value) << ICM_RCFG_MRPROT_Pos)))
77
78/*----------------------------------------------------------------------------*/
79/* Type */
80/*----------------------------------------------------------------------------*/
81
83 typedef struct _LinkedListDescriporIcmRegion {
85 uint32_t icm_raddr;
87 uint32_t icm_rcfg;
89 uint32_t icm_rctrl;
91 uint32_t icm_rnext;
92} LinkedListDescriporIcmRegion;
93
94/*----------------------------------------------------------------------------*/
95/* Exported functions */
96/*----------------------------------------------------------------------------*/
97extern void ICM_Enable(void);
98extern void ICM_Disable(void);
99extern void ICM_SoftReset(void);
100extern void ICM_ReComputeHash(uint8_t region);
101extern void ICM_EnableMonitor(uint8_t region);
102extern void ICM_DisableMonitor(uint8_t region);
103extern void ICM_Configure(uint32_t mode);
104extern void ICM_EnableIt(uint32_t sources);
105extern void ICM_DisableIt(uint32_t sources);
106extern uint32_t ICM_GetIntStatus(void);
107extern uint32_t ICM_GetStatus(void);
108extern uint32_t ICM_GetUStatus(void);
109extern void ICM_SetDescStartAddress(uint32_t addr);
110extern void ICM_SetHashStartAddress(uint32_t addr);
111extern void ICM_SetInitHashValue(uint32_t val);
112#endif /* #ifndef _ICM_ */
ICM_SoftReset
void ICM_SoftReset(void)
Resets the ICM controller.
Definition: icm.c:113
ICM_Disable
void ICM_Disable(void)
Disable ICM, if a region is active, this region is terminated.
Definition: icm.c:105
ICM_SetHashStartAddress
void ICM_SetHashStartAddress(uint32_t addr)
Set hash area start address register.
Definition: icm.c:221
ICM_DisableMonitor
void ICM_DisableMonitor(uint8_t region)
Disable region monitoring for given region.
Definition: icm.c:144
ICM_EnableIt
void ICM_EnableIt(uint32_t sources)
Enables the selected interrupts sources on a ICM peripheral.
Definition: icm.c:162
ICM_GetUStatus
uint32_t ICM_GetUStatus(void)
Get the undefined access status register of the given ICM peripheral.
Definition: icm.c:199
ICM_ReComputeHash
void ICM_ReComputeHash(uint8_t region)
Recompute Internal hash.
Definition: icm.c:124
ICM_SetInitHashValue
void ICM_SetInitHashValue(uint32_t val)
Set ICM user initial Hash value register.
Definition: icm.c:230
ICM_Enable
void ICM_Enable(void)
Enable ICM, the ICM controller is activated.
Definition: icm.c:97
ICM_DisableIt
void ICM_DisableIt(uint32_t sources)
Disables the selected interrupts sources on a ICM peripheral.
Definition: icm.c:171
ICM_GetStatus
uint32_t ICM_GetStatus(void)
Get the current status register of the given ICM peripheral.
Definition: icm.c:189
ICM_EnableMonitor
void ICM_EnableMonitor(uint8_t region)
Enable region monitoring for given region.
Definition: icm.c:134
ICM_GetIntStatus
uint32_t ICM_GetIntStatus(void)
Get the current interrupt status register of the given ICM peripheral.
Definition: icm.c:180
ICM_SetDescStartAddress
void ICM_SetDescStartAddress(uint32_t addr)
Set descriptor area start address register.
Definition: icm.c:210
ICM_Configure
void ICM_Configure(uint32_t mode)
Configures an ICM peripheral with the specified parameters.
Definition: icm.c:153
_LinkedListDescriporIcmRegion
Structure ICM region descriptor area.
Definition: icm.h:83
_LinkedListDescriporIcmRegion::icm_raddr
uint32_t icm_raddr
Definition: icm.h:85
_LinkedListDescriporIcmRegion::icm_rcfg
uint32_t icm_rcfg
Definition: icm.h:87
_LinkedListDescriporIcmRegion::icm_rctrl
uint32_t icm_rctrl
Definition: icm.h:89
_LinkedListDescriporIcmRegion::icm_rnext
uint32_t icm_rnext
Definition: icm.h:91