blob: cbde45e300db458fe0719eb69bfe04e2e24f3cd2 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001#ifndef _SONIC_CONTROL_H_
2#define _SONIC_CONTROL_H_
3
4#include "kal_public_api.h"
5#include "sonic_control_public.h"
6#include "reg_base.h"
7#include "dsp_header_define_csif_memory.h"
8#include "btdma_public.h"
9#include "csif_l1core_public_api.h"
10#include "dsp_public_dbgc.h"
11#if defined(__MD97P__)
12//ToDo: Add idle signal to deactivate mcore
13#else
14#include "dsp_public_eintc.h"
15#endif
16
17/********************************/
18/* Structure/Enum Define */
19/********************************/
20typedef enum{
21 SONIC_THREAD0,
22 SONIC_THREAD1,
23 SONIC_THREAD2,
24#if (!(defined(MT6853) && defined(__PALMER_SIMULATION__)) && !(defined(MT6833) || defined(MT6877)))
25 SONIC_THREAD3,
26#endif
27 SONIC_THREAD_NUM
28} THREAD_SONIC_ENUM;
29
30typedef struct{
31 kal_uint32 thread0 : 1;
32 kal_uint32 thread1 : 1;
33 kal_uint32 thread2 : 1;
34 kal_uint32 thread3 : 1;
35} THREAD_BITWISE_STRUCT;
36
37typedef struct{
38 kal_uint32 start_frc;
39 kal_uint32 end_frc;
40} TIME_RECORD_STRUCT;
41
42
43/********************************/
44/* Function extern */
45/********************************/
46
47extern void sonic_activate_by_btdma_ungate(void);
48extern void sonic_activate_by_release_idle(kal_uint32 th_bitmap);
49extern kal_uint32 sonic_activate(kal_uint32 th_bitmap);
50extern void sonic_deactivate(kal_uint32 th_bitmap);
51extern kal_uint32 sonic_check_activate_done(kal_uint32 th_bitmap);
52extern kal_uint32 sonic_check_deactivate_done(kal_uint32 th_bitmap);
53void sonic_deactivate_cb_n0(CSIF_ID_STATUS_t*);
54extern void sonic_clear_WFI_mask(void);
55extern kal_uint32 sonic_check_idle_flag_by_module(kal_uint32 thread_id, kal_uint32 user_id);
56
57#endif /*_SONIC_CONTROL_H_*/