RTEMS  5.1
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)
44 
45 #define ICM_RCFG_WRAP (0x1u << 1)
46 
47 #define ICM_RCFG_EOM (0x1u << 2)
48 
49 #define ICM_RCFG_RHIEN (0x1u << 4)
50 
51 #define ICM_RCFG_DMIEN (0x1u << 5)
52 
53 #define ICM_RCFG_BEIEN (0x1u << 6)
54 
55 #define ICM_RCFG_WCIEN (0x1u << 7)
56 
57 #define ICM_RCFG_ECIEN (0x1u << 8)
58 
59 #define ICM_RCFG_SUIEN (0x1u << 9)
60 
61 #define ICM_RCFG_PROCDLY (0x1u << 10)
62 
63 #define ICM_RCFG_UALGO_Pos 12
64 #define ICM_RCFG_UALGO_Msk (0x7u << ICM_RCFG_UALGO_Pos)
65 
66 #define ICM_RCFG_ALGO_SHA1 (0x0u << 12)
67 
68 #define ICM_RCFG_ALGO_SHA256 (0x1u << 12)
69 
70 #define ICM_RCFG_ALGO_SHA224 (0x4u << 12)
71 
72 #define ICM_RCFG_MRPROT_Pos 24
73 #define ICM_RCFG_MRPROT_Msk (0x3fu << ICM_RCFG_MRPROT_Pos)
74 
75 #define ICM_RCFG_MRPROT(value) \
76  ((ICM_RCFG_MRPROT_Msk & ((value) << ICM_RCFG_MRPROT_Pos)))
77 
78 /*----------------------------------------------------------------------------*/
79 /* Type */
80 /*----------------------------------------------------------------------------*/
81 
85  uint32_t icm_raddr;
87  uint32_t icm_rcfg;
89  uint32_t icm_rctrl;
91  uint32_t icm_rnext;
93 
94 /*----------------------------------------------------------------------------*/
95 /* Exported functions */
96 /*----------------------------------------------------------------------------*/
97 extern void ICM_Enable(void);
98 extern void ICM_Disable(void);
99 extern void ICM_SoftReset(void);
100 extern void ICM_ReComputeHash(uint8_t region);
101 extern void ICM_EnableMonitor(uint8_t region);
102 extern void ICM_DisableMonitor(uint8_t region);
103 extern void ICM_Configure(uint32_t mode);
104 extern void ICM_EnableIt(uint32_t sources);
105 extern void ICM_DisableIt(uint32_t sources);
106 extern uint32_t ICM_GetIntStatus(void);
107 extern uint32_t ICM_GetStatus(void);
108 extern uint32_t ICM_GetUStatus(void);
109 extern void ICM_SetDescStartAddress(uint32_t addr);
110 extern void ICM_SetHashStartAddress(uint32_t addr);
111 extern void ICM_SetInitHashValue(uint32_t val);
112 #endif /* #ifndef _ICM_ */
void ICM_SetHashStartAddress(uint32_t addr)
Set hash area start address register.
Definition: icm.c:221
void ICM_DisableIt(uint32_t sources)
Disables the selected interrupts sources on a ICM peripheral.
Definition: icm.c:171
uint32_t ICM_GetUStatus(void)
Get the undefined access status register of the given ICM peripheral.
Definition: icm.c:199
Structure ICM region descriptor area.
Definition: icm.h:83
void ICM_SoftReset(void)
Resets the ICM controller.
Definition: icm.c:113
uint32_t ICM_GetStatus(void)
Get the current status register of the given ICM peripheral.
Definition: icm.c:189
void ICM_Configure(uint32_t mode)
Configures an ICM peripheral with the specified parameters.
Definition: icm.c:153
uint32_t icm_rcfg
Definition: icm.h:87
void ICM_EnableIt(uint32_t sources)
Enables the selected interrupts sources on a ICM peripheral.
Definition: icm.c:162
uint32_t icm_rctrl
Definition: icm.h:89
void ICM_Enable(void)
Enable ICM, the ICM controller is activated.
Definition: icm.c:97
void ICM_SetDescStartAddress(uint32_t addr)
Set descriptor area start address register.
Definition: icm.c:210
uint32_t icm_rnext
Definition: icm.h:91
void ICM_DisableMonitor(uint8_t region)
Disable region monitoring for given region.
Definition: icm.c:144
void ICM_SetInitHashValue(uint32_t val)
Set ICM user initial Hash value register.
Definition: icm.c:230
uint32_t icm_raddr
Definition: icm.h:85
void ICM_ReComputeHash(uint8_t region)
Recompute Internal hash.
Definition: icm.c:124
uint32_t ICM_GetIntStatus(void)
Get the current interrupt status register of the given ICM peripheral.
Definition: icm.c:180
void ICM_Disable(void)
Disable ICM, if a region is active, this region is terminated.
Definition: icm.c:105
void ICM_EnableMonitor(uint8_t region)
Enable region monitoring for given region.
Definition: icm.c:134