|
3 | 3 | // SPDX-License-Identifier: Apache-2.0 |
4 | 4 |
|
5 | 5 | #include "hw/ip/aes/model/aes_modes.h" |
| 6 | +#include "hw/top/dt/dt_aes.h" |
| 7 | +#include "hw/top/dt/dt_csrng.h" |
| 8 | +#include "hw/top/dt/dt_edn.h" |
| 9 | +#include "hw/top/dt/dt_otbn.h" |
| 10 | +#include "hw/top/dt/dt_rv_core_ibex.h" |
6 | 11 | #include "sw/device/lib/base/mmio.h" |
7 | 12 | #include "sw/device/lib/dif/dif_aes.h" |
8 | 13 | #include "sw/device/lib/dif/dif_csrng.h" |
|
21 | 26 | #include "sw/device/tests/otbn_randomness_impl.h" |
22 | 27 |
|
23 | 28 | #include "hw/top/edn_regs.h" // Generated |
24 | | -#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h" |
25 | 29 |
|
26 | 30 | enum { |
27 | 31 | kTimeout = (10 * 1000 * 1000), |
@@ -53,19 +57,12 @@ OTTF_DEFINE_TEST_CONFIG(); |
53 | 57 |
|
54 | 58 | // Initializes the peripherals used in this test. |
55 | 59 | static void init_peripherals(void) { |
56 | | - CHECK_DIF_OK(dif_csrng_init( |
57 | | - mmio_region_from_addr(TOP_EARLGREY_CSRNG_BASE_ADDR), &csrng)); |
58 | | - CHECK_DIF_OK( |
59 | | - dif_edn_init(mmio_region_from_addr(TOP_EARLGREY_EDN0_BASE_ADDR), &edn0)); |
60 | | - CHECK_DIF_OK( |
61 | | - dif_edn_init(mmio_region_from_addr(TOP_EARLGREY_EDN1_BASE_ADDR), &edn1)); |
62 | | - CHECK_DIF_OK( |
63 | | - dif_aes_init(mmio_region_from_addr(TOP_EARLGREY_AES_BASE_ADDR), &aes)); |
64 | | - CHECK_DIF_OK( |
65 | | - dif_otbn_init(mmio_region_from_addr(TOP_EARLGREY_OTBN_BASE_ADDR), &otbn)); |
66 | | - CHECK_DIF_OK(dif_rv_core_ibex_init( |
67 | | - mmio_region_from_addr(TOP_EARLGREY_RV_CORE_IBEX_CFG_BASE_ADDR), |
68 | | - &rv_core_ibex)); |
| 60 | + CHECK_DIF_OK(dif_csrng_init_from_dt(kDtCsrng, &csrng)); |
| 61 | + CHECK_DIF_OK(dif_edn_init_from_dt(kDtEdn0, &edn0)); |
| 62 | + CHECK_DIF_OK(dif_edn_init_from_dt(kDtEdn1, &edn1)); |
| 63 | + CHECK_DIF_OK(dif_aes_init_from_dt(kDtAes, &aes)); |
| 64 | + CHECK_DIF_OK(dif_otbn_init_from_dt(kDtOtbn, &otbn)); |
| 65 | + CHECK_DIF_OK(dif_rv_core_ibex_init_from_dt(kDtRvCoreIbex, &rv_core_ibex)); |
69 | 66 | } |
70 | 67 |
|
71 | 68 | static void configure_otbn(void) { |
|
0 commit comments