|
2 | 2 | // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
3 | 3 | // SPDX-License-Identifier: Apache-2.0 |
4 | 4 |
|
| 5 | +#include "hw/top/dt/dt_aes.h" |
| 6 | +#include "hw/top/dt/dt_csrng.h" |
| 7 | +#include "hw/top/dt/dt_edn.h" |
| 8 | +#include "hw/top/dt/dt_entropy_src.h" |
| 9 | +#include "hw/top/dt/dt_otbn.h" |
| 10 | +#include "hw/top/dt/dt_rv_core_ibex.h" |
| 11 | +#include "hw/top/dt/dt_rv_plic.h" |
5 | 12 | #include "sw/device/lib/base/macros.h" |
6 | 13 | #include "sw/device/lib/base/mmio.h" |
7 | 14 | #include "sw/device/lib/dif/dif_aes.h" |
8 | 15 | #include "sw/device/lib/dif/dif_csrng.h" |
9 | 16 | #include "sw/device/lib/dif/dif_csrng_shared.h" |
10 | 17 | #include "sw/device/lib/dif/dif_edn.h" |
11 | 18 | #include "sw/device/lib/dif/dif_entropy_src.h" |
| 19 | +#include "sw/device/lib/dif/dif_rv_plic.h" |
12 | 20 | #include "sw/device/lib/runtime/irq.h" |
13 | 21 | #include "sw/device/lib/runtime/log.h" |
14 | 22 | #include "sw/device/lib/testing/csrng_testutils.h" |
15 | 23 | #include "sw/device/lib/testing/edn_testutils.h" |
16 | 24 | #include "sw/device/lib/testing/entropy_testutils.h" |
17 | 25 | #include "sw/device/lib/testing/otbn_testutils.h" |
18 | 26 | #include "sw/device/lib/testing/rand_testutils.h" |
19 | | -#include "sw/device/lib/testing/rv_plic_testutils.h" |
20 | 27 | #include "sw/device/lib/testing/test_framework/check.h" |
21 | 28 | #include "sw/device/lib/testing/test_framework/ottf_macros.h" |
22 | 29 | #include "sw/device/lib/testing/test_framework/ottf_main.h" |
23 | 30 | #include "sw/device/tests/otbn_randomness_impl.h" |
24 | 31 |
|
25 | | -#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h" |
26 | | -#include "sw/device/lib/testing/autogen/isr_testutils.h" |
27 | | - |
28 | 32 | static dif_csrng_t csrng; |
29 | 33 | static dif_edn_t edn0; |
30 | 34 | static dif_edn_t edn1; |
@@ -140,23 +144,14 @@ OTTF_DEFINE_TEST_CONFIG(.enable_concurrency = true); |
140 | 144 | * Initializes the peripherals used in this test. |
141 | 145 | */ |
142 | 146 | static void init_peripherals(void) { |
143 | | - CHECK_DIF_OK(dif_csrng_init( |
144 | | - mmio_region_from_addr(TOP_EARLGREY_CSRNG_BASE_ADDR), &csrng)); |
145 | | - CHECK_DIF_OK( |
146 | | - dif_edn_init(mmio_region_from_addr(TOP_EARLGREY_EDN0_BASE_ADDR), &edn0)); |
147 | | - CHECK_DIF_OK( |
148 | | - dif_edn_init(mmio_region_from_addr(TOP_EARLGREY_EDN1_BASE_ADDR), &edn1)); |
149 | | - CHECK_DIF_OK(dif_entropy_src_init( |
150 | | - mmio_region_from_addr(TOP_EARLGREY_ENTROPY_SRC_BASE_ADDR), &entropy_src)); |
151 | | - CHECK_DIF_OK(dif_rv_plic_init( |
152 | | - mmio_region_from_addr(TOP_EARLGREY_RV_PLIC_BASE_ADDR), &plic)); |
153 | | - CHECK_DIF_OK(dif_rv_core_ibex_init( |
154 | | - mmio_region_from_addr(TOP_EARLGREY_RV_CORE_IBEX_CFG_BASE_ADDR), |
155 | | - &rv_core_ibex)); |
156 | | - CHECK_DIF_OK( |
157 | | - dif_otbn_init(mmio_region_from_addr(TOP_EARLGREY_OTBN_BASE_ADDR), &otbn)); |
158 | | - CHECK_DIF_OK( |
159 | | - dif_aes_init(mmio_region_from_addr(TOP_EARLGREY_AES_BASE_ADDR), &aes)); |
| 147 | + CHECK_DIF_OK(dif_csrng_init_from_dt(kDtCsrng, &csrng)); |
| 148 | + CHECK_DIF_OK(dif_edn_init_from_dt(kDtEdn0, &edn0)); |
| 149 | + CHECK_DIF_OK(dif_edn_init_from_dt(kDtEdn1, &edn1)); |
| 150 | + CHECK_DIF_OK(dif_entropy_src_init_from_dt(kDtEntropySrc, &entropy_src)); |
| 151 | + CHECK_DIF_OK(dif_rv_plic_init_from_dt(kDtRvPlic, &plic)); |
| 152 | + CHECK_DIF_OK(dif_rv_core_ibex_init_from_dt(kDtRvCoreIbex, &rv_core_ibex)); |
| 153 | + CHECK_DIF_OK(dif_otbn_init_from_dt(kDtOtbn, &otbn)); |
| 154 | + CHECK_DIF_OK(dif_aes_init_from_dt(kDtAes, &aes)); |
160 | 155 | } |
161 | 156 |
|
162 | 157 | /** |
|
0 commit comments