blob: c48bf96059723e3a9810cdc2ee5a0a983cd1199e [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#ifndef ZSPTRACE_H_
2#define ZSPTRACE_H_
3
4#define ZCAT_ZPS_BUFFER_SIZE (0x00010000UL>>CPU_SHIFT)
5
6#ifndef DDR_BASE_ADDR_TOOL_ICP
7extern unsigned long ZCAT_PS_2_PHY_BUFFER_BASE;
8extern unsigned long ZCAT_PHY_2_PS_BUFFER_BASE;
9#endif
10
11////PHY-ZCAT
12#define ZCAT_PHY_2_PS_BUFFER_SIZE (0x00060000UL>>CPU_SHIFT)
13#define ZCAT_PHY_LOG_UNIT_ORDER (14 - CPU_SHIFT) /* 16KB */
14#define ZCAT_PHY_LOG_UNIT_SIZE (1UL<<ZCAT_PHY_LOG_UNIT_ORDER)
15#define ZCAT_PHY_LOG_UNIT_NUM (ZCAT_PHY_2_PS_BUFFER_SIZE >> ZCAT_PHY_LOG_UNIT_ORDER)
16
17#define ZCAT_PHY_STD_LOG_OFFSET (28UL>>CPU_SHIFT) /* sizeof(T_COMM_TYPE + T_ZCAT_HEADER) */
18#define ZCAT_PHY_PRT_LOG_OFFSET (40UL>>CPU_SHIFT) /* sizeof(T_COMM_TYPE + T_ZCAT_HEADER + T_ZCAT_DBG_HEADER) */
19
20#define LOG_TD (1)
21#define LOG_LTE (2)
22#define LOG_W (3)
23#define LOG_SIG (4)
24
25typedef struct
26{
27 unsigned long type;
28 unsigned long len;
29} T_ZCAT_Phy_Log_Unit_Header;
30
31#define ZCAT_PHY_LOG_UNIT_HEAD (IRAM_BASE_ADDR_ZCAT_PHY_LOG)
32#define ZCAT_PHY_LOG_UNIT_TAIL (ZCAT_PHY_LOG_UNIT_HEAD + (4>>CPU_SHIFT))
33#define ZCAT_PHY_LOG_Free_UNIT_BUF (ZCAT_PHY_LOG_UNIT_TAIL + (4>>CPU_SHIFT))
34#define ZCAT_PHY_LOG_Free_UNIT_LEN (96>>CPU_SHIFT) /* (24 * 4)B = 384K*/
xf.lie31de8b2023-12-26 23:38:58 -080035#define ZCAT_PHY_LOG_OFF (ZCAT_PHY_LOG_UNIT_HEAD + (12>>CPU_SHIFT) + ZCAT_PHY_LOG_Free_UNIT_LEN) /* ¶àÔ¤ÁôÁË4×Ö½Ú */
xf.li742dd022023-06-08 01:43:32 -070036#define ZCAT_PHY_LOG_ZSP_BUF_READY (ZCAT_PHY_LOG_OFF + (4>>CPU_SHIFT))
xf.lie31de8b2023-12-26 23:38:58 -080037#define ZCAT_PS_LOG_VEHICLE_SIGN (ZCAT_PHY_LOG_ZSP_BUF_READY + (4>>CPU_SHIFT))
38#define ZCAT_PHY_LOG_VEHICLE_SIGN (ZCAT_PS_LOG_VEHICLE_SIGN + (4>>CPU_SHIFT))
lh9ed821d2023-04-07 01:36:19 -070039
xf.lice873192023-11-08 17:10:35 -080040/*ά²âÐÅÏ¢Log¿ª¹Ø*/
41#define ZCAT_DEBUG_INFO_DISABLE (ZCAT_PHY_LOG_VEHICLE_SIGN + (4>>CPU_SHIFT))
42
xf.li9d1a0e12023-09-20 01:43:20 -070043////zCat Log Rule
xf.lice873192023-11-08 17:10:35 -080044#define ZCAT_RULE_LTE_ENABLED (ZCAT_DEBUG_INFO_DISABLE + (4>>CPU_SHIFT))
xf.li9d1a0e12023-09-20 01:43:20 -070045#define ZCAT_RULE_SIG_ENABLED (ZCAT_RULE_LTE_ENABLED + (4>>CPU_SHIFT))
46#define ZCAT_RULE_TD_ENABLED (ZCAT_RULE_SIG_ENABLED + (4>>CPU_SHIFT))
47#define ZCAT_RULE_WCDMA_ENABLED (ZCAT_RULE_TD_ENABLED + (4>>CPU_SHIFT))
48#define ZCAT_RULE_AP2APP_ENABLED (ZCAT_RULE_WCDMA_ENABLED + (4>>CPU_SHIFT))
49#define ZCAT_RULE_AP2KERNEL_ENABLED (ZCAT_RULE_AP2APP_ENABLED + (4>>CPU_SHIFT))
50
lh9ed821d2023-04-07 01:36:19 -070051////PHY<->PS ringbuffer(TD)
52#define ZCAT_PHY_LOG_CONTROL_SIZE (0x200UL>>CPU_SHIFT)
53#define ZCAT_PHY_LOG_CONTROL_LEN (ZCAT_PHY_LOG_CONTROL_SIZE - (4 >> CPU_SHIFT))
54
55#define ZCAT_TD_LOG_CONTROL_BASE_ADDR (ZCAT_PS_2_PHY_BUFFER_BASE)
56#define ZCAT_TD_LOG_CONTROL_WPOINTER (ZCAT_TD_LOG_CONTROL_BASE_ADDR)
57#define ZCAT_TD_LOG_CONTROL_RPOINTER (ZCAT_TD_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
58#define ZCAT_TD_LOG_CONTROL_CONTENT (ZCAT_TD_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
59
60////PHY<->PS ringbuffer(LTE)
61#define ZCAT_LTE_LOG_CONTROL_BASE_ADDR (ZCAT_TD_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
62#define ZCAT_LTE_LOG_CONTROL_WPOINTER (ZCAT_LTE_LOG_CONTROL_BASE_ADDR)
63#define ZCAT_LTE_LOG_CONTROL_RPOINTER (ZCAT_LTE_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
64#define ZCAT_LTE_LOG_CONTROL_CONTENT (ZCAT_LTE_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
65
66////PHY<->PS ringbuffer(W)
67#define ZCAT_W_LOG_CONTROL_BASE_ADDR (ZCAT_LTE_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
68#define ZCAT_W_LOG_CONTROL_WPOINTER (ZCAT_W_LOG_CONTROL_BASE_ADDR)
69#define ZCAT_W_LOG_CONTROL_RPOINTER (ZCAT_W_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
70#define ZCAT_W_LOG_CONTROL_CONTENT (ZCAT_W_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
71
72////PHY<->PS ringbuffer(SIG)
73#define ZCAT_SIG_LOG_CONTROL_BASE_ADDR (ZCAT_W_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
74#define ZCAT_SIG_LOG_CONTROL_WPOINTER (ZCAT_SIG_LOG_CONTROL_BASE_ADDR)
75#define ZCAT_SIG_LOG_CONTROL_RPOINTER (ZCAT_SIG_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
76#define ZCAT_SIG_LOG_CONTROL_CONTENT (ZCAT_SIG_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
77
78////ZCAT-TD
79#define ZCAT_TD_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_SIG_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
80#define ZCAT_TD_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
81
82////ZCAT-LTE
83#define ZCAT_LTE_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_TD_PS_TO_PHY_BUFFER_BASE_ADDR + ZCAT_TD_PS_TO_PHY_BUFFER_SIZE)
84#define ZCAT_LTE_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
85
86////ZCAT-WCDMA
87#define ZCAT_W_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_LTE_PS_TO_PHY_BUFFER_BASE_ADDR + ZCAT_LTE_PS_TO_PHY_BUFFER_SIZE)
88#define ZCAT_W_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
89
90////ZCAT-SIG
91#define ZCAT_SIG_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_W_PS_TO_PHY_BUFFER_BASE_ADDR + ZCAT_W_PS_TO_PHY_BUFFER_SIZE)
92#define ZCAT_SIG_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
93
94#define ZCAT_PS_2_PHY_BUFFER_SIZE (ZCAT_PHY_LOG_CONTROL_SIZE + ZCAT_PHY_LOG_CONTROL_SIZE + ZCAT_PHY_LOG_CONTROL_SIZE + ZCAT_PHY_LOG_CONTROL_SIZE + \
95 ZCAT_TD_PS_TO_PHY_BUFFER_SIZE + ZCAT_LTE_PS_TO_PHY_BUFFER_SIZE + ZCAT_W_PS_TO_PHY_BUFFER_SIZE + ZCAT_SIG_PS_TO_PHY_BUFFER_SIZE)
96#endif
97