SST_Concurrent_utility.h
16.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* SST_concurrent_utility.h
*
* Project:
* --------
* Maui_Software
*
* Description:
* ------------
* This Module defines the necessary API needed by concurrent ulitity.
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef _SST_CONCURRENT_UTILITY_
#define _SST_CONCURRENT_UTILITY_
#ifdef __cplusplus
extern "C" {
#endif
#include "kal_general_types.h"
/*************************************************************************
* Platform Capabilities Definition
*************************************************************************/
#if defined(MT6268) || defined(MT6236) || defined(MT6236B) || defined(MT6253) || defined(MT6276) || defined(MT6256) || defined(MT6253E) || defined(MT6253L) || defined(MT6252) || defined(MT6252H) || defined(MT6255) || defined(MT6250) || defined(MT6260) || defined(MT6261) || defined(MT2501) || defined(MT2502)
#if !defined(__MT6276_CONCURRENCY_TEST__) && !defined(__SLA_INST_COUNT_SUPPORT__) && !defined(__MT6256_CONCURRENCY_TEST__) && !defined(__MT6255_CONCURRENCY_TEST__)
#define __HW_EMI_MONITOR_SUPPORT__
#endif /* !__MT6276_CONCURRENCY_TEST__ */
#endif /* MT6268 || MT6236 || MT6236B || MT6253 */
/*************************************************************************
* Prevent Wrong Configuration
*************************************************************************/
#if defined(__MAUI_SWLA_PROFESSIONAL_EMI_MONITOR__)
#if !defined(__HW_EMI_MONITOR_SUPPORT__)
#error "Current Platform CAN NOT TURN ON PROFESSIONAL EMI MONITOR"
#endif /* __HW_EMI_MONITOR_SUPPORT__ */
#endif /* __MAUI_SWLA_PROFESSIONAL_EMI_MONITOR__ */
/*************************************************************************
* ENUM Definition : Sync with Catcher
*************************************************************************/
typedef enum
{
HEADER_ID_MAIN_TQCNT = 0x00000001,
HEADER_ID_MAIN_USEC = 0x00000002,
HEADER_ID_NUCLEUS_V1 = 0x00000000,
HEADER_ID_NUCLEUS_V2 = 0x00000010,
HEADER_ID_TIME_STAMP_BASE = 0x00000100,
HEADER_ID_EXTRA_INFO = 0x00000103,
HEADER_ID_TWO_RATIOS = 0x00000104,
HEADER_ID_OVERHEAD = 0x00000105,
HEADER_ID_CUST_OVERHEAD = 0x00000106,
HEADER_ID_EXTERNAL_BN = 0x00010005,
HEADER_ID_EXTERNAL_EMI_GERNAL = 0x00010006,
HEADER_ID_EXTERNAL_EMI_PRO = 0x00010007,
HEADER_ID_EXTERNAL_TST = 0x00010008,
#if defined(__MT6276_CONCURRENCY_TEST__) || defined(__MT6256_CONCURRENCY_TEST__)
HEADER_ID_EXTERNAL_MT6276_CONCURRENCY = 0x00010009,
#endif /* __MT6276_CONCURRENCY_TEST__ */
HEADER_ID_EXTERNAL_INST_COUNT = 0x0001000A,
HEADER_ID_EXTERNAL_CONCURRENCY = 0x0001000B,
HEADER_ID_EXTERNAL_MAX = 0x00010010
} SA_HEADER_ID_T;
/*************************************************************************
* Structure Definition : Basic and Professional EMI Monitor Logging Node
*************************************************************************/
#if defined(__MAUI_SWLA_PROFESSIONAL_EMI_MONITOR__) && ( defined(MT6268) || defined(MT6270A) )
typedef struct BM_LOG_T
{
kal_uint32 bus_ccnt; /* total bus cycle count */
kal_uint32 busy_all_cnt; /* all master busy count */
kal_uint32 trans_all_cnt; /* all master transaction count */
kal_uint32 word_all_cnt; /* all master word(8bytes) count */
kal_uint32 trans_cnt1; /* Monitor master group 1 transaction count */
kal_uint32 word_cnt1; /* Monitor master group 1 word(8bytes) count */
kal_uint32 trans_cnt2; /* Monitor master group 2 transaction count */
kal_uint32 word_cnt2; /* Monitor master group 2 word(8bytes) count */
kal_uint32 trans_cnt3; /* Monitor master group 3 transaction count */
kal_uint32 word_cnt3; /* Monitor master group 3 word(8bytes) count */
}BM_Log;
#elif defined(__MAUI_SWLA_PROFESSIONAL_EMI_MONITOR__) && ( defined(MT6236) || defined(MT6236B) )
typedef struct BM_LOG_T
{
kal_uint32 bus_ccnt; /* total bus cycle count */
kal_uint32 busy_all_cnt; /* all master busy count */
kal_uint32 busy_cnt; /* monitor master busy count */
}BM_Log;
#elif defined(__HW_EMI_MONITOR_SUPPORT__) && ( defined(MT6268) || defined(MT6270A) )
typedef struct BM_LOG_T
{
kal_uint32 bus_ccnt; /* total bus cycle count */
kal_uint32 busy_all_cnt; /* all master busy count */
kal_uint32 trans_all_cnt; /* all master transaction count */
kal_uint32 word_all_cnt; /* all master word(8bytes) count */
kal_uint32 trans_cnt; /* Monitor master group 1 transaction count */
kal_uint32 word_cnt; /* Monitor master group 1 word(8bytes) count */
}BM_Log;
#elif defined(__MAUI_SWLA_PROFESSIONAL_EMI_MONITOR__) && (defined(MT6276) || defined(MT6256))
typedef struct BM_LOG_T
{
kal_uint32 bus_ccnt; /* total bus cycle count */
kal_uint32 busy_all_cnt; /* all master busy count */
kal_uint32 busy_cnt; /* monitor master busy count */
}BM_Log;
#elif defined(__HW_EMI_MONITOR_SUPPORT__) && (defined(MT6276) || defined(MT6256))
typedef struct BM_LOG_T
{
kal_uint32 bus_ccnt; /* total bus cycle count */
kal_uint32 busy_all_cnt; /* all master busy count */
kal_uint32 busy_cnt; /* monitor master busy count */
}BM_Log;
#elif defined(__HW_EMI_MONITOR_SUPPORT__) && defined(MT6255)
typedef struct BM_LOG_T
{
kal_uint32 bus_ccnt; /* total bus cycle count */
kal_uint32 busy_all_cnt; /* all master busy count */
kal_uint32 busy_cnt; /* monitor master busy count */
kal_uint32 busy_cnt2;
kal_uint32 busy_cnt3;
}BM_Log;
#elif defined(__HW_EMI_MONITOR_SUPPORT__) && ( defined(MT6253) )
typedef struct BM_LOG_T
{
/* Cache (cache linefill) */
kal_uint32 cache_hcnt0L;
kal_uint32 cache_hcnt0U;
kal_uint32 cache_ccnt0L;
kal_uint32 cache_ccnt0U;
kal_uint32 cache_hcnt1L;
kal_uint32 cache_hcnt1U;
kal_uint32 cache_ccnt1L;
kal_uint32 cache_ccnt1U;
/* AHB (DMA burst transaction) */
kal_uint32 ahb_databeat;
/* EMI (MCU single) */
kal_uint32 byte_cnt; /* byte count */
kal_uint32 hword_cnt; /* half-word count */
kal_uint32 word_cnt; /* word count */
kal_uint32 cycle_cnt; /* total cycle count */
}BM_Log;
#elif defined(__HW_EMI_MONITOR_SUPPORT__) && ( defined(MT6253E) || defined(MT6253L) || defined(MT6252) || defined(MT6252H) )
typedef struct BM_LOG_T
{
kal_uint32 cyccnt;
kal_uint32 bsycnt;
kal_uint32 MCU_bsycnt;
kal_uint32 DMA_bsycnt;
kal_uint32 cache_hcnt;
kal_uint32 cache_ccnt;
}BM_Log;
#elif defined(__HW_EMI_MONITOR_SUPPORT__) && ( defined(MT6250) )
typedef struct BM_LOG_T
{
kal_uint32 emi_cyccnt;
kal_uint32 emi_bsycnt;
kal_uint32 emi_MCU_bsycnt;
kal_uint32 emi_DMA_bsycnt;
kal_uint32 sfi_cyccnt;
kal_uint32 sfi_bsycnt; // MAC + MCU + DMA + GMC
kal_uint32 sfi_MAC_bsycnt; //MAC
kal_uint32 sfi_CDP_bsycnt; //ch 2
kal_uint32 sfi_DMA_bsycnt; //ch 3
kal_uint32 cache_hcnt;
kal_uint32 cache_ccnt;
}BM_Log;
#elif defined(__HW_EMI_MONITOR_SUPPORT__) && ( defined(MT6260) || defined(MT6261) || defined(MT2501) || defined(MT2502) )
typedef struct BM_LOG_T
{
kal_uint32 emi_cyccnt;
kal_uint32 emi_bsycnt;
kal_uint32 emi_MCU_bsycnt;
kal_uint32 emi_DMA_bsycnt;
kal_uint32 sfi_cyccnt;
kal_uint32 sfi_bsycnt; // MAC + MCU + CDP
kal_uint32 sfi_MAC_bsycnt; // MAC
kal_uint32 sfi_CDP_bsycnt; // ch2: CDP
kal_uint32 cache_hcnt;
kal_uint32 cache_ccnt;
}BM_Log;
#elif defined(__HW_EMI_MONITOR_SUPPORT__)
typedef struct BM_LOG_T
{
kal_uint32 bus_ccnt; /* total bus cycle count */
kal_uint32 busy_all_cnt; /* all master busy count */
kal_uint32 busy_cnt; /* monitor master busy count */
}BM_Log;
#endif /* __MAUI_SWLA_PROFESSIONAL_EMI_MONITOR__ */
/*************************************************************************
* Structure Definition : Auxiliary Structures
*************************************************************************/
#if defined(MT6268) || defined(MT6236) || defined(MT6236B) || defined(MT6276) || defined(MT6256)|| defined(MT6270A)
typedef struct EMI_Setting_T
{
kal_uint32 usage_type;
kal_uint32 EMI_CONA_Val;
kal_uint32 EMI_CONB_Val;
#if !defined(MT6256)
kal_uint32 EMI_CONC_Val;
kal_uint32 EMI_COND_Val;
#endif
kal_uint32 EMI_CONE_Val;
kal_uint32 EMI_CONF_Val;
#if !defined(MT6256)
kal_uint32 EMI_CONG_Val;
kal_uint32 EMI_CONH_Val;
#endif
kal_uint32 EMI_CONI_Val;
kal_uint32 EMI_CONJ_Val;
kal_uint32 EMI_CONK_Val;
kal_uint32 EMI_CONL_Val;
kal_uint32 EMI_CONM_Val;
kal_uint32 EMI_CONN_Val;
kal_uint32 EMI_GEND_Val;
kal_uint32 EMI_BMEN_Val;
kal_uint32 EMI_BSEL_Val;
#if defined(MT6276)
kal_uint32 EPLL_CON0_Val;
#elif defined(MT6256)
kal_uint32 EPLL_CON2_Val;
#endif
}EMI_Setting;
#elif defined(MT6255)
typedef struct EMI_Setting_T
{
kal_uint32 usage_type;
kal_uint32 EMI_CONA_Val;
kal_uint32 EMI_CONB_Val;
kal_uint32 EMI_CONE_Val;
kal_uint32 EMI_CONF_Val;
kal_uint32 EMI_CONI_Val;
kal_uint32 EMI_CONJ_Val;
kal_uint32 EMI_CONK_Val;
kal_uint32 EMI_CONL_Val;
kal_uint32 EMI_CONM_Val;
kal_uint32 EMI_CONN_Val;
kal_uint32 EMI_GEND_Val;
kal_uint32 EMI_BMEN_Val;
kal_uint32 EMI_MSEL_Val;
kal_uint32 EMI_FREQ;
}EMI_Setting;
#elif defined(MT6253) || defined(MT6253E) || defined(MT6253L) || defined(MT6252) || defined(MT6252H)
typedef struct EMI_Setting_T
{
kal_uint32 EMI_CONA_Val;
kal_uint32 EMI_CONB_Val;
kal_uint32 EMI_CONC_Val;
kal_uint32 EMI_COND_Val;
kal_uint32 EMI_GEN_Val;
}EMI_Setting;
#elif defined(MT6250) || defined(MT6260) || defined(MT6261) || defined(MT2501) || defined(MT2502)
typedef struct EMI_Setting_T
{
kal_uint32 EMI_CONA_Val;
kal_uint32 EMI_CONB_Val;
}EMI_Setting;
#endif
/*************************************************************************
* Structure Definition : Basic and Professional EMI Monitor Init Reference
*************************************************************************/
#if defined(__MAUI_SWLA_PROFESSIONAL_EMI_MONITOR__) && ( defined(MT6268) || defined(MT6276) || defined(MT6256) || defined(MT6270A) )
typedef struct BM_REF_T
{
SA_HEADER_ID_T id;
kal_uint32 szRef;
EMI_Setting emi_settings;
}BM_Ref;
#elif defined(__MAUI_SWLA_PROFESSIONAL_EMI_MONITOR__) && ( defined(MT6236) || defined(MT6236B) )
typedef struct BM_REF_T
{
SA_HEADER_ID_T id;
kal_uint32 szRef;
EMI_Setting emi_settings;
}BM_Ref;
#elif defined(__HW_EMI_MONITOR_SUPPORT__) && ( defined(MT6268) || defined(MT6276) || defined(MT6256) || defined(MT6270A) || defined(MT6255) )
typedef struct BM_REF_T
{
SA_HEADER_ID_T id;
kal_uint32 szRef;
EMI_Setting emi_settings;
}BM_Ref;
#elif defined(__HW_EMI_MONITOR_SUPPORT__) && ( defined(MT6253) )
typedef struct BM_REF_T
{
SA_HEADER_ID_T id;
kal_uint32 szRef;
EMI_Setting emi_settings;
}BM_Ref;
#elif defined(__HW_EMI_MONITOR_SUPPORT__) && ( defined(MT6253E) || defined(MT6253L) || defined(MT6252) || defined(MT6252H) || defined(MT6250) || defined(MT6260) || defined(MT6261) || defined(MT2501) || defined(MT2502) )
typedef struct BM_REF_T
{
SA_HEADER_ID_T id;
kal_uint32 szRef;
EMI_Setting emi_settings;
}BM_Ref;
#elif defined(__HW_EMI_MONITOR_SUPPORT__)
typedef struct BM_REF_T
{
SA_HEADER_ID_T id;
kal_uint32 szRef;
kal_char line1_name[8];
kal_char line2_name[8];
}BM_Ref;
#endif /* __MAUI_SWLA_PROFESSIONAL_EMI_MONITOR__ */
/*************************************************************************
* Exported APIs for Software LA
*************************************************************************/
#if defined(__HW_EMI_MONITOR_SUPPORT__)
extern void Setup_AddOn_RefData(SA_HEADER_ID_T id, kal_uint8 **ARef, kal_uint32 *szARef);
extern void Get_BM_Log( BM_Log* pLog );
extern void Enable_Normal_EMI_Monitor(void);
#endif /* __HW_EMI_MONITOR_SUPPORT__ */
#ifdef __cplusplus
}
#endif
#endif /* _SST_CONCURRENT_UTILITY_ */