|
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_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" |
5 | 10 | #include "sw/device/lib/base/mmio.h" |
6 | 11 | #include "sw/device/lib/dif/dif_csrng.h" |
7 | 12 | #include "sw/device/lib/dif/dif_edn.h" |
|
19 | 24 | #include "sw/device/tests/otbn_randomness_impl.h" |
20 | 25 |
|
21 | 26 | #include "hw/top/edn_regs.h" // Generated |
22 | | -#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h" |
23 | 27 |
|
24 | 28 | enum { |
25 | 29 | kEdnBootModeTimeout = (10 * 1000 * 1000), |
@@ -48,19 +52,12 @@ OTTF_DEFINE_TEST_CONFIG(); |
48 | 52 |
|
49 | 53 | // Initializes the peripherals used in this test. |
50 | 54 | 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)); |
64 | 61 | } |
65 | 62 |
|
66 | 63 | static void configure_otbn(void) { |
|
0 commit comments