Skip to content

Commit

Permalink
[sw] Port rstmgr_sw_req_test to devicetables
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Jones <[email protected]>
  • Loading branch information
AlexJones0 authored and jwnrt committed Feb 17, 2025
1 parent 088fa7a commit 4cce541
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions sw/device/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3650,6 +3650,7 @@ opentitan_test(
{
"//hw/top_earlgrey:fpga_cw310_sival": None,
"//hw/top_earlgrey:silicon_creator": None,
"//hw/top_darjeeling:sim_dv": None,
},
),
qemu = qemu_params(
Expand All @@ -3659,8 +3660,7 @@ opentitan_test(
},
),
deps = [
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
"//sw/device/lib/base:mmio",
"//hw/top:dt",
"//sw/device/lib/dif:rstmgr",
"//sw/device/lib/runtime:log",
"//sw/device/lib/testing:rstmgr_testutils",
Expand Down
9 changes: 4 additions & 5 deletions sw/device/tests/rstmgr_sw_req_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

#include "sw/device/lib/base/mmio.h"
#include "dt/dt_rstmgr.h" // Generated
#include "sw/device/lib/dif/dif_rstmgr.h"
#include "sw/device/lib/runtime/log.h"
#include "sw/device/lib/testing/rstmgr_testutils.h"
#include "sw/device/lib/testing/test_framework/check.h"
#include "sw/device/lib/testing/test_framework/ottf_main.h"

#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"

static dif_rstmgr_t rstmgr;
static dt_rstmgr_t kRstmgrDt = (dt_rstmgr_t)0;
static_assert(kDtRstmgrCount == 1, "This test requires 1 rstmgr");

OTTF_DEFINE_TEST_CONFIG();

bool test_main(void) {
CHECK_DIF_OK(dif_rstmgr_init(
mmio_region_from_addr(TOP_EARLGREY_RSTMGR_AON_BASE_ADDR), &rstmgr));
CHECK_DIF_OK(dif_rstmgr_init_from_dt(kRstmgrDt, &rstmgr));

dif_rstmgr_reset_info_bitfield_t reason;
reason = rstmgr_testutils_reason_get();
Expand Down

0 comments on commit 4cce541

Please sign in to comment.