MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClOsccaSafo_Sfr_RegBank.h
1/*--------------------------------------------------------------------------*/
2/* Copyright 2023 NXP */
3/* */
4/* NXP Confidential. This software is owned or controlled by NXP and may */
5/* only be used strictly in accordance with the applicable license terms. */
6/* By expressly accepting such terms or by downloading, installing, */
7/* activating and/or otherwise using the software, you are agreeing that */
8/* you have read, and that you agree to comply with and are bound by, such */
9/* license terms. If you do not agree to be bound by the applicable license */
10/* terms, then you may not retain, install, activate or otherwise use the */
11/* software. */
12/*--------------------------------------------------------------------------*/
13
14#ifndef MCUXCLOSCCASAFO_SFR_REGBANK_H_
15#define MCUXCLOSCCASAFO_SFR_REGBANK_H_
16
18#include <platform_specific_headers.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25
27MCUX_CSSL_FP_FUNCTION_DEF(mcuxClOsccaSafo_Sfr_getAddrOfDataReg)
28static inline uint32_t * mcuxClOsccaSafo_Sfr_getAddrOfDataReg(uint32_t dataRegIndex)
29{
30 MCUX_CSSL_ANALYSIS_START_PATTERN_HW_READ()
31 return &(((uint32_t *) &(MCUXCLOSCCASAFO_SFR_READ(DATIN0A)))[dataRegIndex]);
32 MCUX_CSSL_ANALYSIS_STOP_PATTERN_HW_READ()
33}
34
36MCUX_CSSL_FP_FUNCTION_DEF(mcuxClOsccaSafo_Sfr_getAddrOfKeyReg)
37static inline uint32_t * mcuxClOsccaSafo_Sfr_getAddrOfKeyReg(uint32_t keyRegIndex)
38{
39 MCUX_CSSL_ANALYSIS_START_PATTERN_HW_READ()
40 return &(((uint32_t *) &(MCUXCLOSCCASAFO_SFR_READ(KEY0A)))[keyRegIndex]);
41 MCUX_CSSL_ANALYSIS_STOP_PATTERN_HW_READ()
42}
43
45MCUX_CSSL_FP_FUNCTION_DEF(mcuxClOsccaSafo_Sfr_writeKeyWord)
46static inline void mcuxClOsccaSafo_Sfr_writeKeyWord(uint32_t index, uint32_t value)
47{
48 MCUX_CSSL_ANALYSIS_START_PATTERN_HW_WRITE()
49 volatile uint32_t *const safoKeyWord = (uint32_t *) &(MCUXCLOSCCASAFO_SFR_READ(KEY0A));
50 MCUX_CSSL_ANALYSIS_START_SUPPRESS_OUT_OF_BOUNDS_ACCESS("Apply an index to the base address of a HW peripheral to access the correct SFR-word. The caller is responsible for ensuring that the index is valid.")
51 safoKeyWord[index] = value;
52 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_OUT_OF_BOUNDS_ACCESS()
53 MCUX_CSSL_ANALYSIS_STOP_PATTERN_HW_WRITE()
54}
55
57MCUX_CSSL_FP_FUNCTION_DEF(mcuxClOsccaSafo_Sfr_readKeyWord)
58static inline uint32_t mcuxClOsccaSafo_Sfr_readKeyWord(uint32_t index)
59{
60 MCUX_CSSL_ANALYSIS_START_PATTERN_HW_READ()
61 volatile uint32_t *const safoKeyWord = (uint32_t *) &(MCUXCLOSCCASAFO_SFR_READ(KEY0A));
62 MCUX_CSSL_ANALYSIS_START_SUPPRESS_OUT_OF_BOUNDS_ACCESS("Apply an index to the base address of a HW peripheral to access the correct SFR-word. The caller is responsible for ensuring that the index is valid.")
63 return safoKeyWord[index];
64 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_OUT_OF_BOUNDS_ACCESS()
65 MCUX_CSSL_ANALYSIS_STOP_PATTERN_HW_READ()
66}
67
69MCUX_CSSL_FP_FUNCTION_DEF(mcuxClOsccaSafo_Sfr_writeDatinWord)
70static inline void mcuxClOsccaSafo_Sfr_writeDatinWord(uint32_t index, uint32_t value)
71{
72 MCUX_CSSL_ANALYSIS_START_PATTERN_HW_WRITE()
73 volatile uint32_t *const safoDatinWord = (uint32_t *) &(MCUXCLOSCCASAFO_SFR_READ(DATIN0A));
74 MCUX_CSSL_ANALYSIS_START_SUPPRESS_OUT_OF_BOUNDS_ACCESS("Apply an index to the base address of a HW peripheral to access the correct SFR-word. The caller is responsible for ensuring that the index is valid.")
75 safoDatinWord[index] = value;
76 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_OUT_OF_BOUNDS_ACCESS()
77 MCUX_CSSL_ANALYSIS_STOP_PATTERN_HW_WRITE()
78}
79
80#ifdef MCUXCL_FEATURE_HW_SAFO_SM3
81MCUX_CSSL_FP_FUNCTION_DEF(mcuxClOsccaSafo_Sfr_writeFifoWord)
82static inline void mcuxClOsccaSafo_Sfr_writeFifoWord(uint32_t value)
83{
84 MCUXCLOSCCASAFO_SFR_WRITE(SM3_FIFO, value);
85}
86#endif
87
89MCUX_CSSL_FP_FUNCTION_DEF(mcuxClOsccaSafo_Sfr_readDatinWord)
90static inline uint32_t mcuxClOsccaSafo_Sfr_readDatinWord(uint32_t index)
91{
92 MCUX_CSSL_ANALYSIS_START_PATTERN_HW_READ()
93 volatile uint32_t *const safoDatinWord = (uint32_t *) &(MCUXCLOSCCASAFO_SFR_READ(DATIN0A));
94 MCUX_CSSL_ANALYSIS_START_SUPPRESS_OUT_OF_BOUNDS_ACCESS("Apply an index to the base address of a HW peripheral to access the correct SFR-word. The caller is responsible for ensuring that the index is valid.")
95 return safoDatinWord[index];
96 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_OUT_OF_BOUNDS_ACCESS()
97 MCUX_CSSL_ANALYSIS_STOP_PATTERN_HW_READ()
98}
99
101MCUX_CSSL_FP_FUNCTION_DEF(mcuxClOsccaSafo_Sfr_readDatoutWord)
102static inline uint32_t mcuxClOsccaSafo_Sfr_readDatoutWord(uint32_t index)
103{
104 MCUX_CSSL_ANALYSIS_START_PATTERN_HW_READ()
105 volatile uint32_t *const safoDatoutWord = (uint32_t *) &(MCUXCLOSCCASAFO_SFR_READ(DATOUTA));
106 MCUX_CSSL_ANALYSIS_START_SUPPRESS_OUT_OF_BOUNDS_ACCESS("Apply an index to the base address of a HW peripheral to access the correct SFR-word. The caller is responsible for ensuring that the index is valid.")
107 return safoDatoutWord[index];
108 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_OUT_OF_BOUNDS_ACCESS()
109 MCUX_CSSL_ANALYSIS_STOP_PATTERN_HW_READ()
110}
111
112#ifdef __cplusplus
113} /* extern "C" */
114#endif
115
116#endif /* MCUXCLOSCCASAFO_SFR_REGBANK_H_ */
Macros for abstracting SAFO hardware SFR access.
#define MCUXCLOSCCASAFO_SFR_READ(sfr)
Read from SAFO SFR.
Definition mcuxClOsccaSafo_SfrAccess.h:42
#define MCUXCLOSCCASAFO_SFR_WRITE(sfr, value)
Write to SAFO SFR.
Definition mcuxClOsccaSafo_SfrAccess.h:45
Provides the API for the CSSL flow protection mechanism.
#define MCUX_CSSL_FP_FUNCTION_DEF(...)
Definition of a flow protected function.
Definition mcuxCsslFlowProtection.h:159