1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  * Description:
8  *     Debug, Watchdog and Trace driver interface.
9  */
10 
11 #ifndef MOD_DWT_PMI_H
12 #define MOD_DWT_PMI_H
13 
14 #include <mod_pmi.h>
15 
16 #include <fwk_id.h>
17 #include <fwk_macros.h>
18 #include <fwk_module_idx.h>
19 
20 #include <stdint.h>
21 
22 /*!
23  * \ingroup GroupModules
24  * \defgroup GroupDwtPmi Performance and Instrumentation
25  *      module
26  * \{
27  */
28 
29 /*!
30  * \defgroup GroupDwtPmiTypes Types
31  * \{
32  */
33 
34 /*!
35  * \brief DWT PMI (Debug Watch and Trace) registers.
36  */
37 struct FWK_PACKED mod_dwt_pmi_config {
38     /*! Debug Exception and Monitor Control Register address from SCS */
39     FWK_RW uint32_t *debug_sys_demcr_addr;
40 
41     /*! Debug Watch and Trace CTRL register */
42     FWK_RW uint32_t *dwt_ctrl_addr;
43 
44     /*! Debug Watch and Cycle Count register */
45     FWK_RW uint32_t *dwt_cyccnt;
46 
47     /*! Generic hardware timer */
48     struct cntbase_reg *hw_timer;
49 };
50 
51 /*!
52  * \}
53  */
54 
55 /*!
56  * \defgroup GroupPmiIds Identifiers
57  * \{
58  */
59 
60 /*!
61  * \brief API indices.
62  */
63 enum mod_dwt_pmi_api_idx {
64     MOD_DWT_PMI_API_IDX_DRIVER, /*! API index */
65     MOD_DWT_PMI_API_IDX_COUNT /*! Number of defined APIs */
66 };
67 
68 /*! Module API identifier */
69 static const fwk_id_t mod_dwt_pmi_api_id_driver =
70     FWK_ID_API_INIT(FWK_MODULE_IDX_DWT_PMI, MOD_DWT_PMI_API_IDX_DRIVER);
71 
72 /*!
73  * \}
74  */
75 
76 /*!
77  * \}
78  */
79 
80 #endif /* MOD_DWT_PMI_H */
81