blob: 3afd95ad1d788c3e23a1dfe47e62f762786ee1e5 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2012
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*******************************************************************************
37 * Filename:
38 * ---------
39 * ccci_if.h
40 *
41 * Project:
42 * --------
43 * UMOLY
44 *
45 * Description:
46 * ------------
47 * Defines the CCCI data structures and APIs
48 * This file has 7 regions, includes:
49 * CCCI header file : include header file
50 * CCCI compile option : Define CCCI related compile option
51 * CCCI structure define : Define CCCI public structure
52 * CCCI Macro : Define CCCI public Macro
53 * CCCI function pointer : Define CCCI public function pointer
54 * CCCI public API : Define CCCI public API
55 * CCCI MISC : For test propose or other use
56 *
57 * Each region includes 3 parts, includes:
58 * Common : For common use
59 * PCore : For PCore use only
60 * L1Core : For L1Core use only
61 *
62 * Author:
63 * -------
64 * -------
65 *
66 * ==========================================================================
67 * $Log$
68 *
69 * 11 11 2020 adel.liao
70 * [MOLY00587690] [MT6880][Colgin]Fix the method to get the mini dump flag and midr dump flag
71 *
72 * 09 18 2020 li-cheng.tsai
73 * [MOLY00569647] [MP7.PRECHECKIN.DEV][Code sync] sync code from T700
74 * [R3.MP][OA][CCCI]code sync from T700
75 *
76 * 09 15 2020 li-cheng.tsai
77 * [MOLY00569647] [MP7.PRECHECKIN.DEV][Code sync] sync code from T700
78 * [MP7.PRECHECKIN.DEV][OA][CCCI]code sync from T700
79 *
80 * 08 04 2020 actory.ou
81 * [MOLY00554534] [Colgin][Code sync] sync code from MT6880.MP
82 * [T700][OA][CCCI] sync from MT6880
83 *
84 * 07 23 2020 actory.ou
85 * [MOLY00549227] [Colgin] provide boot id from runtime data for USB driver
86 * [MT6880][OA] add boot mode enum (get from AP runtime data)
87 *
88 * 07 16 2020 actory.ou
89 * [MOLY00546864] [Colgin][CCCI] bring up issue patch back
90 * [MT6880.MP][OA] add host handshake done broadcast
91 *
92 * 07 08 2020 actory.ou
93 * [MOLY00541625] [Colgin][SB] DPMAIF code merge
94 * [R3.MT6880.MP][OA] add host handshake done broadcast
95 *
96 * 07 07 2020 actory.ou
97 * [MOLY00543186] [Colgin] code sync to NR15.R3.MT6880.MP
98 * [R3.MT6880.MP][OA][CCCI] sync from COLGIN.SB.SMT.DEV
99 *
100 * 06 05 2020 actory.ou
101 * [MOLY00532117] [CCCI] support async HS on data card
102 * [COLGIN.SB.DEV][OA] enable async hs
103 *
104 * 06 03 2020 actory.ou
105 * [MOLY00520040] [Gen97][CCCI] DIPC development - support port setting indication
106 * [NR15.R3.COLGIN.SB.SMT.DEV][OA] apply DIPC
107 *
108 * 05 19 2020 actory.ou
109 * [MOLY00525599] code sync for Colgin
110 * [NR15.R3.COLGIN.SB.SMT.DEV][OA][CCCI] code sync from 19NOV
111 *
112 * 03 23 2020 actory.ou
113 * [MOLY00502858] [Gen97][Gen98] merge ccci channel id/runtime data id
114 * [19NOV][OA][NCCCI/NCCCIDEV] merge channel id table
115 *
116 * 03 06 2020 actory.ou
117 * [MOLY00503617] [Gen97][Thin Modem][ccci] choose boot up handshake flow based on link status
118 * [19NOV][OA] ccci skip pcie flow if no pcie
119 *
120 * 01 06 2020 actory.ou
121 * [MOLY00467882] [TE-CAT][By ATG][MT6885][Petrus][Q0][MDST][SIM1:CT]Externel (EE),mcu/driver/ccismcore/src/ccismcore_ccci.c line:1977 pop up
122 * [M70.19NOV][OA] add exception hs timeout
123 *
124 * 12 09 2019 kyle.shin
125 * [MOLY00340001] [676X][SPR] block BIP when device connect to 56K factory cable
126 *
127 * .
128 * patch back
129 *
130 * 12 05 2019 actory.ou
131 * [MOLY00463817] [Gen97][CCCI] provide query function to get AP/MD memory mapping
132 * [VMOLY][OA] add memory remap address feature id
133 *
134 * 07 25 2019 actory.ou
135 * [MOLY00424777] [Gen97] Assertion removal & Strict aliasing warning clean-un
136 * [VMOLY][OA][CCCI] fix LTO warning
137 *
138 * 07 18 2019 actory.ou
139 * [MOLY00422579] [MDDP] DPFM porting to VMOLY
140 * [VMOLY][OA] support MDDP & rename to DPFM
141 *
142 * 07 17 2019 actory.ou
143 * [MOLY00422431] [CCCI] support CMPT_Write & CCCI FS/NVRAM decouple
144 * [VMOLY][OA] NVRAM/CCCI decouple & CMPT_Write function ready
145 *
146 * 06 26 2019 actory.ou
147 * [MOLY00416725] [Gen97][PCIe] support channel exception flow over PCIe
148 * [VMOLY][OA] support exception flow at PCIe platform
149 *
150 * 06 10 2019 actory.ou
151 * [MOLY00412620] [Gen97][LTO] fix LTO warning in link.log
152 * [VMOLY][OA] fix ccci_except_hmu_init return type
153 *
154 * 04 29 2019 actory.ou
155 * [MOLY00395176] [Thin Modem 1.0][PCIe platform] PCIe Platform 1st Release on Apollo
156 * [VMOLY][Trunk][OA] Disable assert bit for CCCI_SYSTEM_CHANNEL
157 *
158 * 04 19 2019 actory.ou
159 * [MOLY00395176] [Thin Modem 1.0][PCIe platform] PCIe Platform 1st Release on Apollo
160 * [PCIe][OA][CCCI] support pcie thin modem 1.0
161 *
162 * 01 16 2019 actory.ou
163 * [MOLY00379581] [Gen97][CCCI] UMOLYE patch back VMOLY activity
164 * [VMOLY.SEPT][OA] ccci patch back activity from UMOLYE
165 *
166 * 12 24 2018 actory.ou
167 * [MOLY00370278] MD early exception dump for P Migration
168 * [LR13.R1] add API for memdump timeout.
169 *
170 * 08 21 2018 actory.ou
171 * [MOLY00346566] [Gen97][L1S_L1DISABLE_SAP] boot to idle sync
172 * [CCCI] boot to idle patch
173 *
174 * 08 16 2018 actory.ou
175 * [MOLY00345375] [Gen97] Landing NCCCI (Next gen CCCI)
176 * [VMOLY] add nccci ncccisrv nccci_it_ctrl
177 *
178 * 07 24 2018 actory.ou
179 * [MOLY00341790] [MT6295] UDC feature patch back
180 * add UDC feature ID and tty channel / replace ccci spinlock with HWITC
181 *
182 * 04 30 2018 actory.ou
183 * [MOLY00322994] [ccci] add dummy task to help dispatch CR
184 * [dummy module] add AP CCCI/HMU/MD CCCI module ID
185 *
186 * 04 30 2018 actory.ou
187 * [MOLY00322002] [System Service][MOLY Kernel Internal Request] AMMS_POS
188 * [ccci] add POS SHM feature id
189 *
190 * 03 22 2018 actory.ou
191 * [MOLY00315592] ?M-TEE‘ã??release patchapply for mt6771 Mtee patch combined codebase - MD_CCCI
192 * [TRUNK][ccci] add for MTEE/MD SHM allocation
193 *
194 * 09 18 2017 chien-hui.lu
195 * [MOLY00278321] [CCCI][SCPCCISM] CCCI support MD<->SCP transmission on Gen93
196 * [CCCITTY][CCCI] support MD<->SCP transmission.
197 *
198 * 09 07 2017 chien-hui.lu
199 * [MOLY00276510] [CCCI][CCCI_SYS_MSG] modify CCCI system message send ilm 4 bytes
200 * [CCCI][CCCI_SYS_MSG] prevent ccci common ilm 4B potential risk.
201 *
202 * 04 05 2017 chien-hui.lu
203 * [MOLY00239611] [CCCI_IPC][CCCI] add CCCI IPC and runtime feature
204 * [CCCI][CCCI_IPC] add runtime feature and IPC config for DPFM.
205 *
206 * 01 24 2017 chien-hui.lu
207 * [MOLY00226584] [CCCI] add runtime data support feature
208 * add runtime data feature ID for Modem PHY Capture and MD<->WiFi direct path.
209 *
210 * 01 06 2017 chien-hui.lu
211 * [MOLY00220000] merge CSCD into trunk
212 * [CCCI] add CSCD compile flag for AP MD PEER ID enum.
213 *
214 * 01 06 2017 chien-hui.lu
215 * [MOLY00220000] merge CSCD into trunk
216 * [CCCI] add CSCD compile flag for AP MD PEER ID enum.
217 *
218 * 12 12 2016 chien-hui.lu
219 * [MOLY00201881] [CCISM] CCISM support in UMOLYA
220 * [CCCI][CCISM] modify feature ID for CCISM SHM support
221 *
222 * 11 23 2016 ap.wang
223 * [MOLY00210820] [HMU] Add exception step
224 * .
225 *
226 * 11 18 2016 chien-hui.lu
227 * [MOLY00201881] [CCISM] CCISM support in UMOLYA
228 * [CCISM] add CCISM exception mode share memory.
229 *
230 * 10 06 2016 cs.huang
231 * [MOLY00204808] [CCCI] Support multi-mpu setting
232 * [CCCI] multi MPU
233 *
234 * [MOLY00204430] [CCCI] MT6293 change
235 * [CCCI] Add 93 change
236 *
237 * 07 19 2016 cs.huang
238 * [MOLY00185754] [CCB] Porting to UMOLY trunk
239 * [CCCI] Support CCB
240 *
241 * 06 29 2016 ap.wang
242 * [MOLY00187298] [CCCI] LWA related check in
243 * .
244 *
245 *
246 *
247 * 06 01 2016 cs.huang
248 * [MOLY00182647] [CCCI] Fast CCCI header
249 * [CCCI] Fast CCCI header
250 *
251 * 04 20 2016 cs.huang
252 * [MOLY00173829] [CCCI] Add a new CCCI misc info for customer
253 * [CCCI] Add customer misc id
254 *
255 * 03 29 2016 cs.huang
256 * [MOLY00171352] [WW FT][MT6755][Jade-M][H3G][UK][VoLTE][SQC Excluded] No "manage conference" menu
257 * [CCCI] Add runtime data id for MTU size
258 *
259 * 01 25 2016 cs.huang
260 * [MOLY00162367] [CCISM] add CCISM
261 * [CCCI] Add CCISM related code
262 *
263 * 12 28 2015 cs.huang
264 * [MOLY00154045] [MT6797] EPOF code submission - query AP feature id
265 * [CCCI] Add runtime data AP_CCCI_RUNTIME_EE_AFTER_EPOF
266 *
267 * 12 21 2015 cs.huang
268 * [MOLY00154045] [MT6797] EPOF code submission - query AP feature id
269 * [CCCI] Add runtime data AP_CCCI_RUNTIME_EE_AFTER_EPOF
270 *
271 *
272 * 11 10 2015 cs.huang
273 * [MOLY00148746] [HMU] Check timer feature
274 * [CCCI] HMU check timer feature
275 *
276 * 11 03 2015 cs.huang
277 * [MOLY00147959] [CCCI] Support error code
278 * [CCCI] Support error code
279 *
280 * 10 27 2015 cs.huang
281 * [MOLY00146877] [CLDMA Core] Add Duplicated GPD detection mechanism
282 * [CCCI] Add HIF pattern in CCCI IOR structure
283 *
284 * 10 12 2015 cs.huang
285 * [MOLY00143927] [System Software] save MD bootup address from AP for EMI MPU violation debugging
286 * [CCCI] Add AP runtime data id : AP_CCCI_RUNTIME_MD_IMG_INFO
287 *
288 * 09 25 2015 cs.huang
289 * [MOLY00143226] [CCCI] Add boot up trace for debugging CCCI HS1
290 * [CCCI] Add boot up trace for debugging CCCI HS1
291 *
292 * 08 06 2015 cs.huang
293 * [MOLY00135464] [CCCI] New CCCI handshake flow
294 * [CCCI] New CCCI handshake flow
295 *
296 * 08 06 2015 cs.huang
297 * [MOLY00135464] [CCCI] New CCCI handshake flow
298 * [CCCI] New CCCI handshake flow
299 *
300 * 08 05 2015 cs.huang
301 * [MOLY00135462] [Jade] CLDMACORE task logging callback function activity
302 * [CCCI] Add CLDMA debug exception share memory ID.
303 *
304 * 08 04 2015 cs.huang
305 * [MOLY00122361] [6291 plus][CCCI] Merge PCore/L1Core
306 * [CCCI] Merge common header
307 *
308 *
309 * 06 18 2015 cs.huang
310 * [MOLY00122361] [6291 plus][CCCI] Merge PCore/L1Core
311 * [CCCI] Merge common header
312 * 04 13 2015 cs.huang
313 * [MOLY00106914] [C2K IRAT][CCCI] Add CCCI misc info id for C2K
314 * [CCCI] Add CCCI misc info id for C2K
315 *
316 * 01 14 2015 cs.huang
317 * [MOLY00092037] [CCCI] Fix UMOLY Trunk build error
318 * Fix build error.
319 *
320 * 01 13 2015 cs.huang
321 * [MOLY00092037] [CCCI] Fix UMOLY Trunk build error
322 * Fix build error
323 *
324 * 01 12 2015 cs.huang
325 * [MOLY00092037] [CCCI] Fix UMOLY Trunk build error
326 * Fix CCCI build error
327 *
328 * 01 12 2015 cs.huang
329 * [MOLY00092037] [CCCI] Fix UMOLY Trunk build error
330 * Fix CCCI build error
331 *
332 * 12 25 2014 i-wei.tsai
333 * [MOLY00088926] IMS dedicate mux channel support
334 * fix error
335 *
336 * 12 10 2014 cs.huang
337 * [MOLY00080351] [MT6291][CCCI] Add L1Core CCCI service (CCCI SYSMSG/RPC/IPC)
338 * [CCCI] Add L1Core RPC/IPC debug seq
339 *
340 ****************************************************************************/
341#ifndef _CCCI_IF_H
342#define _CCCI_IF_H
343
344#include "kal_public_api.h"
345#include "ccci_ch_cfg.h"
346#include "hif_ior.h"
347#include "qmu_bm.h"
348
349#define __OLD_CCCI_HS_FLOW__
350#define __NEW_CCCI_HS_FLOW__
351#define __FAST_CCCI_HEADER__
352/*!
353 * @brief __CCCI_N_USE_TGPD_EXT__
354 * 20120925 perfer to use TGPD extension for CCCI_HEADER
355 * if defined __CCCI_N_USE_GPD_EXT__, use buff part.
356 */
357//#define __CCCI_N_USE_TGPD_EXT__
358
359/*!
360 * @brief __CCCI_PERF_PROFILING__
361 * 20120924 compile option for performance profiling
362 */
363//#define __CCCI_PERF_PROFILING__
364
365/*!
366 * @brief __CCCI_LB_IT__
367 * 20120805 compile option for Smartphone AP IT
368 */
369//#define __CCCI_LB_IT__ defined in hif_ccci.mak
370
371/*!
372 * @brief __CCCI_GPD_LEAK_DBG__ debug for gpd leak
373 * 20120604 solved the leak in HIF SDIO SIM
374 */
375//#define __CCCI_GPD_LEAK_DBG__
376
377/*!
378 * @brief __SDIOC_PULL_Q_ENH_DL__
379 * 20121001 enable this to enhance the hif poll DL queue performance
380 * Do the poll queue only if the hwo gpd count > 0
381 */
382#define __SDIOC_PULL_Q_ENH_DL__
383
384/*!
385 * @brief FS_CCCI_MAX_BUF_SIZE max buffer size of CCCI_FS
386 * Note: user cannot send/request buffer larger than this size
387 * (CCCI_Header) (FS_OP_ID) (ARGC) (MAX_ARG_NUM* Len) (MAX_ARG_NUM* value_len)(FS_BUFF)
388 * (16) (4) (4) (6*4) (6*4) (16KB)
389 * Tail buffer for 4B aligned: 128
390 */
391#define FS_CCCI_MAX_USER_BUFF 16384
392#define FS_CCCI_REQ_BUFFER_NUM 5 /* support 5 concurrently request*/
393#define FS_CCCI_MAX_ARG_NUM 6 /* parameter number */
394#define FS_CCCI_MAX_BUF_SIZE (16+4+4+FS_CCCI_MAX_ARG_NUM*4*2+FS_CCCI_MAX_USER_BUFF+128)
395#define FS_CCCI_POLLING_BUFF_SIZE QBM_SIZE_CCCI_COMM
396
397/*!
398 * @brief Current MT6280 design only defines
399 * the max Tx/Rx GPD size as 4KB for non-network user
400 * the max Tx/Rx GPD size as 2KB for network user
401 */
402#define CCCI_UL_BUF_TYPE QBM_TYPE_CCCI_COMM // non-network user RGPD
403#define CCCI_DL_BUF_TYPE QBM_TYPE_CCCI_COMM // non-network user TGPD, ccci_write won't flush data must bmcfg_cache_invalid(KAL_TRUE)
404#define CCCI_DL_SYSMSG_BUF_TYPE QBM_TYPE_TGPD // for QBM pool shrink, ccci_write should flush data
405
406#define CCCI_MTU_SIZE (3584-sizeof(CCCI_BUFF_T))
407#define CCCI_HEADER_SIZE (sizeof(CCCI_BUFF_T))
408
409/*!
410 * @brief CCCI_RETURNVAL_T CCCI API return value enum
411 */
412typedef enum
413{
414 CCCI_SUCCESS = 0,
415 CCCI_FAIL = -1001,
416 CCCI_IN_USE = -1002,
417 CCCI_NOT_OWNER = -1003,
418 CCCI_INVALID_PARAM = -1004,
419 CCCI_NO_PHY_CHANNEL = -1005,
420 CCCI_IN_LISR = -1006,
421 CCCI_NO_DATA = -1007,
422 CCCI_NOT_SUPPORT = -1008
423} CCCI_RETURNVAL_T;
424
425/*!
426 * @brief CCCI_MAILBOX_T CCCI mailbox channel structure struct
427 */
428typedef struct
429{
430 kal_uint32 magic; /* 0xFFFFFFFF */
431 kal_uint32 id;
432 kal_uint32 channel:16;
433 kal_uint32 seq:15;
434 kal_uint32 assert_bit:1;
435 kal_uint32 reserved;
436} CCCI_MAILBOX_T;
437
438/*!
439 * @brief CCCI_STREAM_T CCCI stream channel structure struct
440 */
441typedef struct
442{
443 kal_uint32 addr;
444 kal_uint32 len;
445 kal_uint32 channel:16;
446 kal_uint32 seq:15;
447 kal_uint32 assert_bit:1;
448 kal_uint32 reserved;
449} CCCI_STREAM_T;
450
451/*!
452 * @brief CCCI_BUFF_T CCCI channel buffer structure struct
453 */
454typedef struct
455{
456 kal_uint32 data[2]; /* data[1]: length including the CCCI_BUFF_T*/
457 kal_uint32 channel:16;
458 kal_uint32 seq:15;
459 kal_uint32 assert_bit:1;
460 kal_uint32 reserved;
461} CCCI_BUFF_T;
462
463/*!
464 * @brief CCCI_UNION_HDR_T CCCI header union to resolve LTO issue
465 */
466typedef union{
467 CCCI_BUFF_T ccci_buff;
468 CCCI_STREAM_T ccci_stream;
469 CCCI_MAILBOX_T ccci_mailbox;
470} CCCI_UNION_HDR_U;
471
472typedef struct
473{
474 kal_uint8 ref_count;
475 kal_uint16 msg_len;
476 kal_uint32 W0;
477} CCCI_COMMON_ILM_4B;
478
479typedef struct
480{
481 kal_uint8 ref_count;
482 kal_uint16 msg_len;
483 kal_uint16 HW0;
484} CCCI_COMMON_ILM_2B;
485
486/*!
487 * @brief CCCI_SYSMSG_DEST_E CCCI SYSMSG Destination Definition enum
488 */
489typedef enum
490{
491 CCCI_SYSMSG_DEST_MIN = 0,
492 CCCI_SYSMSG_DEST_AP = CCCI_SYSMSG_DEST_MIN,
493 CCCI_SYSMSG_DEST_EAP = 1,
494 CCCI_SYSMSG_DEST_NOT_SUPPORT = 2,
495 CCCI_SYSMSG_DEST_MAX,
496} CCCI_SYSMSG_DEST_E;
497
498#undef X_CCCI_SYSMSGSVC_CONF
499#define X_CCCI_SYSMSGSVC_CONF(mSGNO, mODE, iD, dest) mSGNO,
500/*!
501 * @brief CONTROL_CHANNEL_MSG
502 * CCCI Message ID Passing Through CONTROL_CHANNEL and SYSTEM_CHANNEL
503 * NOTICE: Negotiations With AP Owner Before Modification
504 */
505typedef enum
506{
507 CCMSG_ID_START_BOOT = 0x00000000,
508 CCMSG_ID_NORMAL_BOOT_READY = 0x00000001,
509 CCMSG_ID_META_BOOT_READY = 0x00000002,
510 CCMSG_ID_RESET = 0x00000003,
511 CCMSG_ID_EXCEPTION_CHECK = 0x00000004,
512 CCMSG_ID_DRV_VERSION_ERR = 0x00000005,
513 CCMSG_ID_EXCEPTION_REC_OK = 0x00000006,
514 CCMSG_ID_EXCEPTION_PASS = 0x00000008,
515 CCMSG_ID_PORT_SETTING = 0x00000009,
516 /* System Channel */
517 CCMSG_ID_MD_L4_MOD = 0x0000000E,//add for RIL (AP task) and L4C (MD task) communication message
518 CCMSG_ID_MD_L4_MAX_TX_PWR_RED_REQ = 0x0000000F,
519
520 CCMSG_ID_MD_LEGACY_END = 0x000000FF,
521 CCMSG_ID_SYSMSGSVC_MASK = 0x00000100,
522 CCMSG_ID_SYSMSGSVC_START = 0x00000100,
523 CCMSG_ID_SYSMSGSVC_DUMMY = 0x000000FF,
524 //- section 0x100 ~ 0x1FF : reserved for system message service used
525 #include "ccci_sysmsgsvc_conf.h"
526
527 CCMSG_ID_SYSMSGSVC_END,
528
529 CCMSG_ID_MD_WDT_FLAG = 0x00001000, //- for MT6577/MT6589, AP cannot receive MD WDT interrupt issue. k2 md2 6589, for resolving wdt build error
530
531}CONTROL_CHANNEL_MSG;
532#undef X_CCCI_SYSMSGSVC_CONF
533
534typedef struct MISC_INFO_ELEMENT_T
535{
536 kal_uint32 Feature[4];
537}MISC_INFO_ELEMENT;
538
539typedef struct MISC_INFO_DATA_T
540{
541 kal_uint32 MiscPrefix; // "MISC"
542 kal_uint32 SupportMask;
543 kal_uint32 Index;
544 kal_uint32 Next;
545 MISC_INFO_ELEMENT element[16];
546 kal_uint32 Reserve[3];
547 kal_uint32 MiscPostfix; // "MISC"
548}MISC_INFO_DATA;
549
550/*!
551 * @brief MODEM_RUNTIME_DATA CCCI MD runtime enum
552 */
553typedef struct MODEM_RUNTIME_DATA_T
554{
555 kal_uint8 Prefix[4]; // "CCIF" for compatible to 6280
556 kal_uint8 Platform[8]; // Hardware Platform String ex: "MT6516E1"
557 kal_uint32 DriverVersion; // 0x00000929 since W09.29
558 kal_uint32 BootChannel; // Channel to ACK AP with boot ready
559 kal_uint32 BootingStartID; // MD is booting. NORMAL_BOOT_ID or META_BOOT_ID or early exception memory dump
560 kal_uint32 BootAttributes; // Attributes passing from AP to MD Booting
561 kal_uint32 BootReadyID; // MD response ID if boot successful and ready ,
562 // Cannot equal to CCMSG_ID_DRV_VERSION_ERR
563 kal_uint32 FileShareMemBase;
564 kal_uint32 FileShareMemSize;
565 kal_uint32 ExceShareMemBase;
566 kal_uint32 ExceShareMemSize; // 512 Bytes Required
567 kal_uint32 CCIFShareMemBase;
568 kal_uint32 CCIFShareMemSize; // CCIF share queue size
569 kal_uint32 DHLShareMemBase; // For DHL
570 kal_uint32 DHLShareMemSize;
571 kal_uint32 MD1MD3ShareMemBase; // For MD1 MD3 share memory
572 kal_uint32 MD1MD3ShareMemSize;
573 kal_uint32 CCISMShareMemBase;
574 kal_uint32 CCISMShareMemSize;
575 kal_uint32 CCISMExptShareMemBase;
576 kal_uint32 CCISMExptShareMemSize;
577 kal_uint32 TotalShareMemBase;
578 kal_uint32 TotalShareMemSize;
579 kal_uint32 CheckSum;
580 kal_uint8 Postfix[4]; //"CCIF" for compatible to 6280
581 MISC_INFO_DATA MiscInfo;
582}MODEM_RUNTIME_DATA;
583
584#define CCCI_RUNTIME_FEATURE_MAX 64
585#if defined(__CCCI_PRODUCT_TYPE_PCIE_THIN_MODEM__) //PCIe interface
586 #define CCCI_RUNTIME_FEATURE_ID_MAX EAP_CCCI_RUNTIME_FEATURE_ID_MAX
587#else //SOC configuration
588 #define CCCI_RUNTIME_FEATURE_ID_MAX AP_CCCI_RUNTIME_FEATURE_ID_MAX
589#endif
590
591//boot-up CPU(sAP/eAP)
592typedef enum{
593 CCCI_BOOT_UP_HS_HOST_MIN,
594 CCCI_BOOT_UP_HS_HOST_AP = CCCI_BOOT_UP_HS_HOST_MIN,
595 #if defined(__CCCI_PRODUCT_TYPE_PCIE_THIN_MODEM__) //PCIe Thin Modem interface
596 CCCI_BOOT_UP_HS_HOST_EAP,
597 #endif
598 CCCI_BOOT_UP_HS_HOST_MAX,
599} CCCI_BOOT_UP_HS_HOST;
600
601typedef enum {
602 CCCI_HOST_HS_DONE_BROADCAST_ID_MIN = 0,
603 CCCI_HOST_HS_DONE_BROADCAST_ID_LHIF = CCCI_HOST_HS_DONE_BROADCAST_ID_MIN,
604 CCCI_HOST_HS_DONE_BROADCAST_ID_CCCITTY,
605 CCCI_HOST_HS_DONE_BROADCAST_ID_MAX
606} CCCI_HOST_HS_DONE_BROADCAST_ID_E;
607
608typedef struct AP_RUNTIME_DATA_T
609{
610 kal_uint8 Prefix[4]; // "ICCC"
611 kal_uint8 APQueryFeature[CCCI_RUNTIME_FEATURE_MAX];
612 kal_uint32 SHMSupport;
613 kal_uint32 APRuntimeDataAddr;
614 kal_uint32 APRuntimeDataSize;
615 kal_uint32 MDRuntimeDataAddr;
616 kal_uint32 MDRuntimeDataSize;
617 kal_uint32 SetMDMPUStartAddr;
618 kal_uint32 SetMDMPUTotalSize;
619 kal_uint8 Postfix[4]; //"ICCC"
620}AP_RUNTIME_DATA;
621
622typedef struct AP_RUNTIME_DATA_V2_T
623{
624 kal_uint8 Prefix[4]; // "ICCC"
625 kal_uint8 APQueryFeature[CCCI_RUNTIME_FEATURE_MAX];
626 kal_uint32 SHMSupport;
627 kal_uint32 APRuntimeDataAddr;
628 kal_uint32 APRuntimeDataSize;
629 kal_uint32 MDRuntimeDataAddr;
630 kal_uint32 MDRuntimeDataSize;
631 kal_uint8 MPUSetting[64];
632 kal_uint8 Postfix[4]; //"ICCC"
633}AP_RUNTIME_DATA_V2;
634
635typedef struct MD_RUNTIME_DATA_T
636{
637 kal_uint8 Prefix[4]; // "CCCI"
638 kal_uint8 MDQueryFeature[CCCI_RUNTIME_FEATURE_MAX];
639 kal_uint8 Postfix[4]; //"CCCI"
640}MD_RUNTIME_DATA;
641
642#undef CCCI_RUNTIME_FEATURE_SUPPORT_CONF
643#undef CCCI_RUNTIME_FEATURE_SUPPORT_ID_ONLY
644#define CCCI_RUNTIME_FEATURE_SUPPORT_CONF(_id, _support, _version) _id,
645#define CCCI_RUNTIME_FEATURE_SUPPORT_ID_ONLY(_id) _id,
646typedef enum{
647 #include "ccci_config_feature_id.h"
648} AP_CCCI_RUNTIME_FEATURE_ID;
649#undef CCCI_RUNTIME_FEATURE_SUPPORT_CONF
650#undef CCCI_RUNTIME_FEATURE_SUPPORT_ID_ONLY
651
652typedef enum{
653 // New id add here
654#if !defined(__MTK_TARGET__) && defined(ATEST_SYS_ENABLE) // for UT
655 MD_CCCI_RUNTIME_UT_TEST,
656#endif
657 MD_CCCI_RUNTIME_FEATURE_ID_MAX,
658} MD_CCCI_RUNTIME_FEATURE_ID;
659
660typedef enum{
661 MD_EAP_CCCI_RUNTIME_PORT_SETTING,
662 // New id add here
663#if !defined(__MTK_TARGET__) && defined(ATEST_SYS_ENABLE) // for UT
664 MD_EAP_CCCI_RUNTIME_UT_TEST,
665#endif
666 MD_EAP_CCCI_RUNTIME_FEATURE_ID_MAX,
667} MD_EAP_CCCI_RUNTIME_FEATURE_ID;
668
669typedef enum{
670 CCCI_RUNTIME_FEATURE_NOT_EXIST = 0,
671 CCCI_RUNTIME_FEATURE_NOT_SUPPORT = 1,
672 CCCI_RUNTIME_FEATURE_MUST_SUPPORT = 2,
673 CCCI_RUNTIME_FEATURE_OPTIONAL_SUPPORT = 3,
674 CCCI_RUNTIME_FEATURE_SUPPORT_BACKWARD_COMPAT = 4,
675}CCCI_RUNTIME_FEATURE_SUPPORT_TYPE;
676
677typedef struct
678{
679 kal_uint8 support_mask:4;
680 kal_uint8 version:4;
681} CCCI_RUNTIME_FEATURE_SUPPORT_T;
682
683typedef struct
684{
685 kal_uint8 feature_id; // for debug only
686 CCCI_RUNTIME_FEATURE_SUPPORT_T support_info; //1B
687 kal_uint8 reserved[2];
688 kal_uint32 data_length;
689 kal_uint32 data[0];
690} CCCI_RUNTIME_FEATURE_FORMAT_T;
691
692typedef struct
693{
694 kal_uint32 addr;
695 kal_uint32 size;
696} CCCI_RUNTIME_SHARE_MEMORY_FORMAT_T;
697
698typedef struct
699{
700 CCCI_RUNTIME_SHARE_MEMORY_FORMAT_T ctrl_buffr;
701 CCCI_RUNTIME_SHARE_MEMORY_FORMAT_T data_buffr;
702} CCB_SHARE_MEMORY_FORMAT_T;
703
704typedef struct
705{
706 CCCI_RUNTIME_SHARE_MEMORY_FORMAT_T udc_buf;
707 CCCI_RUNTIME_SHARE_MEMORY_FORMAT_T udc_tbl;
708} UDC_SHARE_MEMORY_FORMAT_T; //runtime data #31- add for UDC share memory (User: Cammie, Chi-Yen)
709
710typedef struct
711{
712 kal_uint32 BootChannel; // Channel to ACK AP with boot ready
713 kal_uint32 BootingStartID; // MD is booting. NORMAL_BOOT_ID or META_BOOT_ID or early exception memory dump
714 kal_uint32 BootAttributes; // Attributes passing from AP to MD Booting
715 kal_uint32 BootReadyID; // MD response ID if boot successful and ready ,
716} CCCI_RUNTIME_BOOT_INFO_FORMAT_T;
717
718typedef struct
719{
720 kal_uint8 mini_dump_flag;
721 kal_uint8 midr_dump_flag;
722 kal_uint16 reserved;
723} CCCI_RUNTIME_DHL_MISC_INFO_T;
724
725typedef enum{
726 CCCI_FA_UNKNOWN_ERROR = 0x000,
727 CCCI_FA_MD_NO_RESPONSE = 0x100,
728 CCCI_FA_HMU_DSP_TIMER_BROKEN= 0x101,
729 CCCI_FA_HMU_GPT_TIMER_BROKEN= 0x102,
730 CCCI_FA_MD_SEQ_ERROR = 0x200,
731 CCCI_FA_AP_SEQ_ERROR = 0x201,
732 CCCI_FA_AP_DATA_PATH_ERROR = 0x300,
733 CCCI_FA_USR_TRIGGER = 0x400,
734}CCCI_FORCE_ASSERT_ERROR_CODE;
735
736/*!
737 * @brief ccci_io_req_type_e Type of operation to for requests to submit to HIF.
738 * @param CCCI_IO_TX_NO_FLUSH Transmit operation without GPD checksum calcuation and cache flush.
739 */
740typedef enum _ccci_io_req_type {
741 CCCI_IO_TX_NO_FLUSH = 0x00000010,
742 CCCI_IO_TYPE_DUMMY = 0x7fffffff
743} ccci_io_req_type_e;
744
745/*!
746 * @brief ccci_io_ext_info_t Configurations apply to the requests to submit to HIF.
747 * @param type Type of operation.
748 */
749typedef struct _ccci_io_ext_info {
750 ccci_io_req_type_e type;
751} ccci_io_ext_info_t;
752
753/*!
754 * @brief CCCI_STATE_T CCCI status enum
755 */
756typedef enum
757{
758 CCCI_IDLE = 0x00,
759 CCCI_ACTIVE_READ = 0x01,
760 CCCI_ACTIVE_WRITE = 0x02,
761 CCCI_ACTIVE_ISR = 0x04
762} CCCI_STATE_T;
763
764
765#ifdef __SDIOC_PULL_Q_ENH_DL__
766/*!
767 * @brief ccci_io_request_t is a typedef of struct _ccci_io_request_t
768 */
769typedef struct _ccci_io_request_t ccci_io_request_t;
770/*!
771 * @brief struct _ccci_io_request_t describe io request used to communicate
772 * between ccci_sdio modules
773 */
774struct _ccci_io_request_t {
775 /*!
776 * @brief next io request
777 */
778 ccci_io_request_t* next_request;
779 /*!
780 * @brief pointer to current gpd of this io request
781 */
782 qbm_gpd* first_gpd;
783 /*!
784 * @brief pointer to last gpd of this io request
785 */
786 qbm_gpd* last_gpd;
787 /*!
788 * @brief number of the gpd in this ior
789 */
790 kal_int16 num_gpd;
791 /*!
792 * @brief hif forbidden pattern for duplicated GPD detection
793 */
794 kal_uint16 hif_forbidden;
795};
796#else
797#define ccci_io_request_t hif_io_request_t
798#endif
799
800typedef enum _CCCI_EXPT_STATE
801{
802 CCCI_EXPT_INVALID_ST,
803 CCCI_EXPT_INIT_CCCITTY_DEV_ST,
804 CCCI_EXPT_INIT_ST,
805 CCCI_EXPT_CLEAR_CH_ST,
806 CCCI_EXPT_HANDSHAKE_START_ST,
807 CCCI_EXPT_HANDSHAKE_TX_START_ST,
808 CCCI_EXPT_HANDSHAKE_TX_DONE_ST,
809 CCCI_EXPT_HANDSHAKE_RX_START_ST,
810 CCCI_EXPT_HANDSHAKE_RX_DONE_ST,
811 CCCI_EXPT_HANDSHAKE_DONE_ST,
812 CCCI_EXPT_INFO_PASS_PRE_START_ST,
813 CCCI_EXPT_INFO_PASS_PRE_DONE_ST,
814 CCCI_EXPT_INFO_PASSED_START_ST,
815 CCCI_EXPT_INFO_PASSED_DONE_ST,
816 CCCI_EXPT_STATE_MAX
817} CCCI_EXPT_STATE_E;
818
819typedef enum {
820 CCCI_EXCEP_DBG_HS_CCCI_FS_WAIT_TIME_POLLING = 0,
821 CCCI_EXCEP_DBG_HS_CCCI_FS_WAIT_TIME_NORMAL_CARRY, // wait time is double, H32 is high 32 bit value
822 CCCI_EXCEP_DBG_HS_CCCI_FS_WAIT_TIME_NORMAL, // wait time is double, L32 is low 32 bit value
823 CCCI_EXCEP_DBG_HS_CCCI_FS_TRACE,
824 CCCI_EXCEP_DBG_HS_CCCI_RPC_WAIT_TIME_POLLING,
825 CCCI_EXCEP_DBG_HS_CCCI_RPC_WAIT_TIME_NORMAL_CARRY, // wait time is double, H32 is high 32 bit value
826 CCCI_EXCEP_DBG_HS_CCCI_RPC_WAIT_TIME_NORMAL, // wait time is double, L32 is low 32 bit value
827 CCCI_EXCEP_DBG_HS_CCCI_RPC_TRACE,
828 CCCI_EXCEP_DBG_HS_BOOTTRC_WAIT_TIME,
829 CCCI_EXCEP_DBG_HS_CCCI_DEBUG_CHANNEL,
830 CCCI_EXCEP_DBG_HS_CCCI_DEBUG_CURRENT_SEQ_NUM,
831 CCCI_EXCEP_DBG_HS_CCCI_DEBUG_EXPECTED_SEQ_NUM,
832 CCCI_EXCEP_DBG_HS_CMUX_GPD_PROFILE_NUM,
833 CCCI_EXCEP_DBG_HS_CCCI_FS_ERROR_LINE,
834 CCCI_EXCEP_DBG_HS_CCCI_FS_ERROR_PARAM1,
835 CCCI_EXCEP_DBG_HS_CCCI_FS_ERROR_PARAM2,
836 CCCI_EXCEP_DBG_HS_CCCI_FS_ERROR_PARAM3,
837 CCCI_EXCEP_DBG_HS_CCCI_CLDMA_TX_CB,
838 CCCI_EXCEP_DBG_HS_CCCI_CLDMA_RX_CB,
839 CCCI_EXCEP_DBG_STEP,
840 CCCI_EXCEP_DBG_EXPT_HS_CHANNEL,
841 CCCI_EXCEP_DBG_EXPT_HS_POLLING_TIMEOUT,
842 CCCI_EXCEP_DBG_HS_LOG_MAX,
843} CCCI_EXCEP_DBG_HS_INDEX;
844
845#undef X_CCCI_EXCEP_MEMORY_CONF
846#define X_CCCI_EXCEP_MEMORY_CONF(region, length) region,
847typedef enum
848{
849#include "ccci_excep_memory_region.h"
850 CCCI_EXCEP_MEMORY_REGION_MAX
851} CCCI_EXCEP_MEMORY_REGION;
852#undef X_CCCI_EXCEP_MEMORY_CONF
853
854typedef enum {
855 CCCI_EXCEP_MEMORY_TYPE_SHM,
856 CCCI_EXCEP_MEMORY_TYPE_STATIC_BUFFER,
857 CCCI_EXCEP_MEMORY_TYPE_MAX
858} CCCI_EXCEP_MEMORY_TYPE;
859
860typedef enum
861{
862 CCCI_DEBUG_GET_STATUS_MODULE_L1TIME = 0x0,
863 CCCI_DEBUG_GET_STATUS_MODULE_CCCIFS,
864 CCCI_DEBUG_GET_STATUS_MODULE_CCCIRPC,
865 CCCI_DEBUG_GET_STATUS_MODULE_CCCIIPC,
866 CCCI_DEBUG_GET_STATUS_MODULE_CCMNI,
867 CCCI_DEBUG_GET_STATUS_MODULE_CCCITTY,
868 CCCI_DEBUG_GET_STATUS_MODULE_CCCIIMS,
869 CCCI_DEBUG_GET_STATUS_MODULE_CCCISEQ,
870 CCCI_DEBUG_GET_STATUS_MODULE_MAX
871} CCCI_DEBUG_GET_STATUS_MODULE;
872
873/* CCCI boot up trace step */
874typedef enum
875{
876 CCCI_BOOT_UP_TRACE_START = 0x200, // need to align with SS
877 CCCI_BOOT_UP_TRACE_HW_INIT_ENTER = CCCI_BOOT_UP_TRACE_START, // 0x200
878 CCCI_BOOT_UP_TRACE_HW_INIT_LEAVE, // 0x201
879 CCCI_BOOT_UP_TRACE_HS1_1_ENTER, // 0x202
880 CCCI_BOOT_UP_TRACE_HS1_1_START_TX, // 0x203
881 CCCI_BOOT_UP_TRACE_HS1_1_TX_TIMEOUT, // 0x204
882 CCCI_BOOT_UP_TRACE_HS1_1_START_RX, // 0x205
883 CCCI_BOOT_UP_TRACE_HS1_1_RX_TIMEOUT, // 0x206
884 CCCI_BOOT_UP_TRACE_HS1_1_TRANSMISSION_DONE, // 0x207
885 CCCI_BOOT_UP_TRACE_HS1_1_LEAVE, // 0x208
886 CCCI_BOOT_UP_TRACE_HS1_2_ENTER, // 0x209
887 CCCI_BOOT_UP_TRACE_HS1_2_START_TX, // 0x20a
888 CCCI_BOOT_UP_TRACE_HS1_2_TX_TIMEOUT, // 0x20b
889 CCCI_BOOT_UP_TRACE_HS1_2_START_RX, // 0x20c
890 CCCI_BOOT_UP_TRACE_HS1_2_RX_TIMEOUT, // 0x20d
891 CCCI_BOOT_UP_TRACE_HS1_2_TRANSMISSION_DONE, // 0x20e
892 CCCI_BOOT_UP_TRACE_HS1_2_LEAVE, // 0x20f
893 CCCI_BOOT_UP_TRACE_HW_INIT2_ENTER, // 0x210
894 CCCI_BOOT_UP_TRACE_HW_INIT2_LEAVE, // 0x211
895 CCCI_BOOT_UP_TRACE_HS2_1_ENTER, // 0x212
896 CCCI_BOOT_UP_TRACE_HS2_1_START_TX, // 0x213
897 CCCI_BOOT_UP_TRACE_HS2_1_TX_TIMEOUT, // 0x214
898 CCCI_BOOT_UP_TRACE_HS2_1_TRANSMISSION_DONE, // 0x215
899 CCCI_BOOT_UP_TRACE_HS2_1_LEAVE, // 0x216
900 CCCI_BOOT_UP_TRACE_HS2_2_ENTER, // 0x217
901 CCCI_BOOT_UP_TRACE_HS2_2_START_TX, // 0x218
902 CCCI_BOOT_UP_TRACE_HS2_2_TX_TIMEOUT, // 0x219
903 CCCI_BOOT_UP_TRACE_HS2_2_TRANSMISSION_DONE, // 0x21a
904 CCCI_BOOT_UP_TRACE_HS2_2_LEAVE, // 0x21b
905 CCCI_BOOT_UP_TRACE_HS1_2_SKIP, // 0x21c
906 CCCI_BOOT_UP_TRACE_HS2_2_SKIP, // 0x21d
907 CCCI_BOOT_UP_TRACE_MAX = 0x2FF, // need to align with SS
908} CCCI_BOOT_UP_TRACE_STEP;
909
910typedef enum
911{
912 AP_CCCI_RUNTIME_DATA_VERSION_UNKNOWN = 0,
913 AP_CCCI_RUNTIME_DATA_VERSION_OLD,
914 AP_CCCI_RUNTIME_DATA_VERSION_NEW_V1,
915 AP_CCCI_RUNTIME_DATA_VERSION_NEW_V2,
916 AP_CCCI_RUNTIME_DATA_VERSION_NEW_V2_WITHOUT_SHM,
917} AP_CCCI_RUNTIME_DATA_VERSION;
918
919/*!
920 * @brief CCCI_INIT_MAILBOX initialize a CCCI mailbox buffer
921 */
922#define CCCI_INIT_MAILBOX(buff, mailbox_id) \
923 do { \
924 ((CCCI_MAILBOX_T *)(buff))->magic = 0xFFFFFFFF; \
925 ((CCCI_MAILBOX_T *)(buff))->id = (mailbox_id); \
926 (buff)->channel = 0; \
927 (buff)->reserved = 0; \
928 } while (0)
929
930/*!
931 * @brief CCCI_INIT_STREAM initialize a CCCI stream buffer
932 */
933#define CCCI_INIT_STREAM(buff, stream_addr, stream_len) \
934 do { \
935 ((CCCI_STREAM_T *)(buff))->addr = (stream_addr); \
936 ((CCCI_STREAM_T *)(buff))->len = (stream_len); \
937 (buff)->channel = 0; \
938 (buff)->reserved = 0; \
939 } while (0)
940/*!
941 * @brief CCCI_IS_MAILBOX check the CCCI buffer type
942 */
943#define CCCI_IS_MAILBOX(buff) ((((CCCI_MAILBOX_T *)(buff))->magic == 0xFFFFFFFF)? 1: 0)
944
945/*!
946 * @brief CCCI_MAILBOX_ID get the id of the CCCI mailbox buffer
947 */
948#define CCCI_MAILBOX_ID(buff) (((CCCI_MAILBOX_T *)(buff))->id)
949
950/*!
951 * @brief CCCI_STREAM_ADDR get the addr of the CCCI stream buffer
952 */
953#define CCCI_STREAM_ADDR(buff) (((CCCI_STREAM_T *)(buff))->addr)
954/*!
955 * @brief CCCI_STREAM_LEN get the len of the CCCI stream buffer
956 */
957#define CCCI_STREAM_LEN(buff) (((CCCI_STREAM_T *)(buff))->len)
958/*!
959 * @brief CCCI_STREAM_SET_LEN get the len of the CCCI stream buffer
960 */
961#define CCCI_STREAM_SET_LEN(buff, stream_len) \
962 do { \
963 ((CCCI_STREAM_T *)(buff))->len = (stream_len); \
964 } while (0)
965/*!
966 * @brief CCCI_GET_CH_NO obtain the CCCI channel number
967 */
968#define CCCI_GET_CH_NO(buff) (((CCCI_BUFF_T *)(buff))->channel)
969/*!
970 * @brief CCCI_SET_CH_NO set the CCCI channel number
971 */
972#define CCCI_SET_CH_NO(buff, ch_no) \
973 do { \
974 ((CCCI_BUFF_T *)(buff))->channel = ch_no; \
975 } while (0)
976/*!
977 * @brief CCCI_SET_RESERVED set the CCCI reserved
978 */
979#define CCCI_SET_RESERVED(buff, reserved_d) \
980 do { \
981 ((CCCI_BUFF_T *)(buff))->reserved = reserved_d; \
982 } while (0)
983/*!
984 * @brief CCCI_GET_RESERVED get the CCCI reserved
985 */
986#define CCCI_GET_RESERVED(buff) (((CCCI_BUFF_T *)(buff))->reserved)
987
988#define CCCI_MISC_INFO_NOT_EXIST 0x00000000
989#define CCCI_MISC_INFO_NOT_SUPPORT 0x00000001
990#define CCCI_MISC_INFO_SUPPORT 0x00000002
991#define CCCI_MISC_INFO_PARTIALLY_SUPPORT 0x00000003
992
993#define PEER_ID_MASK 0xF000 // each peer range 0x0~0xFF
994#define PEER_CH_MASK 0x0FFF // each channel range is 0x0~0xFF
995
996#define GET_PEER_ID(_ch) ((_ch & PEER_ID_MASK) >> 12 )
997#define GET_PEER_CHANNEL(_ch) (_ch & PEER_CH_MASK)
998#define GET_VIRTUAL_CHANNEL(_peer_id, _ch) ((_peer_id << 12) | _ch) // peer_id + channel
999
1000#define BOOT_ATTR_IS_CLEAN_BOOT 0x00000001
1001
1002#define CCCI_DEBUG_ASSERT_BIT 1
1003#define CCCI_DEBUG_NOT_ASSERT_BIT 0
1004
1005typedef void (*CCCI_SYSMSGSVC_HISR_CALLBACK)(kal_uint32 param);
1006
1007/*!
1008 * @brief function pointer type for HIF CCCI callback function: called by HIF provided by CCCI
1009 * The CCCI will registers HIF_CCCI_GPD_CALLBACK/HIF_CCCI_BUFF_CALLBACK depending on the HIG IO mode
1010 */
1011typedef void (*HIF_CCCI_CALLBACK)(kal_uint8 queue_no, void* pior_or_pbuff);
1012/*!
1013 * @brief function pointer type for HIF CCCI callback function: called by HIF provided by CCCI for CCCI_CH_HIFIO_GPD
1014 */
1015typedef void (*HIF_CCCI_GPD_CALLBACK)(kal_uint8 queue_no, ccci_io_request_t* ior);
1016/*!
1017 * @brief function pointer type for HIF CCCI callback function: called by HIF provided by CCCI for CCCI_CH_HIFIO_BUFF
1018 */
1019typedef void (*HIF_CCCI_BUFF_CALLBACK)(kal_uint8 queue_no, CCCI_BUFF_T* pbuff);
1020
1021
1022/*!
1023 * @brief function pointer type for CCCI callback function: called by CCCI, provided by device/user registered by ccci_init
1024 */
1025typedef void (*CCCI_CALLBACK)(CCCI_BUFF_T *buff);
1026
1027/*!
1028 * @brief function pointer type for CCCI IOR callback function: called by CCCI, provided by GPD device (CCMNI/TTYCORE) registered by ccci_init_gpdior
1029 */
1030typedef void (*CCCI_IORCALLBACK )(CCCI_CHANNEL_T channel, ccci_io_request_t* ior);
1031
1032/*!
1033 * @brief function pointer type for CCCI IT reload GPD.
1034 */
1035typedef void (*CCCI_RGPD_RELOAD_CALLBACK)();
1036
1037/*!
1038 * @brief function pointer type for CCCI IT to generate DL traffic
1039 */
1040typedef void (*CCCI_DL_PKTGEN_CALLBACK)();
1041
1042/*!
1043 * @brief function pointer type for Host HS done broadcasting
1044 */
1045typedef void (*CCCI_HOST_HS_DONE_CALLBACK)();
1046
1047typedef kal_uint32 (*CCCI_DEBUG_GET_STATUS_CALLBACK)(kal_uint32 *write_ptr, kal_uint32 available_size);
1048
1049/*!
1050* @brief CCCI callback user's function to get runtime data and len
1051* query_support - query support mask & version of this id
1052* data - user needs to memcpy to data.
1053* data_len - the length of users data
1054 Return value - users support mask & version of this id
1055*/
1056typedef CCCI_RUNTIME_FEATURE_SUPPORT_T (*CCCI_RUNTIME_DATA_QUERY_REG_CB)(CCCI_RUNTIME_FEATURE_SUPPORT_T query_support, void * data, kal_uint32 * data_len);
1057
1058#if defined(__TC01__)
1059extern kal_uint8 lge_boot_info;
1060void factory_cable_qem_detect(void);
1061#endif
1062
1063/*!
1064 * @brief ccci_send_message send a message and reserved by ccci_mailbox_write_with_reserved
1065 * @param message: mailbox_id
1066 * @param reserved: ccci_header->reserved
1067 * @return CCCI_RETURNVAL_T
1068 */
1069kal_bool ccci_send_message(kal_uint32 message, kal_uint32 reserved);
1070kal_bool ccci_send_message_by_ilm(kal_uint32 message, kal_uint32 reserved);
1071kal_int32 ccci_send_ilm(ilm_struct* ilm);
1072kal_int32 ccci_register_sysmsgsvc_callback(kal_uint32 msgno, CCCI_SYSMSGSVC_HISR_CALLBACK funp);
1073kal_uint32 ccci_get_current_time();
1074kal_uint32 ccci_get_duration(kal_uint32 start, kal_uint32 end);
1075
1076kal_int32 ccci_misc_data_feature_support(kal_uint32 op_id, kal_uint32 len, void *pReturn);
1077/* API for CCCI device to obtain the share memory */
1078MODEM_RUNTIME_DATA* ccci_get_share_data(void);
1079kal_uint8* ccci_get_ap_share_data(CCCI_BOOT_UP_HS_HOST hs_host);
1080CCCI_RUNTIME_FEATURE_SUPPORT_T ccci_runtime_data_query(AP_CCCI_RUNTIME_FEATURE_ID feature_id, void *data, kal_uint32 read_len);
1081/*!
1082 * @brief ccci_check_maxchannel checks the channel exceed the max channel or not
1083 * @param channel: ccci channel in CCCI_CHANNEL_T enumeration
1084 * @return CCCI_RETURNVAL_T CCCI_SUCCESS means the channel is valid, CCCI_INVALID_PARAM means the channel is invalid
1085 */
1086kal_int32 ccci_check_maxchannel(CCCI_CHANNEL_T channel);
1087
1088#define CCCI_ERROR_CODE_END 0xFFFF
1089#define CCCI_ERROR_CODE_ASSERT(error_code, ...) _ccci_error_code_assert(error_code, ##__VA_ARGS__, CCCI_ERROR_CODE_END)
1090void _ccci_error_code_assert(CCCI_FORCE_ASSERT_ERROR_CODE error_code, ...);
1091
1092/*!
1093 * @brief ccci_init: This function initializes the buffer mode logical channel.
1094 * @param channel: logical channel
1095 * @param funp: CCCI callback function provided by user
1096 * @return CCCI error code, CCCI_RETURNVAL_T
1097 */
1098kal_int32 ccci_init(CCCI_CHANNEL_T channel, CCCI_CALLBACK funp);
1099/*!
1100 * @brief ccci_owner_init: Legacy MT6280 CCCI API, ccci_init the channel with task id set. But we don't check task id in MT6290
1101 * @param channel: logical channel
1102 * @param kal_taskid: task id;
1103 * @param funp: CCCI callback function provided by user
1104 * @return CCCI error code, CCCI_RETURNVAL_T
1105 */
1106kal_int32 ccci_owner_init(CCCI_CHANNEL_T channel, kal_taskid task, CCCI_CALLBACK funp);
1107/*!
1108 * @brief ccci_init_gpdior: This function initializes the GPD mode logical channel.
1109 * @param channel: logical channel
1110 * @param funp: CCCI callback function provided by user
1111 * @return CCCI error code, CCCI_RETURNVAL_T
1112 */
1113kal_int32 ccci_init_gpdior(CCCI_CHANNEL_T channel, CCCI_IORCALLBACK ior_funp);
1114/*!
1115 * @brief ccci_deinit: This function de-initializes the Buffer and GPD mode logical channel.
1116 * @param channel: logical channel
1117 * @return CCCI error code, CCCI_RETURNVAL_T
1118 */
1119kal_int32 ccci_deinit(CCCI_CHANNEL_T channel);
1120/*!
1121 * @brief ccci_write provides the api for buffer mode user to send DL buffer to HIF transmission HW.
1122 * It allocates ONE TGPD by qbmt_alloc_q_no_tail, if it fails returns CCCI_NO_PHY_CHANNEL
1123 * The buff will be memcpy to TGPD->BD and submit the TGPD to HIF HW.
1124 * @param channel: logical channel
1125 * @param buff: pointer to buffer to be sent
1126 * @return CCCI_RETURNVAL_T
1127 */
1128kal_int32 ccci_write(CCCI_CHANNEL_T channel, CCCI_BUFF_T *buff);
1129/*!
1130 * @brief ccci_write_gpd provides the api for GPD mode user to send DL buffer to HIF transmission HW.
1131 * There's no memcpy in this mode but it will traverse the GPD chain to add the CCCI header.
1132 * @param channel: logical channel
1133 * @param buff: pointer to buffer to be sent
1134 * @param pextinfo: pointer to the ccci io request extension information, ex.CCCI_IO_TX_NO_FLUSH
1135 * @return CCCI_RETURNVAL_T
1136 */
1137kal_int32 ccci_write_gpd(CCCI_CHANNEL_T channel, ccci_io_request_t *ccci_DL_ior, ccci_io_ext_info_t* pextinfo);
1138
1139/*!
1140 * @function ccci_polling_write_gpd
1141 * @brief Hook up SDIO polling mode API
1142 * Current Usage: NVRAM-->CCCI_FS during mainp()
1143 * CCCI_Handshake
1144 * @param channel [IN] ccci_channel
1145 * @param p_gpd [IN] pointer to the gpd
1146 * @param istx [IN] KAL_TRUE: Downlink/Tx KAL_FASE: Uplink/Rx
1147 *
1148 * @return KAL_TRUE: PASS
1149 * KAL_FALSE: NG
1150 */
1151kal_int32 ccci_polling_io(CCCI_CHANNEL_T channel, qbm_gpd *p_gpd, kal_bool is_tx);
1152
1153/*!
1154 * @brief ccci_ulbuff_cb is the MD side CCCI Rx callback function which registered to the buffer mode HIF driver by HIF_attach
1155 * e.g. CCCI_CH_HIFIO_BUFF
1156 * @param queue_no: HW queue id, backward compatible with usb core
1157 * @param pbuff: pointer to Rx buffer CCCI header
1158 * @return void
1159 */
1160void ccci_ulbuff_cb (kal_uint8 queue_no, CCCI_BUFF_T* pbuff);
1161/*!
1162 * @brief ccci_ulior_cb is the MD side CCCI Rx callback function which registered to the GPD mode HIF driver by HIF_attach
1163 * e.g. CCCI_CH_HIFIO_GPD
1164 * @param queue_no: HW queue id, backward compatible with usb core
1165 * @param io_request: pointer of ior
1166 * @return void
1167 */
1168void ccci_ulior_cb (kal_uint8 queue_no, ccci_io_request_t* ior);
1169
1170/*!
1171 * @brief ccci_ulior_net_cb is the MD side CCCI CCMNI Rx callback function which registered to the GPD mode HIF driver by HIF_attach
1172 * e.g. CCCI_CH_HIFIO_GPD
1173 * @param queue_no: HW queue id, backward compatible with usb core
1174 * @param io_request: pointer of ior
1175 * @return void
1176 */
1177void ccci_ulior_net_cb (kal_uint8 queue_no, ccci_io_request_t* io_request);
1178
1179#define ccci_dlior_cb ccci_dlior_agg_cb
1180/*!
1181 * @brief ccci_dlior_agg_cb is the MD side CCCI Tx DONE aggregated callback function for deq the TGPD e.g. DHL
1182 * Unlike ccci_ulior_cb, this function does NOT handle the non-CCCI_CH_USER_GPD types
1183 * @param queue_no: HW queue id, backward compatible with usb core
1184 * @param io_request: pointer of ior
1185 * @return void
1186 */
1187void ccci_dlior_agg_cb(kal_uint8 queue_no, ccci_io_request_t* io_request);
1188/*!
1189 * @brief ccci_dlior_single_cb is the MD side CCCI Tx DONE callback function for deq the TGPD e.g. DHL
1190 * Unlike ccci_ulior_cb, this function does NOT handle the non-CCCI_CH_USER_GPD types
1191 * @param queue_no: HW queue id, backward compatible with usb core
1192 * @param io_request: pointer of ior
1193 * @return void
1194 */
1195void ccci_dlior_single_cb(kal_uint8 queue_no, ccci_io_request_t* io_request);
1196
1197/*!
1198 * @brief ccci_mailbox_write formats a local buffer to mailbox format and call ccci_write
1199 * @param channel: logical channel
1200 * @param id: mailbox id
1201 * @return CCCI_RETURNVAL_T
1202 */
1203kal_int32 ccci_mailbox_write(CCCI_CHANNEL_T channel, kal_uint32 id);
1204/*!
1205 * @brief ccci_mailbox_write formats a local buffer to mailbox format and call ccci_write
1206 * @param channel: logical channel
1207 * @param id: mailbox id
1208 * @param reserved: ccci_header->reserved
1209 * @return CCCI_RETURNVAL_T
1210 */
1211kal_int32 ccci_mailbox_write_with_reserved(CCCI_CHANNEL_T channel, kal_uint32 id, kal_uint32 reserved);
1212/*!
1213 * @brief ccci_stream_write formats a local buffer to stream format and call ccci_write
1214 * @param channel: logical channel
1215 * @param addr: start address of the user buffer
1216 * @param len: lenght of the user buffer
1217 * @return CCCI_RETURNVAL_T
1218 */
1219kal_int32 ccci_stream_write(CCCI_CHANNEL_T channel, kal_uint32 addr, kal_uint32 len);
1220/*!
1221 * @brief ccci_stream_write_with_reserved formats a local buffer to stream format and call ccci_write
1222 * @param channel: logical channel
1223 * @param addr: start address of the user buffer
1224 * @param len: lenght of the user buffer
1225 * @param reserved an additional parameter
1226 * @return CCCI_RETURNVAL_T
1227 */
1228kal_int32 ccci_stream_write_with_reserved(CCCI_CHANNEL_T channel, kal_uint32 addr, kal_uint32 len,kal_uint32 reserved);
1229
1230void ccci_ut_tx_direct_user_dl_ack_dbg(CCCI_BUFF_T *buff);
1231void lte_ccci_hw_init(void);
1232void lte_ccci_init_handshake_phase1(void);
1233void lte_ccci_hal_init(void);
1234void lte_ccci_init_handshake_phase2(kal_uint16 _boot_mode);
1235void lte_ccci_hw_init_phase2(void);
1236/*************************************************************************/
1237/* CCCI exception API */
1238/*************************************************************************
1239* FUNCTION
1240* void ccci_exception_handshake
1241*
1242* DESCRIPTION
1243* This function .
1244*
1245* PARAMETERS
1246* channel - logical channel
1247* *
1248* RETURNS
1249* The address of the share memory of the input logical channel
1250*
1251*************************************************************************/
1252void ccci_exception_handshake(void);
1253
1254/*************************************************************************
1255* FUNCTION
1256* void ccci_exception_info_passed
1257*
1258* DESCRIPTION
1259* This function .
1260*
1261* PARAMETERS
1262* channel - logical channel
1263* *
1264* RETURNS
1265* The address of the share memory of the input logical channel
1266*
1267*************************************************************************/
1268void ccci_exception_info_passed(void);
1269
1270kal_bool ccci_queryBootAttributes(kal_uint32 mask);
1271
1272/*====================Exception Mode APIs===========================*/
1273kal_bool ccci_except_init_hmu(kal_uint32 dev_mapping, kal_uint32 ext_devinfo_len, kal_char * ext_devinfo);
1274kal_int32 ccci_except_init();
1275kal_int32 ccci_except_clear_ch(kal_uint32 ccci_ch);
1276kal_int32 ccci_except_set_gpd(kal_uint32 expt_ch, void *p_first_gpd, void *p_last_gpd);
1277kal_int32 ccci_except_poll_gpd(kal_uint32 expt_ch, void **pp_first_gpd, void **pp_last_gpd, kal_uint32 *gpd_num);
1278kal_int32 ccci_except_hif_st(kal_uint32 expt_dl_ch);
1279kal_int32 ccci_except_hif_isr(kal_uint32 expt_dl_ch);
1280
1281kal_bool cccitty_dev_expt_init(void);
1282void ccci_fs_svc_expt_init(void);
1283void ccci_get_ccism_shm_info(void **p_membase,kal_uint32 *p_memsize);
1284void ccci_get_ccism_expt_shm_info(void **p_membase,kal_uint32 *p_memsize);
1285void ccci_get_ccism_scp_shm_info(void **p_membase,kal_uint32 *p_memsize);
1286void ccci_get_ex_shm_info(void **p_membase, kal_uint32 *p_memsize);
1287void ccci_get_md1md3_shm_info(void **p_membase, kal_uint32 *p_memsize);
1288void ccci_get_dhl_shm_info(void **p_membase, kal_uint32 *p_memsize);
1289void ccci_get_dhl_raw_shm_info(void **p_membase, kal_uint32 *p_memsize);
1290void ccci_get_ccif_shm_info(void **p_membase, kal_uint32 *p_memsize);
1291void ccci_get_ccb_data_shm_info(void **p_membase, kal_uint32 *p_memsize);
1292void ccci_get_ccb_ctrl_shm_info(void **p_membase, kal_uint32 *p_memsize);
1293void ccci_get_dirt_shm_info(void **p_membase, kal_uint32 *p_memsize);
1294void ccci_get_dirt2_shm_info(void **p_membase, kal_uint32 *p_memsize);
1295
1296
1297kal_bool ccci_set_ap_runtime_data(CCCI_BOOT_UP_HS_HOST hs_host, void *start_addr, kal_uint32 total_size);
1298kal_uint32 ccci_runtime_data_registration(CCCI_BOOT_UP_HS_HOST hs_host, kal_int32 feature_id, CCCI_RUNTIME_DATA_QUERY_REG_CB cb);
1299
1300kal_int32 ccci_write_except_share_memory();
1301
1302/*===================FAKE API=======================================*/
1303#define ccci_init_handshake_phase1(...)
1304#define ccci_init_handshake_phase2(...)
1305#define ccci_hal_init(...)
1306
1307kal_int32 ccci_excep_dbg_logging_InHS2(kal_uint32 index, void* addr);
1308
1309//#define __SP_BOOTTRC_ENABLE__
1310#if defined(__SP_BOOTTRC_ENABLE__)
1311extern void ccci_boottrc_send_log(kal_uint32 index, kal_uint32 value);
1312#endif
1313
1314kal_int32 ccci_excep_query_shm(CCCI_EXCEP_MEMORY_REGION region, kal_uint32 *address, kal_uint32 *size, CCCI_EXCEP_MEMORY_TYPE *mem_type);
1315kal_int32 ccci_excep_init_shm(CCCI_EXCEP_MEMORY_TYPE mem_type, kal_uint32 addr, kal_uint32 size);
1316kal_uint32 ccci_excep_shm_get_total_size();
1317
1318void ccci_CalculateShareMem(kal_uint32 *start_addr, kal_uint32 *end_addr , kal_uint32 *size);
1319
1320kal_int32 ccci_debug_add_seq(CCCI_BUFF_T *bufp, kal_uint32 assert_bit);
1321kal_int32 ccci_debug_check_seq(CCCI_BUFF_T *bufp);
1322void ccci_debug_reset_seq_data();
1323void ccci_debug_reset_seq_data_peer(kal_uint32 peer_id);
1324kal_uint32 ccci_debug_get_status_register(CCCI_DEBUG_GET_STATUS_MODULE module_id, CCCI_DEBUG_GET_STATUS_CALLBACK funp);
1325kal_uint32 ccci_debug_get_status_worker();
1326void ccci_debug_set_feature();
1327void ccci_write_boot_up_trace(CCCI_BOOT_UP_TRACE_STEP step);
1328kal_bool ccci_check_shm_add_and_size(kal_uint32* address, kal_uint32 size);
1329void ccci_set_shared_mpu(void);
1330kal_uint32 ccci_get_memdump_timeout();
1331kal_uint32 ccci_get_debug_assert_bit(kal_uint32 channel);
1332
1333#if defined (__CCCI_PERF_PROFILING__)
1334#include "cpu.h"
1335/*
1336 * Before you start to collec data , please follow the following step
1337 * step 1. change HMU_GPTIMER_PRIODIC_INTERVAL to 100000U in HMU. to make sure the process won't be interrupted
1338 * step 2. enable __CCCI_LB_IT__ in hif_ccci.mak, as we need to user the IT code.
1339 * step 3. for CCCI_CCMNI_DL_PERF please add monitor upcm_dlvr_dl_sdu
1340 * step 4. for CCCI_CCMNI_UL_PERF please add monitor ipc_on_process_ul_queue --> upcm_rcv_ul_sdu
1341 */
1342#define CCCI_PERF_GET_CYCLE cpu_event_counter_get_cycle
1343#define CCCI_PERF_GET_DURATION cpu_event_get_duration
1344#define __CCCI_TTY_NEW_TX_DL_PERF__ /* define to profile the ccci_tty new tx dl */
1345#define __CCCI_TTY_CONV_TX_DL_PERF__ /* define to profile the ccci_tty conventional tx dl */
1346#define __CCCI_TTY_CONV_RX_UL_PERF__ /* define to profile the ccci_tty conventional rx ul */
1347#define __CCCI_CCMNI_DL_PERF__ /* define to profile the ccmni dl */
1348#define __CCCI_CCMNI_UL_PERF__ /* define to profile the ccmni ul */
1349#define __CCCI_DUSER_DL_PERF__ /* define to profile the direct ccci user dl */
1350#define __CCCI_DUSER_UL_PERF__ /* define to profile the direct ccci user ul */
1351#define CCCI_PERF_REC_CNT 256
1352#define CCCI_PERF_REC_CNT_1 CCCI_PERF_REC_CNT-1
1353
1354/* UL data structure*/
1355typedef struct _ccci_profile_ul_t{
1356 kal_uint32 sdioc_pq_num_gpd;
1357
1358 kal_uint32 sdioc_q_process_t;
1359
1360#ifdef __CCCI_CCMNI_UL_PERF__
1361 kal_uint32 ccmni_ipc_on_process_ul_s;
1362 kal_uint32 ccmni_upcm_rcv_ul_sdu_s;
1363 kal_uint32 ccmni_ipc2upcm_t;
1364#endif
1365
1366#ifdef __CCCI_TTY_CONV_RX_UL_PERF__
1367 kal_uint32 tty_conv_rx_CMD_GB_s;
1368 kal_uint32 tty_conv_rx_CMD_GB_e;
1369 kal_uint32 tty_conv_rx_CMD_GB_t;
1370#endif
1371
1372#ifdef __CCCI_DUSER_UL_PERF__
1373#endif
1374
1375
1376} ccci_profile_ul_t;
1377
1378/* DL data structure*/
1379typedef struct _ccci_profile_dl_t{
1380 kal_uint32 sdioc_pq_num_gpd;
1381
1382 kal_uint32 sdioc_submit_ior_s;
1383 kal_uint32 sdioc_submit_ior_e;
1384
1385//====================global end===========================
1386
1387
1388#ifdef __CCCI_CCMNI_DL_PERF__
1389 kal_uint32 ipc_on_process_ul_s;
1390 kal_uint32 upcm_rcv_ul_sdu_s;
1391#endif
1392
1393#ifdef __CCCI_TTY_CONV_TX_DL_PERF__
1394 kal_uint32 tty_conv_tx_s;
1395 kal_uint32 tty_conv_tx_e;
1396 kal_uint32 tty_conv_tx_t;
1397 kal_uint32 tty_conv_tx_cccih_s;
1398 kal_uint32 tty_conv_tx_cccih_e;
1399 kal_uint32 tty_conv_tx_cccih_t;
1400 kal_uint32 tty_conv_tx_sdioc_submit_ior_t;
1401#endif
1402
1403#ifdef __CCCI_DUSER_DL_PERF__
1404 kal_uint32 duser_ccci_write_s;
1405 kal_uint32 duser_ccci_write_e;
1406 kal_uint32 duser_ccci_write_t;
1407 kal_uint32 duser_sdioc_submit_ior_t;
1408#endif
1409
1410} ccci_profile_dl_t;
1411
1412extern ccci_profile_dl_t dl_prof[CCCI_PERF_REC_CNT];
1413extern kal_uint32 dl_prof_id;
1414extern ccci_profile_ul_t ul_prof[CCCI_PERF_REC_CNT];
1415extern kal_uint32 ul_prof_id;
1416
1417#endif //__CCCI_PERF_PROFILING__
1418
1419//a structure for ATP to send AT commands to CCCI modules
1420typedef struct{
1421 LOCAL_PARA_HDR
1422 kal_int32 cccifs_it_test_case_id;
1423} atp_ccci_it_cccifs_it_ind_struct;
1424
1425typedef enum{
1426 CCCI_CTRL_READY_TO_WRITE_ID_MIN = 0,
1427 CCCI_CTRL_READY_TO_WRITE_ID_RESEND_HOST_HS_PKT = CCCI_CTRL_READY_TO_WRITE_ID_MIN,
1428 CCCI_CTRL_READY_TO_WRITE_ID_MAX,
1429} CCCI_CTRL_READY_TO_WRITE_ID_E;
1430
1431typedef struct{
1432 LOCAL_PARA_HDR
1433 CCCI_CTRL_READY_TO_WRITE_ID_E ccci_ctrl_write_id;
1434} ccci_ctrl_ready_to_write_struct;
1435
1436#define CCCI_MEMORY_REMAP_MAX_ARRAY_SIZE (10)
1437typedef struct{
1438 kal_uint32 modem_start_addr;
1439 kal_uint32 memory_size;
1440 kal_uint64 ap_start_addr;
1441} ccci_memory_remap_info_t;
1442kal_int32 ccci_get_shm_memory_remap_info(ccci_memory_remap_info_t *p_memory_remap_info, kal_uint32 read_len);
1443
1444#if 0 //ccci_get_shm_memory_remap_info reference
1445/* under construction !*/
1446/* under construction !*/
1447/* under construction !*/
1448/* under construction !*/
1449/* under construction !*/
1450/* under construction !*/
1451#endif
1452
1453/*!
1454 * @brief CCCI_HIF_HW_TYPE_T CCCI hif transmission hw type enum
1455 */
1456typedef enum
1457{
1458 CCCI_TYPE_MIN = 0,
1459 CCCI_TYPE_SDIO = 1,
1460 CCCI_TYPE_CLDMA = 2,
1461 CCCI_TYPE_CAIF_GPD = 3,
1462 CCCI_TYPE_CAIF_BUF = 4,
1463 CCCI_TYPE_CCIF_GPD_AP = 5,
1464 CCCI_TYPE_CCIF_GPD_MD = 6,
1465 CCCI_TYPE_CCIF_BUF = 7,
1466 CCCI_TYPE_CCISM = 8,
1467 CCCI_TYPE_AP = 9,
1468 CCCI_TYPE_SCP = 10,
1469 CCCI_TYPE_EAP = 11,
1470 /* dummy interface is for those channels not used */
1471 CCCI_TYPE_NOT_SUPPORT, //not support type for backward compatible behavior --> channel exists but return false to user
1472 CCCI_TYPE_DUMMY, // = 3
1473 CCCI_TYPE_UT_GPD, // = 4
1474 CCCI_TYPE_UT_BUFF, // = 5
1475 CCCI_TYPE_UT_SPD, // = 6
1476 CCCI_TYPE_MAX,
1477} CCCI_HIF_HW_TYPE_T;
1478
1479#define CCCI_NORMAL_BOOT (0)
1480#define CCCI_META_BOOT (1)
1481#define CCCI_FACTORY_BOOT (2)
1482
1483//for cccisrv to set hw status
1484void ccci_hif_set_hw_status(CCCI_HIF_HW_TYPE_T hw_type, kal_bool new_status);
1485//for register host handshake done broadcast CB
1486void ccci_reg_host_hs_done_broadcast(CCCI_HOST_HS_DONE_BROADCAST_ID_E broadcast_id, CCCI_HOST_HS_DONE_CALLBACK p_funp);
1487
1488#endif //#ifndef _CCCI_IF_H