Skip to content

Commit 331640b

Browse files
committed
[sw,test] Port entropy_src_bypass_mode_health test to DT
Signed-off-by: Robert Schilling <[email protected]>
1 parent da126d7 commit 331640b

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

sw/device/tests/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,11 +1628,12 @@ opentitan_test(
16281628
"//hw/top_earlgrey:fpga_cw340_sival": None,
16291629
"//hw/top_earlgrey:silicon_creator": None,
16301630
},
1631+
DARJEELING_TEST_ENVS,
16311632
),
16321633
verilator = verilator_params(timeout = "long"),
16331634
deps = [
16341635
":otbn_randomness_impl",
1635-
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
1636+
"//hw/top:dt",
16361637
"//sw/device/lib/base:memory",
16371638
"//sw/device/lib/base:mmio",
16381639
"//sw/device/lib/dif:aes",

sw/device/tests/entropy_src_bypass_mode_health_test.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
#include "hw/ip/aes/model/aes_modes.h"
6+
#include "hw/top/dt/dt_aes.h"
7+
#include "hw/top/dt/dt_alert_handler.h"
8+
#include "hw/top/dt/dt_csrng.h"
9+
#include "hw/top/dt/dt_edn.h"
10+
#include "hw/top/dt/dt_entropy_src.h"
11+
#include "hw/top/dt/dt_otbn.h"
612
#include "sw/device/lib/arch/boot_stage.h"
713
#include "sw/device/lib/base/memory.h"
814
#include "sw/device/lib/base/mmio.h"
@@ -25,7 +31,6 @@
2531
#include "sw/device/lib/testing/test_framework/ottf_main.h"
2632
#include "sw/device/tests/otbn_randomness_impl.h"
2733

28-
#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"
2934
#include "sw/device/lib/dif/autogen/dif_entropy_src_autogen.h"
3035

3136
#define TIMEOUT (1000 * 1000)
@@ -45,17 +50,13 @@ status_t init_test_environment(void) {
4550
LOG_INFO(
4651
"Initializing modules sntropy_src, csrng, edn0, edn1, aes, otbn and "
4752
"alert_handler...");
48-
TRY(dif_entropy_src_init(
49-
mmio_region_from_addr(TOP_EARLGREY_ENTROPY_SRC_BASE_ADDR), &entropy_src));
50-
TRY(dif_csrng_init(mmio_region_from_addr(TOP_EARLGREY_CSRNG_BASE_ADDR),
51-
&csrng));
52-
TRY(dif_edn_init(mmio_region_from_addr(TOP_EARLGREY_EDN0_BASE_ADDR), &edn0));
53-
TRY(dif_edn_init(mmio_region_from_addr(TOP_EARLGREY_EDN1_BASE_ADDR), &edn1));
54-
TRY(dif_aes_init(mmio_region_from_addr(TOP_EARLGREY_AES_BASE_ADDR), &aes));
55-
TRY(dif_otbn_init(mmio_region_from_addr(TOP_EARLGREY_OTBN_BASE_ADDR), &otbn));
56-
TRY(dif_alert_handler_init(
57-
mmio_region_from_addr(TOP_EARLGREY_ALERT_HANDLER_BASE_ADDR),
58-
&alert_handler));
53+
TRY(dif_entropy_src_init_from_dt(kDtEntropySrc, &entropy_src));
54+
TRY(dif_csrng_init_from_dt(kDtCsrng, &csrng));
55+
TRY(dif_edn_init_from_dt(kDtEdn0, &edn0));
56+
TRY(dif_edn_init_from_dt(kDtEdn1, &edn1));
57+
TRY(dif_aes_init_from_dt(kDtAes, &aes));
58+
TRY(dif_otbn_init_from_dt(kDtOtbn, &otbn));
59+
TRY(dif_alert_handler_init_from_dt(kDtAlertHandler, &alert_handler));
5960
return OK_STATUS();
6061
}
6162

0 commit comments

Comments
 (0)