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"
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