Software APIs
dt_rom_ctrl.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_ROM_CTRL_H_
8#define OPENTITAN_DT_ROM_CTRL_H_
9
10/**
11 * @file
12 * @brief Device Tables (DT) for IP rom_ctrl and top englishbreakfast.
13 *
14 * This file contains the type definitions and global functions of the rom_ctrl.
15 */
16
17#include "dt_api.h"
18#include <stdint.h>
19
20/**
21 * List of instances.
22 */
23typedef enum dt_rom_ctrl {
24 kDtRomCtrl = 0, /**< rom_ctrl */
25 kDtRomCtrlFirst = 0, /**< \internal First instance */
26 kDtRomCtrlCount = 1, /**< \internal Number of instances */
28
29/**
30 * List of register blocks.
31 *
32 * Register blocks are guaranteed to start at 0 and to be consecutively numbered.
33 */
35 kDtRomCtrlRegBlockRegs = 0, /**< */
36 kDtRomCtrlRegBlockRom = 1, /**< */
37 kDtRomCtrlRegBlockCount = 2, /**< \internal Number of register blocks */
39
40/** Primary register block (associated with the "primary" set of registers that control the IP). */
41static const dt_rom_ctrl_reg_block_t kDtRomCtrlRegBlockPrimary = kDtRomCtrlRegBlockRegs;
42
43/**
44 * List of clock ports.
45 *
46 * Clock ports are guaranteed to be numbered consecutively from 0.
47 */
48typedef enum dt_rom_ctrl_clock {
49 kDtRomCtrlClockClk = 0, /**< Clock port clk_i */
50 kDtRomCtrlClockCount = 1, /**< \internal Number of clock ports */
52
53/**
54 * List of reset ports.
55 *
56 * Reset ports are guaranteed to be numbered consecutively from 0.
57 */
58typedef enum dt_rom_ctrl_reset {
59 kDtRomCtrlResetRst = 0, /**< Reset port rst_ni */
60 kDtRomCtrlResetCount = 1, /**< \internal Number of reset ports */
62
63/**
64 * List of supported hardware features.
65 */
66#define OPENTITAN_ROM_CTRL_HAS_SCRAMBLED 1
67#define OPENTITAN_ROM_CTRL_HAS_DIGESTS 1
68#define OPENTITAN_ROM_CTRL_HAS_EXP_DIGESTS 1
69
70
71
72/**
73 * Get the rom_ctrl instance from an instance ID
74 *
75 * For example, `dt_uart_from_instance_id(kDtInstanceIdUart3) == kDtUart3`.
76 *
77 * @param inst_id Instance ID.
78 * @return A rom_ctrl instance.
79 *
80 * **Note:** This function only makes sense if the instance ID has device type rom_ctrl,
81 * otherwise the returned value is unspecified.
82 */
84
85/**
86 * Get the instance ID of an instance.
87 *
88 * @param dt Instance of rom_ctrl.
89 * @return The instance ID of that instance.
90 */
92
93/**
94 * Get the register base address of an instance.
95 *
96 * @param dt Instance of rom_ctrl.
97 * @param reg_block The register block requested.
98 * @return The register base address of the requested block.
99 */
100uint32_t dt_rom_ctrl_reg_block(
101 dt_rom_ctrl_t dt,
102 dt_rom_ctrl_reg_block_t reg_block);
103
104/**
105 * Get the primary register base address of an instance.
106 *
107 * This is just a convenience function, equivalent to
108 * `dt_rom_ctrl_reg_block(dt, kDtRomCtrlRegBlockRegs)`
109 *
110 * @param dt Instance of rom_ctrl.
111 * @return The register base address of the primary register block.
112 */
113static inline uint32_t dt_rom_ctrl_primary_reg_block(
114 dt_rom_ctrl_t dt) {
115 return dt_rom_ctrl_reg_block(dt, kDtRomCtrlRegBlockRegs);
116}
117
118
119
120
121/**
122 * Get the clock signal connected to a clock port of an instance.
123 *
124 * @param dt Instance of rom_ctrl.
125 * @param clk Clock port.
126 * @return Clock signal.
127 */
129 dt_rom_ctrl_t dt,
131
132/**
133 * Get the reset signal connected to a reset port of an instance.
134 *
135 * @param dt Instance of rom_ctrl.
136 * @param rst Reset port.
137 * @return Reset signal.
138 */
140 dt_rom_ctrl_t dt,
142
143
144
145#endif // OPENTITAN_DT_ROM_CTRL_H_