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 "dt/dt_pwrmgr.h" // Generated
6
+ #include "dt/dt_rstmgr.h" // Generated
7
+ #include "dt/dt_rv_core_ibex.h" // Generated
5
8
#include "sw/device/lib/base/abs_mmio.h"
6
9
#include "sw/device/lib/base/macros.h"
7
10
#include "sw/device/lib/base/mmio.h"
16
19
#include "sw/device/lib/testing/test_framework/ottf_isrs.h"
17
20
#include "sw/device/lib/testing/test_framework/ottf_main.h"
18
21
19
- #include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"
20
-
21
22
OTTF_DEFINE_TEST_CONFIG ();
22
23
23
24
/**
@@ -32,7 +33,7 @@ OTTF_DEFINE_TEST_CONFIG();
32
33
* the expected values for this single fault. The watch dog is then set up
33
34
* and another illegal memory access is performed. Only this time
34
35
* the exception handler performs another illegal read.
35
- * Causing the ibex to be haulted by the alert handler.
36
+ * Causing the ibex to be halted by the alert handler.
36
37
* The watch dog will eventually trigger a reset.
37
38
*
38
39
* 3. After the watchdog reset, the CPU info dump is checked against
@@ -182,16 +183,15 @@ bool test_main(void) {
182
183
dif_aon_timer_t aon_timer ;
183
184
dif_pwrmgr_t pwrmgr ;
184
185
dif_rv_core_ibex_t ibex ;
186
+ dt_rv_core_ibex_t ibex_dt = (dt_rv_core_ibex_t )0 ;
187
+ static_assert (kDtRvCoreIbexCount >= 1 ,
188
+ "This test requires at least 1 Ibex core." );
185
189
186
190
// Initialize Handles.
187
- CHECK_DIF_OK (dif_rstmgr_init (
188
- mmio_region_from_addr (TOP_EARLGREY_RSTMGR_AON_BASE_ADDR ), & rstmgr ));
189
- CHECK_DIF_OK (dif_aon_timer_init (
190
- mmio_region_from_addr (TOP_EARLGREY_AON_TIMER_AON_BASE_ADDR ), & aon_timer ));
191
- CHECK_DIF_OK (dif_pwrmgr_init (
192
- mmio_region_from_addr (TOP_EARLGREY_PWRMGR_AON_BASE_ADDR ), & pwrmgr ));
193
- CHECK_DIF_OK (dif_rv_core_ibex_init (
194
- mmio_region_from_addr (TOP_EARLGREY_RV_CORE_IBEX_CFG_BASE_ADDR ), & ibex ));
191
+ CHECK_DIF_OK (dif_rstmgr_init_from_dt (kDtRstmgrAon , & rstmgr ));
192
+ CHECK_DIF_OK (dif_aon_timer_init_from_dt (kDtAonTimerAon , & aon_timer ));
193
+ CHECK_DIF_OK (dif_pwrmgr_init_from_dt (kDtPwrmgrAon , & pwrmgr ));
194
+ CHECK_DIF_OK (dif_rv_core_ibex_init_from_dt (ibex_dt , & ibex ));
195
195
196
196
switch (rstmgr_testutils_reason_get ()) {
197
197
case kDifRstmgrResetInfoPor : // The first power-up.
0 commit comments