blob: 047d65a6f7324d47b9d2a1c386cd9aee51040ed3 [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*/
35#define ZCAT_PHY_LOG_OFF (ZCAT_PHY_LOG_UNIT_HEAD + (16>>CPU_SHIFT) + ZCAT_PHY_LOG_Free_UNIT_LEN) /* ¶àÔ¤ÁôÁË8×Ö½Ú */
36
37////PHY<->PS ringbuffer(TD)
38#define ZCAT_PHY_LOG_CONTROL_SIZE (0x200UL>>CPU_SHIFT)
39#define ZCAT_PHY_LOG_CONTROL_LEN (ZCAT_PHY_LOG_CONTROL_SIZE - (4 >> CPU_SHIFT))
40
41#define ZCAT_TD_LOG_CONTROL_BASE_ADDR (ZCAT_PS_2_PHY_BUFFER_BASE)
42#define ZCAT_TD_LOG_CONTROL_WPOINTER (ZCAT_TD_LOG_CONTROL_BASE_ADDR)
43#define ZCAT_TD_LOG_CONTROL_RPOINTER (ZCAT_TD_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
44#define ZCAT_TD_LOG_CONTROL_CONTENT (ZCAT_TD_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
45
46////PHY<->PS ringbuffer(LTE)
47#define ZCAT_LTE_LOG_CONTROL_BASE_ADDR (ZCAT_TD_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
48#define ZCAT_LTE_LOG_CONTROL_WPOINTER (ZCAT_LTE_LOG_CONTROL_BASE_ADDR)
49#define ZCAT_LTE_LOG_CONTROL_RPOINTER (ZCAT_LTE_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
50#define ZCAT_LTE_LOG_CONTROL_CONTENT (ZCAT_LTE_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
51
52////PHY<->PS ringbuffer(W)
53#define ZCAT_W_LOG_CONTROL_BASE_ADDR (ZCAT_LTE_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
54#define ZCAT_W_LOG_CONTROL_WPOINTER (ZCAT_W_LOG_CONTROL_BASE_ADDR)
55#define ZCAT_W_LOG_CONTROL_RPOINTER (ZCAT_W_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
56#define ZCAT_W_LOG_CONTROL_CONTENT (ZCAT_W_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
57
58////PHY<->PS ringbuffer(SIG)
59#define ZCAT_SIG_LOG_CONTROL_BASE_ADDR (ZCAT_W_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
60#define ZCAT_SIG_LOG_CONTROL_WPOINTER (ZCAT_SIG_LOG_CONTROL_BASE_ADDR)
61#define ZCAT_SIG_LOG_CONTROL_RPOINTER (ZCAT_SIG_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
62#define ZCAT_SIG_LOG_CONTROL_CONTENT (ZCAT_SIG_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
63
64////ZCAT-TD
65#define ZCAT_TD_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_SIG_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
66#define ZCAT_TD_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
67
68////ZCAT-LTE
69#define ZCAT_LTE_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_TD_PS_TO_PHY_BUFFER_BASE_ADDR + ZCAT_TD_PS_TO_PHY_BUFFER_SIZE)
70#define ZCAT_LTE_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
71
72////ZCAT-WCDMA
73#define ZCAT_W_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_LTE_PS_TO_PHY_BUFFER_BASE_ADDR + ZCAT_LTE_PS_TO_PHY_BUFFER_SIZE)
74#define ZCAT_W_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
75
76////ZCAT-SIG
77#define ZCAT_SIG_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_W_PS_TO_PHY_BUFFER_BASE_ADDR + ZCAT_W_PS_TO_PHY_BUFFER_SIZE)
78#define ZCAT_SIG_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
79
80#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 + \
81 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)
82#endif
83