zte's code,first commit
Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/pub/include/tools/ZspTrace.h b/pub/include/tools/ZspTrace.h
new file mode 100755
index 0000000..32ae16d
--- /dev/null
+++ b/pub/include/tools/ZspTrace.h
@@ -0,0 +1,88 @@
+#ifndef ZSPTRACE_H_
+#define ZSPTRACE_H_
+
+#define ZCAT_ZPS_BUFFER_SIZE (0x00010000UL>>CPU_SHIFT)
+
+#ifndef DDR_BASE_ADDR_TOOL_ICP
+extern unsigned long ZCAT_PS_2_PHY_BUFFER_BASE;
+extern unsigned long ZCAT_PHY_2_PS_BUFFER_BASE;
+#endif
+
+////PHY-ZCAT
+#define ZCAT_PHY_2_PS_BUFFER_SIZE (0x00040000UL>>CPU_SHIFT)
+
+#define ZCAT_PHY_LOG_BASE_ADDR (ZCAT_PHY_2_PS_BUFFER_BASE)
+#define ZCAT_PHY_LOG_UNIT_ORDER (14 - CPU_SHIFT) /* 16KB */
+#define ZCAT_PHY_LOG_UNIT_SIZE (1UL<<ZCAT_PHY_LOG_UNIT_ORDER)
+#define ZCAT_PHY_LOG_UNIT_NUM (ZCAT_PHY_2_PS_BUFFER_SIZE >> ZCAT_PHY_LOG_UNIT_ORDER)
+#define ZCAT_PHY_LOG_UNIT_INDEX(addr) (((unsigned long)addr - ZCAT_PHY_LOG_BASE_ADDR) >> ZCAT_PHY_LOG_UNIT_ORDER)
+#define ZCAT_PHY_LOG_UNIT_HEADER(index) ((T_ZCAT_Phy_Log_Unit_Header *)(ZCAT_PHY_LOG_BASE_ADDR + ((unsigned long)index << ZCAT_PHY_LOG_UNIT_ORDER)))
+
+#define ZCAT_PHY_STD_LOG_OFFSET (28UL>>CPU_SHIFT) /* sizeof(T_COMM_TYPE + T_ZCAT_HEADER) */
+#define ZCAT_PHY_PRT_LOG_OFFSET (40UL>>CPU_SHIFT) /* sizeof(T_COMM_TYPE + T_ZCAT_HEADER + T_ZCAT_DBG_HEADER) */
+
+#define LOG_TD (1)
+#define LOG_LTE (2)
+#define LOG_W (3)
+#define LOG_SIG (4)
+
+typedef struct
+{
+ unsigned long type;
+ unsigned long len;
+} T_ZCAT_Phy_Log_Unit_Header;
+
+#define ZCAT_PHY_LOG_UNIT_HEAD (IRAM_BASE_ADDR_ZCAT_PHY_LOG)
+#define ZCAT_PHY_LOG_UNIT_TAIL (ZCAT_PHY_LOG_UNIT_HEAD + (4>>CPU_SHIFT))
+#define ZCAT_PHY_LOG_Free_UNIT_BUF (ZCAT_PHY_LOG_UNIT_TAIL + (4>>CPU_SHIFT))
+#define ZCAT_PHY_LOG_Free_UNIT_LEN (64>>CPU_SHIFT) /* (16 * 4)B */
+
+#define ZCAT_PHY_LOG_OFF (ZCAT_PHY_LOG_UNIT_HEAD + (16>>CPU_SHIFT) + ZCAT_PHY_LOG_Free_UNIT_LEN) /* ¶àÔ¤ÁôÁË8×Ö½Ú */
+
+////PHY<->PS ringbuffer(TD)
+#define ZCAT_PHY_LOG_CONTROL_SIZE (0x200UL>>CPU_SHIFT)
+#define ZCAT_PHY_LOG_CONTROL_LEN (ZCAT_PHY_LOG_CONTROL_SIZE - (4 >> CPU_SHIFT))
+
+#define ZCAT_TD_LOG_CONTROL_BASE_ADDR (ZCAT_PS_2_PHY_BUFFER_BASE)
+#define ZCAT_TD_LOG_CONTROL_WPOINTER (ZCAT_TD_LOG_CONTROL_BASE_ADDR)
+#define ZCAT_TD_LOG_CONTROL_RPOINTER (ZCAT_TD_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
+#define ZCAT_TD_LOG_CONTROL_CONTENT (ZCAT_TD_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
+
+////PHY<->PS ringbuffer(LTE)
+#define ZCAT_LTE_LOG_CONTROL_BASE_ADDR (ZCAT_TD_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
+#define ZCAT_LTE_LOG_CONTROL_WPOINTER (ZCAT_LTE_LOG_CONTROL_BASE_ADDR)
+#define ZCAT_LTE_LOG_CONTROL_RPOINTER (ZCAT_LTE_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
+#define ZCAT_LTE_LOG_CONTROL_CONTENT (ZCAT_LTE_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
+
+////PHY<->PS ringbuffer(W)
+#define ZCAT_W_LOG_CONTROL_BASE_ADDR (ZCAT_LTE_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
+#define ZCAT_W_LOG_CONTROL_WPOINTER (ZCAT_W_LOG_CONTROL_BASE_ADDR)
+#define ZCAT_W_LOG_CONTROL_RPOINTER (ZCAT_W_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
+#define ZCAT_W_LOG_CONTROL_CONTENT (ZCAT_W_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
+
+////PHY<->PS ringbuffer(SIG)
+#define ZCAT_SIG_LOG_CONTROL_BASE_ADDR (ZCAT_W_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
+#define ZCAT_SIG_LOG_CONTROL_WPOINTER (ZCAT_SIG_LOG_CONTROL_BASE_ADDR)
+#define ZCAT_SIG_LOG_CONTROL_RPOINTER (ZCAT_SIG_LOG_CONTROL_WPOINTER + (2 >> CPU_SHIFT))
+#define ZCAT_SIG_LOG_CONTROL_CONTENT (ZCAT_SIG_LOG_CONTROL_RPOINTER + (2 >> CPU_SHIFT))
+
+////ZCAT-TD
+#define ZCAT_TD_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_SIG_LOG_CONTROL_BASE_ADDR + ZCAT_PHY_LOG_CONTROL_SIZE)
+#define ZCAT_TD_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
+
+////ZCAT-LTE
+#define ZCAT_LTE_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_TD_PS_TO_PHY_BUFFER_BASE_ADDR + ZCAT_TD_PS_TO_PHY_BUFFER_SIZE)
+#define ZCAT_LTE_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
+
+////ZCAT-WCDMA
+#define ZCAT_W_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_LTE_PS_TO_PHY_BUFFER_BASE_ADDR + ZCAT_LTE_PS_TO_PHY_BUFFER_SIZE)
+#define ZCAT_W_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
+
+////ZCAT-SIG
+#define ZCAT_SIG_PS_TO_PHY_BUFFER_BASE_ADDR (ZCAT_W_PS_TO_PHY_BUFFER_BASE_ADDR + ZCAT_W_PS_TO_PHY_BUFFER_SIZE)
+#define ZCAT_SIG_PS_TO_PHY_BUFFER_SIZE (0x00000200UL>>CPU_SHIFT)
+
+#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 + \
+ 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)
+#endif
+