Software APIs
dt_aes.h
Go to the documentation of this file.
1// Copyright lowRISC contributors (OpenTitan project).
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4//
5// Device table API auto-generated by `dtgen`
6
7#ifndef OPENTITAN_DT_AES_H_
8#define OPENTITAN_DT_AES_H_
9
10#ifdef __cplusplus
11extern "C" {
12#endif // __cplusplus
13
14/**
15 * @file
16 * @brief Device Tables (DT) for IP aes and top englishbreakfast.
17 *
18 * This file contains the type definitions and global functions of the aes.
19 */
20
21#include "dt_api.h"
22#include <stdint.h>
23
24
25
26/**
27 * List of instances.
28 */
29typedef enum dt_aes {
30 kDtAes = 0, /**< aes */
31 kDtAesFirst = 0, /**< \internal First instance */
32 kDtAesCount = 1, /**< \internal Number of instances */
34
35/**
36 * List of register blocks.
37 *
38 * Register blocks are guaranteed to start at 0 and to be consecutively numbered.
39 */
40typedef enum dt_aes_reg_block {
41 kDtAesRegBlockCore = 0, /**< */
42 kDtAesRegBlockCount = 1, /**< \internal Number of register blocks */
44
45/** Primary register block (associated with the "primary" set of registers that control the IP). */
46static const dt_aes_reg_block_t kDtAesRegBlockPrimary = kDtAesRegBlockCore;
47
48/**
49 * List of clock ports.
50 *
51 * Clock ports are guaranteed to be numbered consecutively from 0.
52 */
53typedef enum dt_aes_clock {
54 kDtAesClockClk = 0, /**< Clock port clk_i */
55 kDtAesClockEdn = 1, /**< Clock port clk_edn_i */
56 kDtAesClockCount = 2, /**< \internal Number of clock ports */
58
59/**
60 * List of reset ports.
61 *
62 * Reset ports are guaranteed to be numbered consecutively from 0.
63 */
64typedef enum dt_aes_reset {
65 kDtAesResetRst = 0, /**< Reset port rst_ni */
66 kDtAesResetEdn = 1, /**< Reset port rst_edn_ni */
67 kDtAesResetCount = 2, /**< \internal Number of reset ports */
69
70/**
71 * List of supported hardware features.
72 */
73#define OPENTITAN_AES_HAS_KEY_LEN_128 1
74#define OPENTITAN_AES_HAS_KEY_LEN_192 1
75#define OPENTITAN_AES_HAS_KEY_LEN_256 1
76#define OPENTITAN_AES_HAS_MODE_ECB 1
77#define OPENTITAN_AES_HAS_MODE_CBC 1
78#define OPENTITAN_AES_HAS_MODE_CFB_128 1
79#define OPENTITAN_AES_HAS_MODE_OFB 1
80#define OPENTITAN_AES_HAS_MODE_CTR 1
81#define OPENTITAN_AES_HAS_KEY_SIDELOAD 1
82#define OPENTITAN_AES_HAS_CLEAR_DATA_OUT 1
83#define OPENTITAN_AES_HAS_CLEAR_KEY_IV_DATA_IN 1
84#define OPENTITAN_AES_HAS_PRNG_RESEED_RATE 1
85#define OPENTITAN_AES_HAS_PRNG_KEY_TOUCH_FORCES_RESEED 1
86#define OPENTITAN_AES_HAS_PRNG_FORCE_MASKS 1
87#define OPENTITAN_AES_HAS_MANUAL_OPERATION 1
88
89
90
91/**
92 * Get the aes instance from an instance ID
93 *
94 * For example, `dt_uart_from_instance_id(kDtInstanceIdUart3) == kDtUart3`.
95 *
96 * @param inst_id Instance ID.
97 * @return A aes instance.
98 *
99 * **Note:** This function only makes sense if the instance ID has device type aes,
100 * otherwise the returned value is unspecified.
101 */
103
104/**
105 * Get the instance ID of an instance.
106 *
107 * @param dt Instance of aes.
108 * @return The instance ID of that instance.
109 */
111
112/**
113 * Get the register base address of an instance.
114 *
115 * @param dt Instance of aes.
116 * @param reg_block The register block requested.
117 * @return The register base address of the requested block.
118 */
119uint32_t dt_aes_reg_block(
120 dt_aes_t dt,
121 dt_aes_reg_block_t reg_block);
122
123/**
124 * Get the primary register base address of an instance.
125 *
126 * This is just a convenience function, equivalent to
127 * `dt_aes_reg_block(dt, kDtAesRegBlockCore)`
128 *
129 * @param dt Instance of aes.
130 * @return The register base address of the primary register block.
131 */
132static inline uint32_t dt_aes_primary_reg_block(
133 dt_aes_t dt) {
134 return dt_aes_reg_block(dt, kDtAesRegBlockCore);
135}
136
137
138
139
140/**
141 * Get the clock signal connected to a clock port of an instance.
142 *
143 * @param dt Instance of aes.
144 * @param clk Clock port.
145 * @return Clock signal.
146 */
148 dt_aes_t dt,
149 dt_aes_clock_t clk);
150
151/**
152 * Get the reset signal connected to a reset port of an instance.
153 *
154 * @param dt Instance of aes.
155 * @param rst Reset port.
156 * @return Reset signal.
157 */
159 dt_aes_t dt,
160 dt_aes_reset_t rst);
161
162
163
164#ifdef __cplusplus
165} // extern "C"
166#endif // __cplusplus
167
168#endif // OPENTITAN_DT_AES_H_