Software APIs
sw
device
lib
dif
dif_rv_dm.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
#ifndef OPENTITAN_SW_DEVICE_LIB_DIF_DIF_RV_DM_H_
6
#define OPENTITAN_SW_DEVICE_LIB_DIF_DIF_RV_DM_H_
7
8
/**
9
* @file
10
* @brief <a href="/book/hw/ip/rv_dm/">RV_DM</a> Device Interface Functions
11
*/
12
13
#include <
stdint.h
>
14
15
#include "
sw/device/lib/dif/autogen/dif_rv_dm_autogen.h
"
16
17
#ifdef __cplusplus
18
extern
"C"
{
19
#endif // __cplusplus
20
21
/**
22
* Late debug enable/disable configuration.
23
*
24
* RV_DM is gated by the life cycle controller so that it is only usable in
25
* `TEST_UNLOCKED`, `DEV` and `RMA` states. In `DEV` life cycle state, this
26
* block supports late debug enablement via firmware, which allows the `ROM` or
27
* `ROM_EXT` to implement a debug enablement policy. The debug enablement
28
* functionality can be activated by calling this function.
29
*
30
* @param rv_dm A RV_DM handle.
31
* @param enable Enable or disable late debug.
32
* @return The result of the operation.
33
*/
34
OT_WARN_UNUSED_RESULT
35
dif_result_t
dif_rv_dm_late_debug_configure
(
const
dif_rv_dm_t
*rv_dm,
36
dif_toggle_t
enable);
37
38
/**
39
* Locks the late debug enable/disable configuration.
40
*
41
* This function locks the late debug enable/disable configuration register.
42
* Once locked, the late debug enable/disable configuration cannot be changed
43
* until the next reset.
44
*
45
* @param rv_dm A RV_DM handle.
46
* @return The result of the operation.
47
*/
48
OT_WARN_UNUSED_RESULT
49
dif_result_t
dif_rv_dm_late_debug_lock
(
const
dif_rv_dm_t
*rv_dm);
50
51
/**
52
* Checks whether the late debug enable/disable configuration is locked.
53
*
54
* @param rv_dm A RV_DM handle.
55
* @param[out] is_locked Out-param for whether the configuration is locked.
56
* @return The result of the operation.
57
*/
58
OT_WARN_UNUSED_RESULT
59
dif_result_t
dif_rv_dm_late_debug_is_locked
(
const
dif_rv_dm_t
*rv_dm,
60
bool
*is_locked);
61
62
#ifdef __cplusplus
63
}
// extern "C"
64
#endif // __cplusplus
65
66
#endif // OPENTITAN_SW_DEVICE_LIB_DIF_DIF_RV_DM_H_
Return to
OpenTitan Documentation