Skip to content

Commit 4cce541

Browse files
AlexJones0jwnrt
authored andcommitted
[sw] Port rstmgr_sw_req_test to devicetables
Signed-off-by: Alex Jones <[email protected]>
1 parent 088fa7a commit 4cce541

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

sw/device/tests/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3650,6 +3650,7 @@ opentitan_test(
36503650
{
36513651
"//hw/top_earlgrey:fpga_cw310_sival": None,
36523652
"//hw/top_earlgrey:silicon_creator": None,
3653+
"//hw/top_darjeeling:sim_dv": None,
36533654
},
36543655
),
36553656
qemu = qemu_params(
@@ -3659,8 +3660,7 @@ opentitan_test(
36593660
},
36603661
),
36613662
deps = [
3662-
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
3663-
"//sw/device/lib/base:mmio",
3663+
"//hw/top:dt",
36643664
"//sw/device/lib/dif:rstmgr",
36653665
"//sw/device/lib/runtime:log",
36663666
"//sw/device/lib/testing:rstmgr_testutils",

sw/device/tests/rstmgr_sw_req_test.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@
22
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
33
// SPDX-License-Identifier: Apache-2.0
44

5-
#include "sw/device/lib/base/mmio.h"
5+
#include "dt/dt_rstmgr.h" // Generated
66
#include "sw/device/lib/dif/dif_rstmgr.h"
77
#include "sw/device/lib/runtime/log.h"
88
#include "sw/device/lib/testing/rstmgr_testutils.h"
99
#include "sw/device/lib/testing/test_framework/check.h"
1010
#include "sw/device/lib/testing/test_framework/ottf_main.h"
1111

12-
#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"
13-
1412
static dif_rstmgr_t rstmgr;
13+
static dt_rstmgr_t kRstmgrDt = (dt_rstmgr_t)0;
14+
static_assert(kDtRstmgrCount == 1, "This test requires 1 rstmgr");
1515

1616
OTTF_DEFINE_TEST_CONFIG();
1717

1818
bool test_main(void) {
19-
CHECK_DIF_OK(dif_rstmgr_init(
20-
mmio_region_from_addr(TOP_EARLGREY_RSTMGR_AON_BASE_ADDR), &rstmgr));
19+
CHECK_DIF_OK(dif_rstmgr_init_from_dt(kRstmgrDt, &rstmgr));
2120

2221
dif_rstmgr_reset_info_bitfield_t reason;
2322
reason = rstmgr_testutils_reason_get();

0 commit comments

Comments
 (0)