Software APIs
sw
device
silicon_creator
rom_ext
e2e
lockdown
otp_dai_lockdown.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 "sw/device/lib/base/status.h"
6
#include "
sw/device/lib/dif/dif_otp_ctrl.h
"
7
#include "
sw/device/lib/runtime/log.h
"
8
#include "
sw/device/lib/testing/test_framework/ottf_main.h
"
9
10
#include "
hw/top_earlgrey/sw/autogen/top_earlgrey.h
"
11
12
OTTF_DEFINE_TEST_CONFIG();
13
14
dif_otp_ctrl_t otp;
15
16
bool
test_main
(
void
) {
17
CHECK_DIF_OK(dif_otp_ctrl_init(
18
mmio_region_from_addr
(
TOP_EARLGREY_OTP_CTRL_CORE_BASE_ADDR
), &otp));
19
20
dif_otp_ctrl_config_t
config = {
21
.
check_timeout
= 100000,
22
.integrity_period_mask = 0x3ffff,
23
.consistency_period_mask = 0x3ffffff,
24
};
25
26
LOG_INFO
(
"dif_otp_ctrl_configure:"
);
27
// Since the ePMP forbids access to the OTP controller's register space,
28
// this call is expected to cause a fault.
29
CHECK_DIF_OK(
dif_otp_ctrl_configure
(&otp, config));
30
return
true
;
31
}
Return to
OpenTitan Documentation