Skip to content

Commit 45ca5b2

Browse files
committed
[tests] Port edn_boot_mode to multitop
Signed-off-by: Robert Schilling <[email protected]>
1 parent b07f079 commit 45ca5b2

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

sw/device/tests/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,13 +1307,14 @@ opentitan_test(
13071307
{
13081308
"//hw/top_earlgrey:silicon_creator": None,
13091309
},
1310+
DARJEELING_TEST_ENVS,
13101311
),
13111312
verilator = verilator_params(
13121313
timeout = "eternal",
13131314
),
13141315
deps = [
1316+
"//hw/top:dt",
13151317
"//hw/top:edn_c_regs",
1316-
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
13171318
"//sw/device/lib/base:mmio",
13181319
"//sw/device/lib/dif:csrng",
13191320
"//sw/device/lib/dif:edn",

sw/device/tests/edn_boot_mode.c

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

5+
#include "hw/top/dt/dt_csrng.h"
6+
#include "hw/top/dt/dt_edn.h"
7+
#include "hw/top/dt/dt_entropy_src.h"
8+
#include "hw/top/dt/dt_otbn.h"
9+
#include "hw/top/dt/dt_rv_core_ibex.h"
510
#include "sw/device/lib/base/mmio.h"
611
#include "sw/device/lib/dif/dif_csrng.h"
712
#include "sw/device/lib/dif/dif_edn.h"
@@ -19,7 +24,6 @@
1924
#include "sw/device/tests/otbn_randomness_impl.h"
2025

2126
#include "hw/top/edn_regs.h" // Generated
22-
#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"
2327

2428
enum {
2529
kEdnBootModeTimeout = (10 * 1000 * 1000),
@@ -48,19 +52,12 @@ OTTF_DEFINE_TEST_CONFIG();
4852

4953
// Initializes the peripherals used in this test.
5054
static void init_peripherals(void) {
51-
CHECK_DIF_OK(dif_entropy_src_init(
52-
mmio_region_from_addr(TOP_EARLGREY_ENTROPY_SRC_BASE_ADDR), &entropy_src));
53-
CHECK_DIF_OK(dif_csrng_init(
54-
mmio_region_from_addr(TOP_EARLGREY_CSRNG_BASE_ADDR), &csrng));
55-
CHECK_DIF_OK(
56-
dif_edn_init(mmio_region_from_addr(TOP_EARLGREY_EDN0_BASE_ADDR), &edn0));
57-
CHECK_DIF_OK(
58-
dif_edn_init(mmio_region_from_addr(TOP_EARLGREY_EDN1_BASE_ADDR), &edn1));
59-
CHECK_DIF_OK(
60-
dif_otbn_init(mmio_region_from_addr(TOP_EARLGREY_OTBN_BASE_ADDR), &otbn));
61-
CHECK_DIF_OK(dif_rv_core_ibex_init(
62-
mmio_region_from_addr(TOP_EARLGREY_RV_CORE_IBEX_CFG_BASE_ADDR),
63-
&rv_core_ibex));
55+
CHECK_DIF_OK(dif_entropy_src_init_from_dt(kDtEntropySrc, &entropy_src));
56+
CHECK_DIF_OK(dif_csrng_init_from_dt(kDtCsrng, &csrng));
57+
CHECK_DIF_OK(dif_edn_init_from_dt(kDtEdn0, &edn0));
58+
CHECK_DIF_OK(dif_edn_init_from_dt(kDtEdn1, &edn1));
59+
CHECK_DIF_OK(dif_otbn_init_from_dt(kDtOtbn, &otbn));
60+
CHECK_DIF_OK(dif_rv_core_ibex_init_from_dt(kDtRvCoreIbex, &rv_core_ibex));
6461
}
6562

6663
static void configure_otbn(void) {

0 commit comments

Comments
 (0)