Software APIs
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"
9 
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(
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 }