Software APIs
sw
device
silicon_creator
rom_ext
e2e
dice_chain
no_refresh_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 "sw/device/lib/base/status.h"
6
#include "
sw/device/lib/runtime/log.h
"
7
#include "sw/device/lib/testing/test_framework/check.h"
8
#include "
sw/device/lib/testing/test_framework/ottf_main.h
"
9
#include "sw/device/silicon_creator/lib/drivers/retention_sram.h"
10
#include "sw/device/silicon_creator/lib/drivers/rstmgr.h"
11
12
OTTF_DEFINE_TEST_CONFIG();
13
14
bool
test_main
(
void
) {
15
retention_sram_t
*retram = retention_sram_get();
16
17
if
(
bitfield_bit32_read
(retram->
creator
.
reset_reasons
,
18
kRstmgrReasonPowerOn)) {
19
LOG_INFO
(
"Rebooting"
);
20
rstmgr_reset();
21
return
false
;
22
}
23
LOG_INFO
(
"Rebooted"
);
24
return
true
;
25
}
Return to
OpenTitan Documentation