1 /* 2 * Arm SCP/MCP Software 3 * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 #ifndef DEBUG_H 9 #define DEBUG_H 10 11 #include <mod_debug.h> 12 13 #include <fwk_id.h> 14 15 #include <stdint.h> 16 17 enum debug_state { 18 DEBUG_IDLE, 19 DEBUG_GET, 20 DEBUG_SET, 21 }; 22 23 /* 24 * Debug element context 25 */ 26 struct debug_dev_ctx { 27 struct mod_debug_dev_config *config; 28 struct mod_debug_driver_api *driver_api; 29 uint32_t debug_users_mask; 30 enum scp_debug_user requester; 31 enum debug_state state; 32 uint32_t cookie; 33 }; 34 35 /* 36 * Request event parameters 37 */ 38 struct mod_debug_request_params { 39 enum scp_debug_user user_id; 40 bool enable; 41 }; 42 43 /* 44 * Debug events indices 45 */ 46 enum mod_debug_event_idx { 47 MOD_DEBUG_EVENT_IDX_REQ_DRV = MOD_DEBUG_PUBLIC_EVENT_IDX_COUNT, 48 MOD_DEBUG_EVENT_IDX_SET_COMPLETE, 49 MOD_DEBUG_EVENT_IDX_GET_COMPLETE, 50 MOD_DEBUG_EVENT_COUNT, 51 }; 52 53 /* 54 * Debug event identifiers 55 */ 56 static const fwk_id_t mod_debug_event_id_req_drv = 57 FWK_ID_EVENT_INIT(FWK_MODULE_IDX_DEBUG, MOD_DEBUG_EVENT_IDX_REQ_DRV); 58 59 static const fwk_id_t mod_debug_event_id_set_complete = 60 FWK_ID_EVENT_INIT(FWK_MODULE_IDX_DEBUG, MOD_DEBUG_EVENT_IDX_SET_COMPLETE); 61 62 static const fwk_id_t mod_debug_event_id_get_complete = 63 FWK_ID_EVENT_INIT(FWK_MODULE_IDX_DEBUG, MOD_DEBUG_EVENT_IDX_GET_COMPLETE); 64 65 #endif /* DEBUG_H */ 66