1 /* 2 * fwDebug_api.h 3 * 4 * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * * Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * * Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in 15 * the documentation and/or other materials provided with the 16 * distribution. 17 * * Neither the name Texas Instruments nor the names of its 18 * contributors may be used to endorse or promote products derived 19 * from this software without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34 35 /**************************************************************************** 36 * 37 * MODULE: fwDebug_api.h 38 * 39 * PURPOSE: FW-Debug module API. 40 * 41 ****************************************************************************/ 42 43 #ifndef _FW_DEBUG_API_H 44 #define _FW_DEBUG_API_H 45 46 47 #define FW_DEBUG_MAX_BUF 256 48 #define FW_DBG_CMD_MAX_PARAMS 2 49 50 51 /* FW Debug commands. */ 52 typedef enum 53 { 54 FW_DBG_CMD_READ_MEM, 55 FW_DBG_CMD_WRITE_MEM 56 }fwDbg_dbgCmd_e; 57 58 typedef struct 59 { 60 TI_UINT32 addr; 61 TI_UINT32 length; 62 union 63 { 64 TI_UINT8 buf8[FW_DEBUG_MAX_BUF]; 65 TI_UINT32 buf32[FW_DEBUG_MAX_BUF/4]; 66 } UBuf; 67 }TFwDebugParams; 68 69 /* for TWD Debug */ 70 typedef struct 71 { 72 TI_UINT32 func_id; 73 union 74 { 75 TI_UINT32 opt_param; 76 TFwDebugParams mem_debug; 77 }debug_data; 78 } TTwdDebug; 79 80 typedef void(*TFwDubCallback)(TI_HANDLE hCb); 81 82 83 /* Public Function Definitions */ 84 85 86 TI_HANDLE fwDbg_Create (TI_HANDLE hOs); 87 88 void fwDbg_Destroy (TI_HANDLE hFwDebug); 89 90 void fwDbg_Init (TI_HANDLE hFwDebug, 91 TI_HANDLE hReport, 92 TI_HANDLE hTwif); 93 94 TI_STATUS fwDbg_WriteAddr (TI_HANDLE hFwDebug, 95 TI_UINT32 Address, 96 TI_UINT32 Length, 97 TI_UINT8* Buffer, 98 TFwDubCallback fCb, 99 TI_HANDLE hCb); 100 101 TI_STATUS fwDbg_ReadAddr (TI_HANDLE hFwDebug, 102 TI_UINT32 Address, 103 TI_UINT32 Length, 104 TI_UINT8* Buffer, 105 TFwDubCallback fCb, 106 TI_HANDLE hCb); 107 108 TI_BOOL fwDbg_isValidMemoryAddr (TI_HANDLE hFwDebug, 109 TI_UINT32 Address, 110 TI_UINT32 Length); 111 112 TI_BOOL fwDbg_isValidRegAddr (TI_HANDLE hFwDebug, 113 TI_UINT32 Address, 114 TI_UINT32 Length); 115 116 117 #endif /* _FW_DEBUG_API_H */ 118 119 120 121 122