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