blob: e39edba0ce0593ea1c27bb64afcd575715412980 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*******************************************************************************
2 * Copyright by ZTE Corporation.
3 *
4 * File Name:
5 * File Mark:
6 * Description:
7 * Others:
8 * Version: 0.1
9 * Author: shideyou
10 * Date: 2013-7-8
11 * History 1:
12 * Date:
13 * Version:
14 * Author:
15 * Modification:
16 * History 2:
17 ********************************************************************************/
18
19#ifndef _DRVS_ICP_H
20#define _DRVS_ICP_H
21
22#include "ram_config.h"
23#include "drvs_rpmsg.h"
24/*******************************************************************************
25* Macro *
26*******************************************************************************/
27
28/*******************************************************************************
29* Types *
30*******************************************************************************/
31#if 0
32typedef enum _T_HalIcp_MsgActor
33{
34 ICP_MSG_ACTOR_M0,
35 ICP_MSG_ACTOR_PHY,
36 ICP_MSG_ACTOR_ARM = ICP_MSG_ACTOR_PHY,
37 MAX_ICP_MSG_ACTOR
38} T_HalIcp_MsgActor;
39
40typedef enum _T_HalIcp_ModuleId
41{
42 ICP_ARM0_MODULE_ID_BASE, // 0
43 ICP_ARM0_MODULE_ID_DRV = ICP_ARM0_MODULE_ID_BASE,
44 ICP_ARM0_MODULE_ID_PSM, // 1
45 ICP_ARM0_MODULE_ID_OS, // 2
46 ICP_ARM0_MODULE_ID_LTEPS, // 3
47 ICP_ARM0_MODULE_ID_TDPS, // 4
48 ICP_ARM0_MODULE_ID_WPS, // 5
49 ICP_ARM0_MODULE_ID_LTEPSM, // 6
50 ICP_ARM0_MODULE_ID_TDPSM, // 7
51 ICP_ARM0_MODULE_ID_WPSM, // 8
52 MAX_ICP_ARM0_MODULE_ID = ICP_ARM0_MODULE_ID_WPSM,
53
54 ICP_ARM1_MODULE_ID_BASE, // 9
55 ICP_ARM1_MODULE_ID_DRV = ICP_ARM1_MODULE_ID_BASE,
56 ICP_ARM1_MODULE_ID_PSM, // 10
57 ICP_ARM1_MODULE_ID_OS, // 11
58 ICP_ARM1_MODULE_ID_LTEPHY, // 12
59 ICP_ARM1_MODULE_ID_TDPHY, // 13
60 ICP_ARM1_MODULE_ID_WPHY, // 14
61 ICP_ARM1_MODULE_ID_LTEPSM, // 15
62 ICP_ARM1_MODULE_ID_TDPSM, // 16
63 ICP_ARM1_MODULE_ID_WPSM, // 17
64 MAX_ICP_ARM1_MODULE_ID = ICP_ARM1_MODULE_ID_WPSM,
65
66 ICP_M0_MODULE_ID_BASE, // 18
67 ICP_M0_MODULE_ID_DRV = ICP_M0_MODULE_ID_BASE,
68 ICP_M0_MODULE_ID_PSM, // 19
69 ICP_M0_MODULE_ID_OS, // 20
70 MAX_ICP_M0_MODULE_ID = ICP_M0_MODULE_ID_OS,
71
72 MAX_ICP_MODULE_ID // 21
73} T_HalIcp_ModuleId;
74
75typedef enum _T_HalIcp_CallbackType
76{
77 ICP_ISR_CALLBACK,
78 ICP_HISR_CALLBACK,
79
80 MAX_ICP_CALLBACK_TYPE
81}T_HalIcp_CallbackType;
82#endif
83typedef struct _T_HalIcp_Dword
84{
85 UINT32 low_word;
86 UINT32 high_word;
87} T_HalIcp_Dword;
88
89typedef struct _T_HalIcp_Msg
90{
91 UINT32 SrcModId;
92 UINT32 desModId;
93 T_HalIcp_Dword IntInfo;
94 UINT32 sfn;
95 VOID *pBuf;
96 UINT32 len;
97} T_HalIcp_Msg;
98#if 0
99typedef VOID (*T_HalIcp_CallbackFunction)(const T_HalIcp_Msg *pMsg);
100
101
102/*******************************************************************************
103* Function Prototypes *
104*******************************************************************************/
105/*******************************************************************************
106* Function: zDrvIcp_RegCallback
107* Description: This function is used for registing callback functions;
108* Parameters:
109* Input:
110* me: which module regists callback function.
111* from: which is this function for.
112* callback: the callback function.
113* callbackType: where is this function, isr or hisr.
114*
115* Output:None
116*
117* Returns:
118* DRV_SUCCESS
119* DRV_ERROR
120*
121* Others:
122********************************************************************************/
123SINT32 zDrvIcp_RegCallback(UINT32 me,
124 UINT32 from,
125 T_HalIcp_CallbackFunction callback,
126 T_HalIcp_CallbackType callbackType);
127
128/*******************************************************************************
129* Function: zDrvIcp_SendMsg
130* Description: This function is used for sending ICP MSG;
131* Parameters:
132* Input:
133* pMsg: the msg which will be sent
134* Output:None
135*
136* Returns:
137* DRV_SUCCESS: successfully send msg.
138* DRV_ERROR: fail to send msg.
139*
140*
141* Others:
142********************************************************************************/
143SINT32 zDrvIcp_SendMsg(const T_HalIcp_Msg *pMsg);
144
145/*******************************************************************************
146* Function: zDrvIcp_SendMsg_Psm
147* Description: This function is used for sending ICP MSG during interrupt disabled;
148* Parameters:
149* Input:
150* pMsg: the msg which will be sent
151* Output:None
152*
153* Returns:
154* DRV_SUCCESS: successfully send msg.
155* DRV_ERROR: fail to send msg.
156*
157*
158* Others:
159********************************************************************************/
160SINT32 zDrvIcp_SendMsg_Psm(const T_HalIcp_Msg *pMsg);
161
162
163/*******************************************************************************
164* Function: zDrvIcp_Mask
165* Description: This function is used for mask ICP interrupt from another core;
166* Parameters:
167* Input:
168* actor: which core.
169* bit_map: which interrupts will be masked.
170* Output:None
171*
172* Returns:
173* None
174*
175*
176* Others:
177********************************************************************************/
178SINT32 zDrvIcp_Mask(T_HalIcp_MsgActor actor, T_HalIcp_Dword bit_map);
179
180 /*******************************************************************************
181 * Function: zDrvIcp_Unmask
182 * Description: This function is used for unmask ICP interrupt from another core;
183 * Parameters:
184 * Input:
185 * actor: which core.
186 * bit_map: which interrupts will be unmasked.
187 * Output:None
188 *
189 * Returns:
190 * None
191 *
192 *
193 * Others:
194 ********************************************************************************/
195 SINT32 zDrvIcp_Unmask(T_HalIcp_MsgActor actor, T_HalIcp_Dword bit_map);
196
197 /*******************************************************************************
198* Function: zDrvIcp_GetState
199* Description: This function is used for getting state;
200* Parameters:
201* Input:
202* actor: which core.
203* Output:None
204* pState: the current state.
205*
206* Returns:
207* DRV_ERR_INVALID_PARAM
208* DRV_SUCCESS
209*
210* Others:
211********************************************************************************/
212 SINT32 zDrvIcp_GetState(T_HalIcp_MsgActor actor, T_HalIcp_Dword *pState);
213
214 /*******************************************************************************
215* Function: zDrvIcp_ClearState
216* Description: This function is used for clear state;
217* Parameters:
218* Input:
219* actor: which core.
220* bit_map: which bits' state will be clear, 0-not clear, 1-clear.
221* Output:None
222*
223* Returns:
224* None
225*
226*
227* Others:
228********************************************************************************/
229 SINT32 zDrvIcp_ClearState(T_HalIcp_MsgActor actor, T_HalIcp_Dword bit_map);
230#endif
231#endif /* _DRVS_ICP_H */
232