Software APIs
sw
device
tests
sim_dv
lc_ctrl_volatile_raw_unlock_test.c
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
#include <
assert.h
>
6
#include <
stdbool.h
>
7
8
#include "
sw/device/lib/base/bitfield.h
"
9
#include "
sw/device/lib/base/memory.h
"
10
#include "
sw/device/lib/base/mmio.h
"
11
#include "
sw/device/lib/dif/dif_lc_ctrl.h
"
12
#include "
sw/device/lib/runtime/log.h
"
13
#include "sw/device/lib/testing/lc_ctrl_testutils.h"
14
#include "sw/device/lib/testing/test_framework/check.h"
15
#include "
sw/device/lib/testing/test_framework/ottf_main.h
"
16
17
#include "
hw/top_earlgrey/sw/autogen/top_earlgrey.h
"
18
19
static
dif_lc_ctrl_t lc_ctrl;
20
21
OTTF_DEFINE_TEST_CONFIG();
22
23
bool
test_main
(
void
) {
24
CHECK_DIF_OK(dif_lc_ctrl_init(
25
mmio_region_from_addr
(
TOP_EARLGREY_LC_CTRL_REGS_BASE_ADDR
), &lc_ctrl));
26
27
dif_lc_ctrl_state_t
state;
28
CHECK_DIF_OK(
dif_lc_ctrl_get_state
(&lc_ctrl, &state));
29
CHECK(state ==
kDifLcCtrlStateTestUnlocked0
);
30
return
true
;
31
}
Return to
OpenTitan Documentation