[Feature]Upload Modem source code
Change-Id: Id4294f30faced84d3e6fd6d5e61e1111bf287a37
diff --git a/mcu/interface/driver/sib_drv/scc/md93/scc_93.h b/mcu/interface/driver/sib_drv/scc/md93/scc_93.h
new file mode 100644
index 0000000..a79d677
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md93/scc_93.h
@@ -0,0 +1,762 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 10 12 2017 sen.chang
+ * [MOLY00197455][MT6771][SIB_DRV] Update SCC Module for SIB official Release - Support SCC for ET callibration usage
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Define exported macro
+ ******************************************************************************/
+#define SCC_ON_PCORE 1
+#define SCC_ON_L1CORE 0
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_SDF_STARTED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACE_TOP_LINK_NOT_READY,
+ SCC_SIB_NOT_DETECTED
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACE_TOP_READY = 0,
+ SCC_TRACE_TOP_NOT_READY
+} SCC_TRACE_TOP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_SDF_OPERATION_MODE_STANDALONE /* */= 0,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_CONFIG /* */= SCC_SDF_OPERATION_MODE_STANDALONE,
+
+ SCC_SDF_OPERATION_MODE_AUTO /* */= 1,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_CONFIG /* */= SCC_SDF_OPERATION_MODE_AUTO,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_START /* */= SCC_SDF_OPERATION_MODE_AUTO,
+
+ SCC_SDF_OPERATION_MODE_SEMI_AUTO /* */= 2,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_START /* */= SCC_SDF_OPERATION_MODE_SEMI_AUTO,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_STOP /* */= SCC_SDF_OPERATION_MODE_SEMI_AUTO,
+
+ SCC_SDF_OPERATION_MODE_MANUAL /* */= 3,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_STOP /* */= SCC_SDF_OPERATION_MODE_MANUAL,
+} SCC_SDF_OPERATION_MODE;
+
+typedef enum {
+ SCC_SDF_DISABLE_EN = 0,
+ SCC_SDF_ENABLE_EN = 1,
+} SCC_SDF_EN_SEL;
+
+typedef enum {
+ SCC_SDF_CONT_MODE = 0,
+ SCC_SDF_DIFF_MODE = 1,
+} SCC_SDF_MODE_SEL;
+
+typedef enum {
+ SCC_SDF_8BIT_WIDTH = 0,
+ SCC_SDF_16BIT_WIDTH = 1,
+ SCC_SDF_32BIT_WIDTH = 2
+} SCC_SDF_WIDTH_SEL;
+
+typedef enum {
+ SCC_SDF_600MHZ_CLOCK = 0,
+ SCC_SDF_300MHZ_CLOCK = 1,
+ SCC_SDF_150MHZ_CLOCK = 2,
+ SCC_SDF_75MHZ_CLOCK = 3
+} SCC_SDF_CLOCK_SEL;
+
+typedef struct {
+ kal_bool in_progress;
+ kal_bool overflowed;
+} SCC_SDF_STATUS;
+
+typedef enum {
+ SCC_SDF_SIB_TRIGGER = 0,
+ SCC_SDF_TARGET_TRIGGER = 1,
+} SCC_SDF_TRIGGER_MODE;
+typedef enum {
+ SCC_SDF_DBGMON_BYTE0_MUX = 0,
+ SCC_SDF_DBGMON_BYTE1_MUX = 1,
+ SCC_SDF_DBGMON_BYTE2_MUX = 2,
+ SCC_SDF_DBGMON_BYTE3_MUX = 3,
+ SCC_SDF_SWGPIO_BYTE0_MUX = 4,
+ SCC_SDF_SWGPIO_BYTE1_MUX = 5,
+ SCC_SDF_SWGPIO_BYTE2_MUX = 6,
+ SCC_SDF_SWGPIO_BYTE3_MUX = 7
+} SCC_SDF_MUX_SEL;
+
+typedef enum {
+ SCC_SDF_ASSERT_STOP_NOTHING = 0,
+ SCC_SDF_ASSERT_STOP_ASSERT = 1,
+} SCC_SDF_ASSERT_STOP_SEL;
+
+typedef struct {
+ SCC_SDF_OPERATION_MODE operation;
+ SCC_SDF_EN_SEL en; //for sdf_get_config only
+ SCC_SDF_MODE_SEL mode;
+ SCC_SDF_WIDTH_SEL width;
+ kal_uint32 enBitmap;
+ SCC_SDF_CLOCK_SEL clock;
+ SCC_SDF_MUX_SEL mux0;
+ SCC_SDF_MUX_SEL mux1;
+ SCC_SDF_MUX_SEL mux2;
+ SCC_SDF_MUX_SEL mux3;
+ kal_uint32 swGpio;
+ SCC_SDF_ASSERT_STOP_SEL assert;
+} SCC_SDF_CONFIG_PARAM;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef struct {
+ kal_bool b8ATBFull;
+ kal_uint8 u8FifoDepthAT1;
+ kal_uint8 u8FifoDepthAT2;
+} SCC_ST_PCC_FIFO_STATUS;
+
+typedef enum {
+ SCC_EN_PCC_CAPMODE_TDD_ADC_BYPASS = 0,
+ SCC_EN_PCC_CAPMODE_C2K_ADC_BYPASS = 1,
+ SCC_EN_PCC_CAPMODE_LTE_INTP = 2,
+ SCC_EN_PCC_CAPMODE_FDD_INTP = 3,
+ SCC_EN_PCC_CAPMODE_TDD_INTP = 4,
+ SCC_EN_PCC_CAPMODE_C2K_INTP = 5,
+ SCC_EN_PCC_CAPMODE_LTE_CS = 6,
+ SCC_EN_PCC_CAPMODE_LTE_INTP_CS_C0 = 7,
+ SCC_EN_PCC_CAPMODE_LTE_INTP_CS_C1 = 8,
+ SCC_EN_PCC_CAPMODE_TDD_IQC = 9,
+ SCC_EN_PCC_CAPMODE_C2K_IQC =10,
+ SCC_EN_PCC_CAPMODE_TXDFE_DET_REF_DIST = 11,
+ SCC_EN_PCC_CAPMODE_TXDFE_DET_REF_COMB = 12,
+ SCC_EN_PCC_CAPMODE_MAX
+}SCC_EN_PCC_CAPTURE_MODE;
+
+typedef struct _SCC_ST_ATB_PATH_SEL {
+ kal_bool b8P11Enable;
+ kal_bool b8P12Enable;
+ kal_bool b8AdjEnable;
+} SCC_ST_ATB_PATH_SEL;
+
+typedef struct
+{
+ kal_uint32 addr;
+ kal_uint32 length;
+} SCC_TRACETOP_RUNTIME_MEMORY_INFO_T;
+
+typedef enum {
+ ET_PASS = 0,
+ TRACETOP_START_FAIL = 1,
+ PCC_CONFIG = 2,
+ PCC_FSM_STA = 3,
+ PCC_OVERFLOW = 4,
+ TRACETOP_STOP = 5,
+ PCC_SOFT_RESET = 6
+} SCC_ET_ERROR_CODE;
+
+typedef enum {
+ SCC_ET_EN_TXDFE_DET = 0, //only det
+ SCC_ET_EN_TXDFE_REF = 1, //only ref
+ SCC_ET_EN_TXDFE_DET_REF = 2 //det and ref
+} SCC_ET_EN_TX_CAPTURE_NODE;
+
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACE_TOP_STATUS *status);
+#ifndef MT6763
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(CSTF_PORT port, kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(CSTF_PORT port, kal_uint16 *MBps, kal_uint8 *pct);
+#endif
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * enCapMode:
+ * EN_PCC_CAPTURE_MODE enum to specify capture mode
+ *
+ * *pstPathSel:
+ * As an input to specify selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_EN_PCC_CAPTURE_MODE enCapMode,SCC_ST_ATB_PATH_SEL* pstPathSel);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FLASE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FLASE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Do ET Calibration on Sylvia
+ *
+ * [PARAMETERS]
+ * base_addr:
+ * ET EMI base_address
+ * length:
+ * ET EMI length
+ * ET_CaptureNode
+ * ET txdfe node
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ */
+SCC_RESULT scc_et_calibration_start(kal_uint32 base_addr, kal_uint32 length,SCC_ET_EN_TX_CAPTURE_NODE ET_CaptureNode);
+
+
+/*
+ * [FUNCTION]
+ * Do ET Calibration on Sylvia
+ *
+ * [PARAMETERS]
+ * info:
+ * Return structure to indicate IQ data info
+ * addr: IQ data start address
+ * size: IQ data length
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ */
+
+SCC_RESULT scc_et_calibration_stop(SCC_TRACETOP_RUNTIME_MEMORY_INFO_T *info);
+#endif /* !__SCC_H__ */
diff --git a/mcu/interface/driver/sib_drv/scc/md95/scc_95.h b/mcu/interface/driver/sib_drv/scc/md95/scc_95.h
new file mode 100644
index 0000000..bcc3d8e
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md95/scc_95.h
@@ -0,0 +1,927 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Define exported macro
+ ******************************************************************************/
+#define SCC_ON_PCORE 1
+#define SCC_ON_L1CORE 0
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACETOP_EMI_LINK_NOT_READY,
+ SCC_TRACETOP_STP_LINK_NOT_READY,
+ SCC_TRACETOP_NO_LINK_READY,
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACETOP_EMI_READY = 0,
+ SCC_TRACETOP_EMI_NOT_READY
+} SCC_TRACETOP_EMI_STATUS;
+
+typedef enum {
+ SCC_TRACETOP_STP_READY = 0,
+ SCC_TRACETOP_STP_NOT_READY,
+} SCC_TRACETOP_STP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_SDF_OPERATION_MODE_STANDALONE /* */= 0,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_CONFIG /* */= SCC_SDF_OPERATION_MODE_STANDALONE,
+
+ SCC_SDF_OPERATION_MODE_AUTO /* */= 1,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_CONFIG /* */= SCC_SDF_OPERATION_MODE_AUTO,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_START /* */= SCC_SDF_OPERATION_MODE_AUTO,
+
+ SCC_SDF_OPERATION_MODE_SEMI_AUTO /* */= 2,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_START /* */= SCC_SDF_OPERATION_MODE_SEMI_AUTO,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_STOP /* */= SCC_SDF_OPERATION_MODE_SEMI_AUTO,
+
+ SCC_SDF_OPERATION_MODE_MANUAL /* */= 3,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_STOP /* */= SCC_SDF_OPERATION_MODE_MANUAL,
+} SCC_SDF_OPERATION_MODE;
+
+typedef enum {
+ SCC_SDF_DISABLE_EN = 0,
+ SCC_SDF_ENABLE_EN = 1,
+} SCC_SDF_EN_SEL;
+
+typedef enum {
+ SCC_SDF_CONT_MODE = 0,
+ SCC_SDF_DIFF_MODE = 1,
+} SCC_SDF_MODE_SEL;
+
+typedef enum {
+ SCC_SDF_8BIT_WIDTH = 0,
+ SCC_SDF_16BIT_WIDTH = 1,
+ SCC_SDF_32BIT_WIDTH = 2
+} SCC_SDF_WIDTH_SEL;
+
+typedef enum {
+ SCC_SDF_600MHZ_CLOCK = 0,
+ SCC_SDF_300MHZ_CLOCK = 1,
+ SCC_SDF_150MHZ_CLOCK = 2,
+ SCC_SDF_75MHZ_CLOCK = 3
+} SCC_SDF_CLOCK_SEL;
+
+typedef struct {
+ kal_bool in_progress;
+ kal_bool overflowed;
+} SCC_SDF_STATUS;
+
+typedef enum {
+ SCC_SDF_SIB_TRIGGER = 0,
+ SCC_SDF_TARGET_TRIGGER = 1,
+} SCC_SDF_TRIGGER_MODE;
+typedef enum {
+ SCC_SDF_DBGMON_BYTE0_MUX = 0,
+ SCC_SDF_DBGMON_BYTE1_MUX = 1,
+ SCC_SDF_DBGMON_BYTE2_MUX = 2,
+ SCC_SDF_DBGMON_BYTE3_MUX = 3,
+ SCC_SDF_SWGPIO_BYTE0_MUX = 4,
+ SCC_SDF_SWGPIO_BYTE1_MUX = 5,
+ SCC_SDF_SWGPIO_BYTE2_MUX = 6,
+ SCC_SDF_SWGPIO_BYTE3_MUX = 7
+} SCC_SDF_MUX_SEL;
+
+typedef enum {
+ SCC_SDF_ASSERT_STOP_NOTHING = 0,
+ SCC_SDF_ASSERT_STOP_ASSERT = 1,
+} SCC_SDF_ASSERT_STOP_SEL;
+
+typedef struct {
+ SCC_SDF_OPERATION_MODE operation;
+ SCC_SDF_EN_SEL en; //for sdf_get_config only
+ SCC_SDF_MODE_SEL mode;
+ SCC_SDF_WIDTH_SEL width;
+ kal_uint32 enBitmap;
+ SCC_SDF_CLOCK_SEL clock;
+ SCC_SDF_MUX_SEL mux0;
+ SCC_SDF_MUX_SEL mux1;
+ SCC_SDF_MUX_SEL mux2;
+ SCC_SDF_MUX_SEL mux3;
+ kal_uint32 swGpio;
+ SCC_SDF_ASSERT_STOP_SEL assert;
+} SCC_SDF_CONFIG_PARAM;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef struct {
+ kal_bool b8ATBFull;
+ kal_bool b8ThroughputMismatch;
+ kal_uint8 u8FifoDepthAT1;
+ kal_uint8 u8FifoDepthAT2;
+ kal_uint8 u8FifoDepthAT3;
+} SCC_ST_PCC_FIFO_STATUS;
+
+typedef enum {
+ SCC_EN_PCC_DFESYS_RXDFE_ADC_1RX = 0,
+ SCC_EN_PCC_DFESYS_RXDFE_ADC_1RX_TRUNCATE = 1,
+ SCC_EN_PCC_DFESYS_RXDFE_ADC_2RX = 2,
+ SCC_EN_PCC_DFESYS_RXDFE_ADC_2RX_TRUNCATE = 3,
+ SCC_EN_PCC_DFESYS_RXDFE_IQC_1RX = 4,
+ SCC_EN_PCC_DFESYS_RXDFE_IQC_1RX_TRUNCATE = 5,
+ SCC_EN_PCC_DFESYS_RXDFE_IQC_2RX = 6,
+ SCC_EN_PCC_DFESYS_RXDFE_IQC_2RX_TRUNCATE = 7,
+ SCC_EN_PCC_DFESYS_RXDFE_INTP_LTE_1RX = 8,
+ SCC_EN_PCC_DFESYS_RXDFE_INTP_LTE_2RX = 9,
+ SCC_EN_PCC_DFESYS_RXDFE_INTP_FDD_2RX = 10,
+ SCC_EN_PCC_DFESYS_RXDFE_INTP_TDD_1RX = 11,
+ SCC_EN_PCC_DFESYS_RXDFE_INTP_C2K_1RX = 12,
+ SCC_EN_PCC_DFESYS_RXDFE_LTE_CS_1RX = 13,
+ SCC_EN_PCC_DFESYS_RXDFE_LTE_CS_2RX = 14,
+ SCC_EN_PCC_DFESYS_TXDFE_DET_REF_COMB = 15,
+ SCC_EN_PCC_DFESYS_TXDFE_DET_REF_COMB_TRUNCATE = 16,
+ SCC_EN_PCC_DFESYS_TXDFE_REF = 17,
+ SCC_EN_PCC_DFESYS_TXDFE_DET = 18,
+ SCC_EN_PCC_DFESYS_TXDFE_REF_TRUNCATE = 19,
+ SCC_EN_PCC_DFESYS_TXDFE_DET_TRUNCATE = 20,
+ SCC_EN_PCC_DFESYS_TXDFE_BB_24BIT = 21,
+ SCC_EN_PCC_DFESYS_TXDFE_BB_32BIT = 22,
+ SCC_EN_PCC_DFESYS_CAPNODE_MAX
+}SCC_EN_PCC_DFESYS_CAPTURE_NODE;
+
+
+typedef struct _SCC_ST_ATB_PATH_SEL {
+ kal_bool b8P11Enable;
+ kal_bool b8P12Enable;
+ kal_bool b8P21Enable;
+ kal_bool b8AdjEnable;
+} SCC_ST_ATB_PATH_SEL;
+
+typedef struct _SCC_ST_PRESYNC_PATH_SEL_4BIT{
+ unsigned Formatter1:4;
+ unsigned Formatter2:4;
+ unsigned Formatter3:4;
+ unsigned :0;
+} SCC_ST_PRESYNC_PATH_SEL_4BIT;
+
+typedef union _SCC_UNI_PRESYNC_PATH_SEL{
+ kal_uint16 u16PresyncPathSel;
+ SCC_ST_PRESYNC_PATH_SEL_4BIT stPresyncPathSel;
+} SCC_UNI_PRESYNC_PATH_SEL;
+
+typedef struct _SCC_ST_PRESYNC_TRUNCATE_RX_2BIT{
+ unsigned Formatter1:2;
+ unsigned Formatter2:2;
+ unsigned Formatter3:2;
+ unsigned :0;
+} SCC_ST_PRESYNC_TRUNCATE_RX_2BIT;
+
+typedef union _SCC_UNI_PRESYNC_TRUNCATE_RX{
+ kal_uint8 u8PresyncTruncateRx;
+ SCC_ST_PRESYNC_TRUNCATE_RX_2BIT stPresyncTruncateRx;
+} SCC_UNI_PRESYNC_TRUNCATE_RX;
+
+typedef struct _SCC_ST_PRESYNC_TRUNCATE_TX_2BIT{
+ unsigned TXK_REF:2;
+ unsigned TXK_DET:2;
+ unsigned :0;
+} SCC_ST_PRESYNC_TRUNCATE_TX_2BIT;
+
+typedef union _SCC_UNI_PRESYNC_TRUNCATE_TX{
+ kal_uint8 u8PresyncTruncateTx;
+ SCC_ST_PRESYNC_TRUNCATE_TX_2BIT stPresyncTruncateTx;
+} SCC_UNI_PRESYNC_TRUNCATE_TX;
+
+typedef struct _SCC_ST_PRESYNC_STIME_SEL_2BIT{
+ unsigned Formatter1:2;
+ unsigned Formatter2:2;
+ unsigned Formatter3:2;
+ unsigned :0;
+} SCC_ST_PRESYNC_STIME_SEL_2BIT;
+
+typedef union _SCC_UNI_PRESYNC_STIME_SEL{
+ kal_uint8 u8PresyncSTimeSel;
+ SCC_ST_PRESYNC_STIME_SEL_2BIT stPresyncSTimeSel;
+} SCC_UNI_PRESYNC_STIME_SEL;
+
+
+typedef struct _SCC_ST_PCC_CAPTURE_CONFIG {
+ SCC_EN_PCC_DFESYS_CAPTURE_NODE enAT1CapNode;
+ SCC_EN_PCC_DFESYS_CAPTURE_NODE enAT2CapNode;
+ SCC_EN_PCC_DFESYS_CAPTURE_NODE enAT3CapNode;
+ SCC_ST_ATB_PATH_SEL stATBPathSel;
+ kal_uint32 u32CCPathSelRX;
+ SCC_UNI_PRESYNC_STIME_SEL unPresyncSTimeSel;
+ SCC_UNI_PRESYNC_TRUNCATE_RX unPresyncTruncateRx;
+ SCC_UNI_PRESYNC_TRUNCATE_TX unPresyncTruncateTx;
+} SCC_ST_PCC_CAPTURE_CONFIG;
+
+typedef struct
+{
+ kal_uint32 addr;
+ kal_uint32 length;
+} SCC_TRACETOP_RUNTIME_MEMORY_INFO_T;
+
+typedef enum {
+ ET_PASS = 0,
+ TRACETOP_START_FAIL = 1,
+ PCC_CONFIG = 2,
+ PCC_FSM_STA = 3,
+ PCC_OVERFLOW = 4,
+ TRACETOP_STOP = 5,
+ PCC_SOFT_RESET = 6
+} SCC_ET_ERROR_CODE;
+
+typedef enum {
+ SCC_ET_EN_TXDFE_DET = 0, //only det
+ SCC_ET_EN_TXDFE_REF = 1, //only ref
+ SCC_ET_EN_TXDFE_DET_REF = 2 //det and ref
+} SCC_ET_EN_TX_CAPTURE_NODE;
+
+typedef struct _SCC_ST_PCC_ET_CONFIG {
+ kal_uint32 u32SampleRateHz;
+ kal_uint8 u8SFN;
+} SCC_ST_PCC_ET_CONFIG;
+
+/*********************************************************/
+/* The structures used for Rxdfe */
+/*********************************************************/
+typedef enum
+{
+ SCC_RXDFE_MIMO_MASTER_PATH= 0,
+ SCC_RXDFE_MIMO_SLAVE_PATH,
+ SCC_RXDFE_MIMO_PATH_NUM
+}SCC_ST_PCC_RF_RXDFE_MIMO_PATH_E;
+
+typedef enum
+{
+ SCC_RXDFE_MIMO_2x2_CFG= 0,
+ SCC_RXDFE_MIMO_4x4_CFG,
+ SCC_RXDFE_MIMO_CFG_NUM,
+ SCC_RXDFE_MIMO_INVLD_CFG = 0xFF
+}SCC_ST_PCC_RF_RXDFE_MIMO_CFG_E;
+
+typedef struct
+{
+ SCC_ST_PCC_RF_RXDFE_MIMO_CFG_E rxdfe_mimo_cfg;
+/* P-path index. Valid values 0-3. Invalid -1 */
+ kal_int8 rxdfe_pidx[SCC_RXDFE_MIMO_PATH_NUM];
+/* C-path index. Valid values 0-4. Invalid -1 */
+ kal_int8 rxdfe_cidx[SCC_RXDFE_MIMO_PATH_NUM];
+}SCC_ST_PCC_RF_RXDFE_PATH_INDEX;
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACETOP_EMI_STATUS *status);
+#ifndef MT6763
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(CSTF_PORT port, kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(CSTF_PORT port, kal_uint16 *MBps, kal_uint8 *pct);
+#endif
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * *pstCaptureConfig:
+ * As an input to specify capture node and selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_ST_PCC_CAPTURE_CONFIG* pstCaptureConfig);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+/*
+ * [FUNCTION]
+ * Let EL1D to update CC mapping info to PCC driver
+ *
+ * [PARAMETERS]
+ * u8cc_count:
+ * specify the total CC count now
+ * pInfo_C0:
+ * specify C0 goes which MIMO/p-path/c-path. MIMO: 0xFF means invalid. p-path/c-path: -1 means path is not enable
+ * pInfo_C1:
+ * specify C1 goes which MIMO/p-path/c-path. MIMO: 0xFF means invalid. p-path/c-path: -1 means path is not enable
+ * pInfo_C2:
+ * specify C2 goes which MIMO/p-path/c-path. MIMO: 0xFF means invalid. p-path/c-path: -1 means path is not enable
+ * pInfo_C3:
+ * specify C3 goes which MIMO/p-path/c-path. MIMO: 0xFF means invalid. p-path/c-path: -1 means path is not enable
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_rxdfe_cc_info(kal_uint8 u8cc_count, SCC_ST_PCC_RF_RXDFE_PATH_INDEX *pInfo_C0, SCC_ST_PCC_RF_RXDFE_PATH_INDEX *pInfo_C1, SCC_ST_PCC_RF_RXDFE_PATH_INDEX *pInfo_C2, SCC_ST_PCC_RF_RXDFE_PATH_INDEX *pInfo_C3);
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FLASE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FLASE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Do ET Calibration on Sylvia
+ *
+ * [PARAMETERS]
+ * base_addr:
+ * ET EMI base_address
+ * length:
+ * ET EMI length
+ * ET_CaptureNode
+ * ET txdfe node
+ * pET_Setting:
+ * let ET to set Sampling Rate(unit:Hz) and Subframe number(unit: 0.25ms)
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ */
+SCC_RESULT scc_et_calibration_start(kal_uint32 base_addr, kal_uint32 length, SCC_ET_EN_TX_CAPTURE_NODE ET_CaptureNode, SCC_ST_PCC_ET_CONFIG* pET_Setting);
+
+
+/*
+ * [FUNCTION]
+ * Do ET Calibration on Sylvia
+ *
+ * [PARAMETERS]
+ * info:
+ * Return structure to indicate IQ data info
+ * addr: IQ data start address
+ * size: IQ data length
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ */
+SCC_RESULT scc_et_calibration_stop(SCC_TRACETOP_RUNTIME_MEMORY_INFO_T *info);
+
+
+/*
+ * [FUNCTION]
+ * Check PCC FSM status on data transfer or not for ET user
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * KAL_TRUE for yes, data transfer now.
+ * KAL_FALSE for not yet
+ */
+kal_bool scc_et_calibration_check_PCC_FSM_status_on_data_transfer(void);
+
+#endif /* !__SCC_H__ */
diff --git a/mcu/interface/driver/sib_drv/scc/md97/pcc/pcc.h b/mcu/interface/driver/sib_drv/scc/md97/pcc/pcc.h
new file mode 100644
index 0000000..1e5d4ee
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/pcc/pcc.h
@@ -0,0 +1,96 @@
+/******************************************************************************
+* 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) 2012
+*
+* 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 11 09 2020 chwanhung.wang
+ * [MOLY00591808] [SIB_DRV][PCC][MT6877][Call for Check-in] Montrose platform kick-off call for check-in
+ *
+ * 07 08 2020 chwanhung.wang
+ * [MOLY00543654][SIB_DRV][PCC][Gen97][Petrus-P] MT6893 Related Code Call for Check-in
+ *
+ * 07 07 2020 chwanhung.wang
+ * [MOLY00542976][SIB_DRV][PCC][Gen97] Palmer Related Code Call for Check-in
+ *
+ * 01 15 2020 chwanhung.wang
+ * [MOLY00474840][SIB_DRV][PCC][MT6853] Mouton related code Call for Check-in on VMOLY
+ *
+ * 09 24 2019 chwanhung.wang
+ * [MOLY00441711][SIB_DRV][PCC] [MT6873] Margaux related code Call for Check-in on VMOLY
+ *
+ * 07 31 2019 chwanhung.wang
+ * [MOLY00426794][SIB_DRV][PCC] Modify for New Mercury SCC Architecture
+ *
+ * 07 17 2019 kerwin.chung
+ * [MOLY00422524] [SIB_DRV][SCC] initial check in of Petrus
+ *
+ * 03 12 2018 kerwin.chung
+ * [MOLY00312787] [MT6297][SIB_DRV][SCC] Add SCC interface file for 6297 DEV
+ * .
+ *
+ * 10 19 2017 sen.chang
+ * [MOLY00284121][93/95 re-arch][SIB_DRV] Update SCC Module for SIB official Release - SCC 93/95 re-arch
+ *
+ *
+ *****************************************************************************/
+
+/* MTnnnn is specified by PLATFORM in project's make file */
+#if defined(MT6885) || defined(MT6873) || defined(MT6853) || defined(CHIP10992) || \
+ defined(MT6833) || defined(MT6893) || defined(MT6877)
+#include "pcc_mt6885.h"
+#elif defined(MERCURY)
+#include "pcc_mercury.h"
+#else
+#error "no PLATFORM match!"
+#endif
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/pcc/pcc_mercury.h b/mcu/interface/driver/sib_drv/scc/md97/pcc/pcc_mercury.h
new file mode 100644
index 0000000..84d95d0
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/pcc/pcc_mercury.h
@@ -0,0 +1,84 @@
+#ifndef __PCC_H__
+#define __PCC_H__
+
+typedef struct {
+ kal_bool b8ATBFull;
+ kal_bool b8ThroughputMismatch;
+ kal_uint8 u8FifoDepthAT1;
+ kal_uint8 u8FifoDepthAT2;
+ kal_uint8 u8FifoDepthAT3;
+} SCC_ST_PCC_FIFO_STATUS;
+
+typedef enum {
+ SCC_EN_PCC_MODE_RXDFE_INTP_NR_122P88 = 0,
+ SCC_EN_PCC_MODE_RXDFE_INTP_NR_61P44 = 1,
+ SCC_EN_PCC_MODE_RXDFE_INTP_NR_BELOW_30P72 = 2,
+ SCC_EN_PCC_MODE_RXDFE_INTP_LTE = 3,
+ SCC_EN_PCC_MODE_RXDFE_INTP_FDD = 4,
+ SCC_EN_PCC_MODE_RXDFE_INTP_TDD = 5,
+ SCC_EN_PCC_MODE_RXDFE_INTP_C2K = 6,
+ SCC_EN_PCC_MODE_RXDFE_INTP_CS_NR_LTE = 7,
+ SCC_EN_PCC_MODE_RXDFE_CS_NR_LTE = 8,
+ SCC_EN_PCC_MODE_TXDFE_BB_24BIT = 9,
+ SCC_EN_PCC_MODE_TXDFE_BB_32BIT = 10,
+ SCC_EN_PCC_MODE_CAPMODE_MAX
+} SCC_EN_PCC_DFESYS_CAPTURE_MODE;
+
+typedef struct _SCC_ST_ATB_PATH_SEL {
+ kal_bool b8P11Enable;
+ kal_bool b8P12Enable;
+ kal_bool b8P21Enable;
+ kal_bool b8AdjEnable;
+} SCC_ST_ATB_PATH_SEL;
+
+typedef struct _SCC_ST_PRESYNC_TRUNCATE_RX_2BIT {
+ unsigned Formatter1:2;
+ unsigned Formatter2:2;
+ unsigned Formatter3:2;
+ unsigned Formatter4:2;
+ unsigned :0;
+} SCC_ST_PRESYNC_TRUNCATE_RX_2BIT;
+
+typedef union _SCC_UNI_PRESYNC_TRUNCATE_RX {
+ kal_uint8 u8PresyncTruncateRx;
+ SCC_ST_PRESYNC_TRUNCATE_RX_2BIT stPresyncTruncateRx;
+} SCC_UNI_PRESYNC_TRUNCATE_RX;
+
+typedef struct _SCC_ST_PRESYNC_STIME_SEL_3BIT {
+ unsigned Formatter1:3;
+ unsigned Formatter2:3;
+ unsigned Formatter3:3;
+ unsigned Formatter4:3;
+ unsigned :0;
+} SCC_ST_PRESYNC_STIME_SEL_3BIT;
+
+typedef union _SCC_UNI_PRESYNC_STIME_SEL {
+ kal_uint16 u16PresyncSTimeSel;
+ SCC_ST_PRESYNC_STIME_SEL_3BIT stPresyncSTimeSel;
+} SCC_UNI_PRESYNC_STIME_SEL;
+
+typedef struct _SCC_ST_PCC_CAPTURE_CONFIG {
+ SCC_EN_PCC_DFESYS_CAPTURE_MODE enCapMode;
+ SCC_ST_ATB_PATH_SEL stATBPathSel;
+ kal_uint32 u32CCPathSelRX;
+ SCC_UNI_PRESYNC_STIME_SEL unPresyncSTimeSel;
+ SCC_UNI_PRESYNC_TRUNCATE_RX unPresyncTruncateRx;
+} SCC_ST_PCC_CAPTURE_CONFIG;
+
+#define SCC_RXDFE_CC_RX_MAX_NUM (4)
+
+typedef enum {
+ SCC_RXDFE_MIMO_2x2_CFG = 0,
+ SCC_RXDFE_MIMO_4x4_CFG,
+ SCC_RXDFE_MIMO_CFG_NUM,
+ SCC_RXDFE_MIMO_INVLD_CFG = -1
+} SCC_ST_PCC_RF_RXDFE_MIMO_CFG_E;
+
+typedef struct {
+ SCC_ST_PCC_RF_RXDFE_MIMO_CFG_E rxdfe_mimo_cfg;
+ /* Layer-path index. Valid values 0-15(E1)/17(E2). Invalid -1 */
+ kal_int8 rxdfe_l_idx[SCC_RXDFE_CC_RX_MAX_NUM];
+} SCC_ST_PCC_RF_RXDFE_PATH_INDEX;
+
+#endif
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/pcc/pcc_mt6885.h b/mcu/interface/driver/sib_drv/scc/md97/pcc/pcc_mt6885.h
new file mode 100644
index 0000000..84d95d0
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/pcc/pcc_mt6885.h
@@ -0,0 +1,84 @@
+#ifndef __PCC_H__
+#define __PCC_H__
+
+typedef struct {
+ kal_bool b8ATBFull;
+ kal_bool b8ThroughputMismatch;
+ kal_uint8 u8FifoDepthAT1;
+ kal_uint8 u8FifoDepthAT2;
+ kal_uint8 u8FifoDepthAT3;
+} SCC_ST_PCC_FIFO_STATUS;
+
+typedef enum {
+ SCC_EN_PCC_MODE_RXDFE_INTP_NR_122P88 = 0,
+ SCC_EN_PCC_MODE_RXDFE_INTP_NR_61P44 = 1,
+ SCC_EN_PCC_MODE_RXDFE_INTP_NR_BELOW_30P72 = 2,
+ SCC_EN_PCC_MODE_RXDFE_INTP_LTE = 3,
+ SCC_EN_PCC_MODE_RXDFE_INTP_FDD = 4,
+ SCC_EN_PCC_MODE_RXDFE_INTP_TDD = 5,
+ SCC_EN_PCC_MODE_RXDFE_INTP_C2K = 6,
+ SCC_EN_PCC_MODE_RXDFE_INTP_CS_NR_LTE = 7,
+ SCC_EN_PCC_MODE_RXDFE_CS_NR_LTE = 8,
+ SCC_EN_PCC_MODE_TXDFE_BB_24BIT = 9,
+ SCC_EN_PCC_MODE_TXDFE_BB_32BIT = 10,
+ SCC_EN_PCC_MODE_CAPMODE_MAX
+} SCC_EN_PCC_DFESYS_CAPTURE_MODE;
+
+typedef struct _SCC_ST_ATB_PATH_SEL {
+ kal_bool b8P11Enable;
+ kal_bool b8P12Enable;
+ kal_bool b8P21Enable;
+ kal_bool b8AdjEnable;
+} SCC_ST_ATB_PATH_SEL;
+
+typedef struct _SCC_ST_PRESYNC_TRUNCATE_RX_2BIT {
+ unsigned Formatter1:2;
+ unsigned Formatter2:2;
+ unsigned Formatter3:2;
+ unsigned Formatter4:2;
+ unsigned :0;
+} SCC_ST_PRESYNC_TRUNCATE_RX_2BIT;
+
+typedef union _SCC_UNI_PRESYNC_TRUNCATE_RX {
+ kal_uint8 u8PresyncTruncateRx;
+ SCC_ST_PRESYNC_TRUNCATE_RX_2BIT stPresyncTruncateRx;
+} SCC_UNI_PRESYNC_TRUNCATE_RX;
+
+typedef struct _SCC_ST_PRESYNC_STIME_SEL_3BIT {
+ unsigned Formatter1:3;
+ unsigned Formatter2:3;
+ unsigned Formatter3:3;
+ unsigned Formatter4:3;
+ unsigned :0;
+} SCC_ST_PRESYNC_STIME_SEL_3BIT;
+
+typedef union _SCC_UNI_PRESYNC_STIME_SEL {
+ kal_uint16 u16PresyncSTimeSel;
+ SCC_ST_PRESYNC_STIME_SEL_3BIT stPresyncSTimeSel;
+} SCC_UNI_PRESYNC_STIME_SEL;
+
+typedef struct _SCC_ST_PCC_CAPTURE_CONFIG {
+ SCC_EN_PCC_DFESYS_CAPTURE_MODE enCapMode;
+ SCC_ST_ATB_PATH_SEL stATBPathSel;
+ kal_uint32 u32CCPathSelRX;
+ SCC_UNI_PRESYNC_STIME_SEL unPresyncSTimeSel;
+ SCC_UNI_PRESYNC_TRUNCATE_RX unPresyncTruncateRx;
+} SCC_ST_PCC_CAPTURE_CONFIG;
+
+#define SCC_RXDFE_CC_RX_MAX_NUM (4)
+
+typedef enum {
+ SCC_RXDFE_MIMO_2x2_CFG = 0,
+ SCC_RXDFE_MIMO_4x4_CFG,
+ SCC_RXDFE_MIMO_CFG_NUM,
+ SCC_RXDFE_MIMO_INVLD_CFG = -1
+} SCC_ST_PCC_RF_RXDFE_MIMO_CFG_E;
+
+typedef struct {
+ SCC_ST_PCC_RF_RXDFE_MIMO_CFG_E rxdfe_mimo_cfg;
+ /* Layer-path index. Valid values 0-15(E1)/17(E2). Invalid -1 */
+ kal_int8 rxdfe_l_idx[SCC_RXDFE_CC_RX_MAX_NUM];
+} SCC_ST_PCC_RF_RXDFE_PATH_INDEX;
+
+#endif
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/scc_97.h b/mcu/interface/driver/sib_drv/scc/md97/scc_97.h
new file mode 100644
index 0000000..3ec157c
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/scc_97.h
@@ -0,0 +1,252 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 11 11 2020 kerwin.chung
+ * [MOLY00593534] [SIB_DRV][SCC] Add scc files and fix build errors for MT6877
+ * add MT6877 scc driver and fix build errors
+ *
+ * 07 08 2020 kerwin.chung
+ * [MOLY00543889] [SIB_DRV][SCC] Petrus-P call for check in
+ * scc for Petrus-P call for check in
+ *
+ * 07 07 2020 kerwin.chung
+ * [MOLY00543236] [SIB_DRV][SCC] check in scc for Palmer
+ * scc for Palmer call for check in
+ *
+ * 07 06 2020 kerwin.chung
+ * [MOLY00542985] [SIB_DRV][SCC] check in Colgin files
+ *
+ * Coling check in for NR15.R3.MT6880.MP part
+ *
+ * 05 11 2020 kerwin.chung
+ * [MOLY00522613] [SIB_DRV][SCC] Colgin call for check in
+ * Colgin call for check in
+ *
+ * 01 15 2020 kerwin.chung
+ * [MOLY00474930] [SIB_DRV][SCC] initial check in for Mouton
+ *
+ * scc's initial check in for Mouton
+ *
+ * 09 24 2019 kerwin.chung
+ * [MOLY00441455] [SIB_DRV][SCC] initial scc version of Margaux(MT6873)
+ * initial scc for Margaux(MT6873)
+ *
+ * 07 24 2019 kerwin.chung
+ * [MOLY00424065] [SIB_DRV][SCC] initial check in for MERCURY
+ * mercury inital version
+ *
+ * 07 17 2019 kerwin.chung
+ * [MOLY00422524] [SIB_DRV][SCC] initial check in of Petrus
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+/* MTnnnn is specified by PLATFORM in project's make file */
+#if defined(MT6297)
+ #include "scc_mt6297.h"
+#elif defined(MT6833)
+ #include "scc_mt6833.h"
+#elif defined(MT6853)
+ #include "scc_mt6853.h"
+#elif defined(MT6873)
+ #include "scc_mt6873.h"
+#elif defined(MT6877)
+ #include "scc_mt6877.h"
+#elif defined(MT6885)
+ #include "scc_mt6885.h"
+#elif defined(MT6893)
+ #include "scc_mt6893.h"
+#elif defined(CHIP10992)
+ #include "scc_chip10992.h"
+#elif defined(MERCURY)
+ #include "scc_mercury.h"
+#else
+ #error "no PLATFORM match"
+#endif
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/scc_chip10992.h b/mcu/interface/driver/sib_drv/scc/md97/scc_chip10992.h
new file mode 100644
index 0000000..50a700a
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/scc_chip10992.h
@@ -0,0 +1,803 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 08 20 2020 kerwin.chung
+ * [MOLY00551230] [SIB_DRV][SCC] remove EMI max. Tput. and DVFS lock by default in thin MD projects
+ * add dummy change to trigger BVD sync. to T700 branch
+ *
+ * 08 20 2020 patty.chen
+ * [MOLY00558395] [IQ dump] Conditional trigger PCC IQ dump for CSD
+ * Support Conditional event trigger PCC Dump
+ *
+ * 08 13 2020 kerwin.chung
+ * [MOLY00551230] [SIB_DRV][SCC] remove EMI max. Tput. and DVFS lock by default in thin MD projects
+ * reform scc init into ATCMD style
+ *
+ * 12 10 2019 wiki.wang
+ * [MOLY00464901] [Margaux][SIB_DRV] EMI IQ dump ATCMD
+ *
+ * EMI dump ATcmd for Petrus and Marguax
+ *
+ * 09 11 2019 kerwin.chung
+ * [MOLY00439413] [SIB_DRV][SCC] integrate DVFS lock and bus remap
+ * Official scc of MT6885
+ *
+ * 07 30 2019 chwanhung.wang
+ * [MOLY00426278][SIB_DRV][PCC] Re-org the code for new SCC code architecture
+ *
+ * 07 19 2019 kerwin.chung
+ * [MOLY00423651] [SIB_DRV][SCC/SDF] re-arc for better de-coupling
+ * re-arc SCC w/ SDF for Petrus(MT6885)
+ *
+ * 07 18 2019 chwanhung.wang
+ * [MOLY00422863][SIB_DRV][PCC] Finish the Implementation of PCC AT Command
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+#include "sdf/sdf.h"
+#include "pcc/pcc.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACETOP_EMI_LINK_NOT_READY,
+ SCC_TRACETOP_STP_LINK_NOT_READY,
+ SCC_TRACETOP_NO_LINK_READY,
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACETOP_EMI_READY = 0,
+ SCC_TRACETOP_EMI_NOT_READY
+} SCC_TRACETOP_EMI_STATUS;
+
+typedef enum {
+ SCC_TRACETOP_STP_READY = 0,
+ SCC_TRACETOP_STP_NOT_READY,
+} SCC_TRACETOP_STP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef enum {
+ SCC_NO_PATH = 0x0,
+ SCC_STP_PATH = 0x1,
+ SCC_EMI_PATH = 0x2
+} SCC_SIB_PATH;
+
+typedef struct {
+ kal_uint32 Tracetop_IDFILTER_BIT127_96;
+ kal_uint32 Tracetop_IDFILTER_BIT95_64;
+ kal_uint32 Tracetop_IDFILTER_BIT63_32;
+ kal_uint32 Tracetop_IDFILTER_BIT31_0;
+} SCC_ATID_MASK;
+
+/* ATID dispatcher configuration */
+typedef struct {
+ SCC_SIB_PATH path_mask; /* path selection */
+ SCC_ATID_MASK to_emi_atids; /* ATIDs to EMI */
+ SCC_ATID_MASK to_sib_atids; /* ATIDs to SIB */
+} SCC_ATID_CFG;
+
+typedef struct _scc_decoded_data_t
+{
+ kal_uint8 ATID;
+ kal_uint8 data;
+} scc_decoded_data_t;
+
+/* 15/16B decode frame */
+typedef struct _scc_decoded_frame_data_t
+{
+ scc_decoded_data_t decoded_data[15];
+} scc_decoded_frame_data_t;
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources by ATCMD
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init_by_atcmd(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACETOP_EMI_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(const CSTF_PORT port, const kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(const CSTF_PORT port, kal_uint16 *const MBps, kal_uint8 *const pct);
+
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * *pstCaptureConfig:
+ * As an input to specify capture node and selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_ST_PCC_CAPTURE_CONFIG* pstCaptureConfig);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+/*
+ * [FUNCTION]
+ * Let EL1D to update CC mapping info to PCC driver
+ *
+ * [PARAMETERS]
+ * u8cc_mask:
+ * specify the CC's mask (LTE:max 5bit, NR: max 2bit)
+ * p_Info_arrary:
+ * specify CC goes which MIMO/L-path. MIMO: -1 means invalid. L-path: -1 means path is not enable
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_rxdfe_cc_info_lte(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+SCC_RESULT scc_pcc_rxdfe_cc_info_nr(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+kal_bool scc_pcc_atcmd(kal_uint32 len, kal_uint8 *data);
+kal_bool scc_tracetop_atcmd(kal_uint32 len, kal_uint8 *data);
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FALSE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FALSE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info1(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info2(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info3(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL or SCC_RES_LOCKED
+ */
+SCC_RESULT scc_config_atid_dispatcher(const SCC_ATID_CFG *const atid_cfg);
+
+/**
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher w/o re-entry lock protection
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL
+ */
+SCC_RESULT scc_config_atid_dispatcher_nolock(const SCC_ATID_CFG *const atid_cfg);
+
+/*
+ * [FUNCTION]
+ * Decode 15/16B frame
+ *
+ * [PARAMETERS]
+ * emi: ATID configurations
+ * decoded_frame: decoded data
+ * current_ATID: current ATID
+ *
+ * [RETURN]
+ * Data length
+ */
+kal_uint32 scc_15B16B_frame_decode(kal_uint32 addr, scc_decoded_frame_data_t* decoded_frame, kal_uint8* current_ATID);
+
+/*
+ * [FUNCTION]
+ * Lock trace_top required DVFS vModem after
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_init_dvfs_ctrl(void);
+
+/*
+ * [FUNCTION]
+ * Initialize STP link by external request
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_init_stp(void);
+
+/*
+ * [FUNCTION]
+ * For setting non-WARP mode in Tractop DMA Control Module
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_set_emi_mem_full_stop(void);
+#endif /* !__SCC_H__ */
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/scc_mercury.h b/mcu/interface/driver/sib_drv/scc/md97/scc_mercury.h
new file mode 100644
index 0000000..73c48d1
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/scc_mercury.h
@@ -0,0 +1,704 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 07 31 2019 kerwin.chung
+ * [MOLY00426737] [SIB_DRV][SCC] re-org mercury w/ pcc
+ * clone re-orged mt6885.h for mercury
+ *
+ * 07 19 2019 kerwin.chung
+ * [MOLY00423651] [SIB_DRV][SCC/SDF] re-arc for better de-coupling
+ * re-arc SCC w/ SDF for Petrus(MT6885)
+ *
+ * 07 18 2019 chwanhung.wang
+ * [MOLY00422863][SIB_DRV][PCC] Finish the Implementation of PCC AT Command
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ ****************************************************************************/
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+#include "sdf/sdf.h"
+#include "pcc/pcc.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACETOP_EMI_LINK_NOT_READY,
+ SCC_TRACETOP_STP_LINK_NOT_READY,
+ SCC_TRACETOP_NO_LINK_READY,
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACETOP_EMI_READY = 0,
+ SCC_TRACETOP_EMI_NOT_READY
+} SCC_TRACETOP_EMI_STATUS;
+
+typedef enum {
+ SCC_TRACETOP_STP_READY = 0,
+ SCC_TRACETOP_STP_NOT_READY,
+} SCC_TRACETOP_STP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef enum {
+ SCC_NO_PATH = 0x0,
+ SCC_STP_PATH = 0x1,
+ SCC_EMI_PATH = 0x2
+} SCC_SIB_PATH;
+
+typedef struct {
+ kal_uint32 Tracetop_IDFILTER_BIT127_96;
+ kal_uint32 Tracetop_IDFILTER_BIT95_64;
+ kal_uint32 Tracetop_IDFILTER_BIT63_32;
+ kal_uint32 Tracetop_IDFILTER_BIT31_0;
+} SCC_ATID_MASK;
+
+/* ATID dispatcher configuration */
+typedef struct {
+ SCC_SIB_PATH path_mask; /* path selection */
+ SCC_ATID_MASK to_emi_atids; /* ATIDs to EMI */
+ SCC_ATID_MASK to_sib_atids; /* ATIDs to SIB */
+} SCC_ATID_CFG;
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACETOP_EMI_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(const CSTF_PORT port, const kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(const CSTF_PORT port, kal_uint16 *const MBps, kal_uint8 *const pct);
+
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * *pstCaptureConfig:
+ * As an input to specify capture node and selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_ST_PCC_CAPTURE_CONFIG* pstCaptureConfig);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+/*
+ * [FUNCTION]
+ * Let EL1D to update CC mapping info to PCC driver
+ *
+ * [PARAMETERS]
+ * u8cc_mask:
+ * specify the CC's mask (LTE:max 5bit, NR: max 2bit)
+ * p_Info_arrary:
+ * specify CC goes which MIMO/L-path. MIMO: -1 means invalid. L-path: -1 means path is not enable
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_rxdfe_cc_info_lte(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+SCC_RESULT scc_pcc_rxdfe_cc_info_nr(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+kal_bool scc_pcc_atcmd(kal_uint32 len, kal_uint8 *data);
+
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FALSE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FALSE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info1(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info2(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info3(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL or SCC_RES_LOCKED
+ */
+SCC_RESULT scc_config_atid_dispatcher(const SCC_ATID_CFG *const atid_cfg);
+
+/**
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher w/o re-entry lock protection
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL
+ */
+SCC_RESULT scc_config_atid_dispatcher_nolock(const SCC_ATID_CFG *const atid_cfg);
+#endif /* !__SCC_H__ */
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/scc_mt6297.h b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6297.h
new file mode 100644
index 0000000..e5a7864
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6297.h
@@ -0,0 +1,931 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 01 15 2020 chwanhung.wang
+ * [MOLY00474840][SIB_DRV][PCC][MT6853] Mouton related code Call for Check-in on VMOLY
+ *
+ * 09 18 2019 kerwin.chung
+ * [MOLY00441119] [SIB_DRV][SCC] add dummy DVFS ctrl API to comply caller's common code of Petrus/Apollo
+ * add dummy DVFS ctrl to keep caller's consistency for GEN97 projects
+ *
+ * 07 18 2019 chwanhung.wang
+ * [MOLY00422863][SIB_DRV][PCC] Finish the Implementation of PCC AT Command
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACETOP_EMI_LINK_NOT_READY,
+ SCC_TRACETOP_STP_LINK_NOT_READY,
+ SCC_TRACETOP_NO_LINK_READY,
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACETOP_EMI_READY = 0,
+ SCC_TRACETOP_EMI_NOT_READY
+} SCC_TRACETOP_EMI_STATUS;
+
+typedef enum {
+ SCC_TRACETOP_STP_READY = 0,
+ SCC_TRACETOP_STP_NOT_READY,
+} SCC_TRACETOP_STP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_SDF_OPERATION_MODE_STANDALONE /* */= 0,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_CONFIG /* */= SCC_SDF_OPERATION_MODE_STANDALONE,
+
+ SCC_SDF_OPERATION_MODE_AUTO /* */= 1,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_CONFIG /* */= SCC_SDF_OPERATION_MODE_AUTO,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_START /* */= SCC_SDF_OPERATION_MODE_AUTO,
+
+ SCC_SDF_OPERATION_MODE_SEMI_AUTO /* */= 2,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_START /* */= SCC_SDF_OPERATION_MODE_SEMI_AUTO,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_STOP /* */= SCC_SDF_OPERATION_MODE_SEMI_AUTO,
+
+ SCC_SDF_OPERATION_MODE_MANUAL /* */= 3,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_STOP /* */= SCC_SDF_OPERATION_MODE_MANUAL,
+} SCC_SDF_OPERATION_MODE;
+
+typedef enum {
+ SCC_SDF_DISABLE_EN = 0,
+ SCC_SDF_ENABLE_EN = 1,
+} SCC_SDF_EN_SEL;
+
+typedef enum {
+ SCC_SDF_CONT_MODE = 0,
+ SCC_SDF_DIFF_MODE = 1,
+} SCC_SDF_MODE_SEL;
+
+typedef enum {
+ SCC_SDF_8BIT_WIDTH = 0,
+ SCC_SDF_16BIT_WIDTH = 1,
+ SCC_SDF_32BIT_WIDTH = 2
+} SCC_SDF_WIDTH_SEL;
+
+typedef enum {
+ SCC_SDF_624MHZ_CLOCK = 0,
+ SCC_SDF_312MHZ_CLOCK = 1,
+ SCC_SDF_156MHZ_CLOCK = 2,
+ SCC_SDF_78MHZ_CLOCK = 3
+} SCC_SDF_CLOCK_SEL;
+
+typedef struct {
+ kal_bool in_progress;
+ kal_bool overflowed;
+} SCC_SDF_STATUS;
+
+typedef enum {
+ SCC_SDF_SIB_TRIGGER = 0,
+ SCC_SDF_TARGET_TRIGGER = 1,
+} SCC_SDF_TRIGGER_MODE;
+typedef enum {
+ SCC_SDF_DBGMON_BYTE0_MUX = 0,
+ SCC_SDF_DBGMON_BYTE1_MUX = 1,
+ SCC_SDF_DBGMON_BYTE2_MUX = 2,
+ SCC_SDF_DBGMON_BYTE3_MUX = 3,
+ SCC_SDF_SWGPIO_BYTE0_MUX = 4,
+ SCC_SDF_SWGPIO_BYTE1_MUX = 5,
+ SCC_SDF_SWGPIO_BYTE2_MUX = 6,
+ SCC_SDF_SWGPIO_BYTE3_MUX = 7
+} SCC_SDF_MUX_SEL;
+
+typedef enum {
+ SCC_SDF_ASSERT_STOP_NOTHING = 0,
+ SCC_SDF_ASSERT_STOP_ASSERT = 1,
+} SCC_SDF_ASSERT_STOP_SEL;
+
+typedef struct {
+ SCC_SDF_OPERATION_MODE operation;
+ SCC_SDF_EN_SEL en; //for sdf_get_config only
+ SCC_SDF_MODE_SEL mode;
+ SCC_SDF_WIDTH_SEL width;
+ kal_uint32 enBitmap;
+ SCC_SDF_CLOCK_SEL clock;
+ SCC_SDF_MUX_SEL mux0;
+ SCC_SDF_MUX_SEL mux1;
+ SCC_SDF_MUX_SEL mux2;
+ SCC_SDF_MUX_SEL mux3;
+ kal_uint32 swGpio;
+ SCC_SDF_ASSERT_STOP_SEL assert;
+} SCC_SDF_CONFIG_PARAM;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef struct {
+ kal_bool b8ATBFull;
+ kal_bool b8ThroughputMismatch;
+ kal_uint8 u8FifoDepthAT1;
+ kal_uint8 u8FifoDepthAT2;
+ kal_uint8 u8FifoDepthAT3;
+} SCC_ST_PCC_FIFO_STATUS;
+
+typedef enum {
+ SCC_EN_PCC_MODE_RXDFE_INTP_NR_122P88 = 0,
+ SCC_EN_PCC_MODE_RXDFE_INTP_NR_61P44 = 1,
+ SCC_EN_PCC_MODE_RXDFE_INTP_NR_BELOW_30P72 = 2,
+ SCC_EN_PCC_MODE_RXDFE_INTP_LTE = 3,
+ SCC_EN_PCC_MODE_RXDFE_INTP_FDD = 4,
+ SCC_EN_PCC_MODE_RXDFE_INTP_TDD = 5,
+ SCC_EN_PCC_MODE_RXDFE_INTP_C2K = 6,
+ SCC_EN_PCC_MODE_RXDFE_INTP_CS_NR_LTE = 7,
+ SCC_EN_PCC_MODE_RXDFE_CS_NR_LTE = 8,
+ SCC_EN_PCC_MODE_TXDFE_BB_24BIT = 9,
+ SCC_EN_PCC_MODE_TXDFE_BB_32BIT = 10,
+ SCC_EN_PCC_MODE_CAPMODE_MAX
+}SCC_EN_PCC_DFESYS_CAPTURE_MODE;
+
+
+typedef enum {
+ SCC_EN_PCC_PRESYNC_LTE_STIME = 0,
+ SCC_EN_PCC_PRESYNC_FDD_STIME,
+ SCC_EN_PCC_PRESYNC_TDD_STIME,
+ SCC_EN_PCC_PRESYNC_C2K_STIME,
+ SCC_EN_PCC_PRESYNC_NR_STIME,
+ SCC_EN_PCC_PRESYNC_STIME_SEL_MAX
+} SCC_EN_PCC_PRESYNC_STIME_SEL;
+
+
+typedef struct _SCC_ST_ATB_PATH_SEL {
+ kal_bool b8P11Enable;
+ kal_bool b8P12Enable;
+ kal_bool b8P21Enable;
+ kal_bool b8AdjEnable;
+} SCC_ST_ATB_PATH_SEL;
+
+typedef struct _SCC_ST_PRESYNC_PATH_SEL_4BIT{
+ unsigned Formatter1:4;
+ unsigned Formatter2:4;
+ unsigned Formatter3:4;
+ unsigned Formatter4:4;
+ unsigned :0;
+} SCC_ST_PRESYNC_PATH_SEL_4BIT;
+
+typedef union _SCC_UNI_PRESYNC_PATH_SEL{
+ kal_uint16 u16PresyncPathSel;
+ SCC_ST_PRESYNC_PATH_SEL_4BIT stPresyncPathSel;
+} SCC_UNI_PRESYNC_PATH_SEL;
+
+typedef struct _SCC_ST_PRESYNC_TRUNCATE_RX_2BIT{
+ unsigned Formatter1:2;
+ unsigned Formatter2:2;
+ unsigned Formatter3:2;
+ unsigned Formatter4:2;
+ unsigned :0;
+} SCC_ST_PRESYNC_TRUNCATE_RX_2BIT;
+
+typedef union _SCC_UNI_PRESYNC_TRUNCATE_RX{
+ kal_uint8 u8PresyncTruncateRx;
+ SCC_ST_PRESYNC_TRUNCATE_RX_2BIT stPresyncTruncateRx;
+} SCC_UNI_PRESYNC_TRUNCATE_RX;
+
+typedef struct _SCC_ST_PRESYNC_TRUNCATE_TX_2BIT{
+ unsigned TXK_REF:2;
+ unsigned TXK_DET:2;
+ unsigned :0;
+} SCC_ST_PRESYNC_TRUNCATE_TX_2BIT;
+
+typedef union _SCC_UNI_PRESYNC_TRUNCATE_TX{
+ kal_uint8 u8PresyncTruncateTx;
+ SCC_ST_PRESYNC_TRUNCATE_TX_2BIT stPresyncTruncateTx;
+} SCC_UNI_PRESYNC_TRUNCATE_TX;
+
+typedef struct _SCC_ST_PRESYNC_STIME_SEL_3BIT{
+ unsigned Formatter1:3;
+ unsigned Formatter2:3;
+ unsigned Formatter3:3;
+ unsigned Formatter4:3;
+ unsigned :0;
+} SCC_ST_PRESYNC_STIME_SEL_3BIT;
+
+typedef union _SCC_UNI_PRESYNC_STIME_SEL{
+ kal_uint16 u16PresyncSTimeSel;
+ SCC_ST_PRESYNC_STIME_SEL_3BIT stPresyncSTimeSel;
+} SCC_UNI_PRESYNC_STIME_SEL;
+
+
+typedef struct _SCC_ST_PCC_CAPTURE_CONFIG {
+ SCC_EN_PCC_DFESYS_CAPTURE_MODE enCapMode;
+ SCC_ST_ATB_PATH_SEL stATBPathSel;
+ kal_uint32 u32CCPathSelRX;
+ SCC_UNI_PRESYNC_STIME_SEL unPresyncSTimeSel;
+ SCC_UNI_PRESYNC_TRUNCATE_RX unPresyncTruncateRx;
+} SCC_ST_PCC_CAPTURE_CONFIG;
+
+typedef struct
+{
+ kal_uint32 addr;
+ kal_uint32 length;
+} SCC_TRACETOP_RUNTIME_MEMORY_INFO_T;
+
+typedef enum {
+ ET_PASS = 0,
+ TRACETOP_START_FAIL = 1,
+ PCC_CONFIG = 2,
+ PCC_FSM_STA = 3,
+ PCC_OVERFLOW = 4,
+ TRACETOP_STOP = 5,
+ PCC_SOFT_RESET = 6
+} SCC_ET_ERROR_CODE;
+
+typedef enum {
+ SCC_ET_EN_TXDFE_DET = 0, //only det
+ SCC_ET_EN_TXDFE_REF = 1, //only ref
+ SCC_ET_EN_TXDFE_DET_REF = 2 //det and ref
+} SCC_ET_EN_TX_CAPTURE_NODE;
+
+typedef struct _SCC_ST_PCC_ET_CONFIG {
+ kal_uint32 u32SampleRateHz;
+ kal_uint8 u8SFN;
+} SCC_ST_PCC_ET_CONFIG;
+
+typedef enum {
+ SCC_NO_PATH = 0x0,
+ SCC_STP_PATH = 0x1,
+ SCC_EMI_PATH = 0x2
+} SCC_SIB_PATH;
+
+typedef struct {
+ kal_uint32 Tracetop_IDFILTER_BIT127_96;
+ kal_uint32 Tracetop_IDFILTER_BIT95_64;
+ kal_uint32 Tracetop_IDFILTER_BIT63_32;
+ kal_uint32 Tracetop_IDFILTER_BIT31_0;
+} SCC_ATID_MASK;
+
+/* ATID dispatcher configuration */
+typedef struct {
+ SCC_SIB_PATH path_mask; /* path selection */
+ SCC_ATID_MASK to_emi_atids; /* ATIDs to EMI */
+ SCC_ATID_MASK to_sib_atids; /* ATIDs to SIB */
+} SCC_ATID_CFG;
+
+/*********************************************************/
+/* The structures used for Rxdfe */
+/*********************************************************/
+#define SCC_RXDFE_CC_RX_MAX_NUM (4)
+
+
+typedef enum
+{
+ SCC_RXDFE_MIMO_2x2_CFG= 0,
+ SCC_RXDFE_MIMO_4x4_CFG,
+ SCC_RXDFE_MIMO_CFG_NUM,
+ SCC_RXDFE_MIMO_INVLD_CFG = -1
+}SCC_ST_PCC_RF_RXDFE_MIMO_CFG_E;
+
+typedef struct
+{
+ SCC_ST_PCC_RF_RXDFE_MIMO_CFG_E rxdfe_mimo_cfg;
+ /* Layer-path index. Valid values 0-15(E1)/17(E2). Invalid -1 */
+ kal_int8 rxdfe_l_idx[SCC_RXDFE_CC_RX_MAX_NUM];
+}SCC_ST_PCC_RF_RXDFE_PATH_INDEX;
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACETOP_EMI_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(const CSTF_PORT port, const kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(const CSTF_PORT port, kal_uint16 *const MBps, kal_uint8 *const pct);
+
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * *pstCaptureConfig:
+ * As an input to specify capture node and selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_ST_PCC_CAPTURE_CONFIG* pstCaptureConfig);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+/*
+ * [FUNCTION]
+ * Let EL1D to update CC mapping info to PCC driver
+ *
+ * [PARAMETERS]
+ * u8cc_mask:
+ * specify the CC's mask (LTE:max 5bit, NR: max 2bit)
+ * p_Info_arrary:
+ * specify CC goes which MIMO/L-path. MIMO: -1 means invalid. L-path: -1 means path is not enable
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_rxdfe_cc_info_lte(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+SCC_RESULT scc_pcc_rxdfe_cc_info_nr(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+kal_bool scc_pcc_atcmd(kal_uint32 len, kal_uint8 *data);
+
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FALSE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FALSE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info1(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info2(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info3(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL or SCC_RES_LOCKED
+ */
+SCC_RESULT scc_config_atid_dispatcher(const SCC_ATID_CFG *const atid_cfg);
+
+/*
+ * [FUNCTION]
+ * Lock trace_top required DVFS vModem
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+#define scc_init_dvfs_ctrl()
+#endif /* !__SCC_H__ */
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/scc_mt6833.h b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6833.h
new file mode 100644
index 0000000..487435c
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6833.h
@@ -0,0 +1,770 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 08 20 2020 patty.chen
+ * [MOLY00558395] [IQ dump] Conditional trigger PCC IQ dump for CSD
+ * Support Conditional event trigger PCC Dump
+ *
+ * 12 10 2019 wiki.wang
+ * [MOLY00464901] [Margaux][SIB_DRV] EMI IQ dump ATCMD
+ *
+ * EMI dump ATcmd for Petrus and Marguax
+ *
+ * 09 11 2019 kerwin.chung
+ * [MOLY00439413] [SIB_DRV][SCC] integrate DVFS lock and bus remap
+ * Official scc of MT6885
+ *
+ * 07 30 2019 chwanhung.wang
+ * [MOLY00426278][SIB_DRV][PCC] Re-org the code for new SCC code architecture
+ *
+ * 07 19 2019 kerwin.chung
+ * [MOLY00423651] [SIB_DRV][SCC/SDF] re-arc for better de-coupling
+ * re-arc SCC w/ SDF for Petrus(MT6885)
+ *
+ * 07 18 2019 chwanhung.wang
+ * [MOLY00422863][SIB_DRV][PCC] Finish the Implementation of PCC AT Command
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+#include "sdf/sdf.h"
+#include "pcc/pcc.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACETOP_EMI_LINK_NOT_READY,
+ SCC_TRACETOP_STP_LINK_NOT_READY,
+ SCC_TRACETOP_NO_LINK_READY,
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACETOP_EMI_READY = 0,
+ SCC_TRACETOP_EMI_NOT_READY
+} SCC_TRACETOP_EMI_STATUS;
+
+typedef enum {
+ SCC_TRACETOP_STP_READY = 0,
+ SCC_TRACETOP_STP_NOT_READY,
+} SCC_TRACETOP_STP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef enum {
+ SCC_NO_PATH = 0x0,
+ SCC_STP_PATH = 0x1,
+ SCC_EMI_PATH = 0x2
+} SCC_SIB_PATH;
+
+typedef struct {
+ kal_uint32 Tracetop_IDFILTER_BIT127_96;
+ kal_uint32 Tracetop_IDFILTER_BIT95_64;
+ kal_uint32 Tracetop_IDFILTER_BIT63_32;
+ kal_uint32 Tracetop_IDFILTER_BIT31_0;
+} SCC_ATID_MASK;
+
+/* ATID dispatcher configuration */
+typedef struct {
+ SCC_SIB_PATH path_mask; /* path selection */
+ SCC_ATID_MASK to_emi_atids; /* ATIDs to EMI */
+ SCC_ATID_MASK to_sib_atids; /* ATIDs to SIB */
+} SCC_ATID_CFG;
+
+typedef struct _scc_decoded_data_t
+{
+ kal_uint8 ATID;
+ kal_uint8 data;
+} scc_decoded_data_t;
+
+/* 15/16B decode frame */
+typedef struct _scc_decoded_frame_data_t
+{
+ scc_decoded_data_t decoded_data[15];
+} scc_decoded_frame_data_t;
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACETOP_EMI_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(const CSTF_PORT port, const kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(const CSTF_PORT port, kal_uint16 *const MBps, kal_uint8 *const pct);
+
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * *pstCaptureConfig:
+ * As an input to specify capture node and selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_ST_PCC_CAPTURE_CONFIG* pstCaptureConfig);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+/*
+ * [FUNCTION]
+ * Let EL1D to update CC mapping info to PCC driver
+ *
+ * [PARAMETERS]
+ * u8cc_mask:
+ * specify the CC's mask (LTE:max 5bit, NR: max 2bit)
+ * p_Info_arrary:
+ * specify CC goes which MIMO/L-path. MIMO: -1 means invalid. L-path: -1 means path is not enable
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_rxdfe_cc_info_lte(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+SCC_RESULT scc_pcc_rxdfe_cc_info_nr(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+kal_bool scc_pcc_atcmd(kal_uint32 len, kal_uint8 *data);
+kal_bool scc_tracetop_atcmd(kal_uint32 len, kal_uint8 *data);
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FALSE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FALSE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info1(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info2(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info3(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL or SCC_RES_LOCKED
+ */
+SCC_RESULT scc_config_atid_dispatcher(const SCC_ATID_CFG *const atid_cfg);
+
+/**
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher w/o re-entry lock protection
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL
+ */
+SCC_RESULT scc_config_atid_dispatcher_nolock(const SCC_ATID_CFG *const atid_cfg);
+
+/*
+ * [FUNCTION]
+ * Decode 15/16B frame
+ *
+ * [PARAMETERS]
+ * emi: ATID configurations
+ * decoded_frame: decoded data
+ * current_ATID: current ATID
+ *
+ * [RETURN]
+ * Data length
+ */
+kal_uint32 scc_15B16B_frame_decode(kal_uint32 addr, scc_decoded_frame_data_t* decoded_frame, kal_uint8* current_ATID);
+
+/*
+ * [FUNCTION]
+ * Lock trace_top required DVFS vModem after
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_init_dvfs_ctrl(void);
+
+/*
+ * [FUNCTION]
+ * For setting non-WARP mode in Tractop DMA Control Module
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_set_emi_mem_full_stop(void);
+
+#endif /* !__SCC_H__ */
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/scc_mt6853.h b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6853.h
new file mode 100644
index 0000000..487435c
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6853.h
@@ -0,0 +1,770 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 08 20 2020 patty.chen
+ * [MOLY00558395] [IQ dump] Conditional trigger PCC IQ dump for CSD
+ * Support Conditional event trigger PCC Dump
+ *
+ * 12 10 2019 wiki.wang
+ * [MOLY00464901] [Margaux][SIB_DRV] EMI IQ dump ATCMD
+ *
+ * EMI dump ATcmd for Petrus and Marguax
+ *
+ * 09 11 2019 kerwin.chung
+ * [MOLY00439413] [SIB_DRV][SCC] integrate DVFS lock and bus remap
+ * Official scc of MT6885
+ *
+ * 07 30 2019 chwanhung.wang
+ * [MOLY00426278][SIB_DRV][PCC] Re-org the code for new SCC code architecture
+ *
+ * 07 19 2019 kerwin.chung
+ * [MOLY00423651] [SIB_DRV][SCC/SDF] re-arc for better de-coupling
+ * re-arc SCC w/ SDF for Petrus(MT6885)
+ *
+ * 07 18 2019 chwanhung.wang
+ * [MOLY00422863][SIB_DRV][PCC] Finish the Implementation of PCC AT Command
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+#include "sdf/sdf.h"
+#include "pcc/pcc.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACETOP_EMI_LINK_NOT_READY,
+ SCC_TRACETOP_STP_LINK_NOT_READY,
+ SCC_TRACETOP_NO_LINK_READY,
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACETOP_EMI_READY = 0,
+ SCC_TRACETOP_EMI_NOT_READY
+} SCC_TRACETOP_EMI_STATUS;
+
+typedef enum {
+ SCC_TRACETOP_STP_READY = 0,
+ SCC_TRACETOP_STP_NOT_READY,
+} SCC_TRACETOP_STP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef enum {
+ SCC_NO_PATH = 0x0,
+ SCC_STP_PATH = 0x1,
+ SCC_EMI_PATH = 0x2
+} SCC_SIB_PATH;
+
+typedef struct {
+ kal_uint32 Tracetop_IDFILTER_BIT127_96;
+ kal_uint32 Tracetop_IDFILTER_BIT95_64;
+ kal_uint32 Tracetop_IDFILTER_BIT63_32;
+ kal_uint32 Tracetop_IDFILTER_BIT31_0;
+} SCC_ATID_MASK;
+
+/* ATID dispatcher configuration */
+typedef struct {
+ SCC_SIB_PATH path_mask; /* path selection */
+ SCC_ATID_MASK to_emi_atids; /* ATIDs to EMI */
+ SCC_ATID_MASK to_sib_atids; /* ATIDs to SIB */
+} SCC_ATID_CFG;
+
+typedef struct _scc_decoded_data_t
+{
+ kal_uint8 ATID;
+ kal_uint8 data;
+} scc_decoded_data_t;
+
+/* 15/16B decode frame */
+typedef struct _scc_decoded_frame_data_t
+{
+ scc_decoded_data_t decoded_data[15];
+} scc_decoded_frame_data_t;
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACETOP_EMI_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(const CSTF_PORT port, const kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(const CSTF_PORT port, kal_uint16 *const MBps, kal_uint8 *const pct);
+
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * *pstCaptureConfig:
+ * As an input to specify capture node and selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_ST_PCC_CAPTURE_CONFIG* pstCaptureConfig);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+/*
+ * [FUNCTION]
+ * Let EL1D to update CC mapping info to PCC driver
+ *
+ * [PARAMETERS]
+ * u8cc_mask:
+ * specify the CC's mask (LTE:max 5bit, NR: max 2bit)
+ * p_Info_arrary:
+ * specify CC goes which MIMO/L-path. MIMO: -1 means invalid. L-path: -1 means path is not enable
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_rxdfe_cc_info_lte(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+SCC_RESULT scc_pcc_rxdfe_cc_info_nr(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+kal_bool scc_pcc_atcmd(kal_uint32 len, kal_uint8 *data);
+kal_bool scc_tracetop_atcmd(kal_uint32 len, kal_uint8 *data);
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FALSE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FALSE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info1(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info2(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info3(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL or SCC_RES_LOCKED
+ */
+SCC_RESULT scc_config_atid_dispatcher(const SCC_ATID_CFG *const atid_cfg);
+
+/**
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher w/o re-entry lock protection
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL
+ */
+SCC_RESULT scc_config_atid_dispatcher_nolock(const SCC_ATID_CFG *const atid_cfg);
+
+/*
+ * [FUNCTION]
+ * Decode 15/16B frame
+ *
+ * [PARAMETERS]
+ * emi: ATID configurations
+ * decoded_frame: decoded data
+ * current_ATID: current ATID
+ *
+ * [RETURN]
+ * Data length
+ */
+kal_uint32 scc_15B16B_frame_decode(kal_uint32 addr, scc_decoded_frame_data_t* decoded_frame, kal_uint8* current_ATID);
+
+/*
+ * [FUNCTION]
+ * Lock trace_top required DVFS vModem after
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_init_dvfs_ctrl(void);
+
+/*
+ * [FUNCTION]
+ * For setting non-WARP mode in Tractop DMA Control Module
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_set_emi_mem_full_stop(void);
+
+#endif /* !__SCC_H__ */
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/scc_mt6873.h b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6873.h
new file mode 100644
index 0000000..487435c
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6873.h
@@ -0,0 +1,770 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 08 20 2020 patty.chen
+ * [MOLY00558395] [IQ dump] Conditional trigger PCC IQ dump for CSD
+ * Support Conditional event trigger PCC Dump
+ *
+ * 12 10 2019 wiki.wang
+ * [MOLY00464901] [Margaux][SIB_DRV] EMI IQ dump ATCMD
+ *
+ * EMI dump ATcmd for Petrus and Marguax
+ *
+ * 09 11 2019 kerwin.chung
+ * [MOLY00439413] [SIB_DRV][SCC] integrate DVFS lock and bus remap
+ * Official scc of MT6885
+ *
+ * 07 30 2019 chwanhung.wang
+ * [MOLY00426278][SIB_DRV][PCC] Re-org the code for new SCC code architecture
+ *
+ * 07 19 2019 kerwin.chung
+ * [MOLY00423651] [SIB_DRV][SCC/SDF] re-arc for better de-coupling
+ * re-arc SCC w/ SDF for Petrus(MT6885)
+ *
+ * 07 18 2019 chwanhung.wang
+ * [MOLY00422863][SIB_DRV][PCC] Finish the Implementation of PCC AT Command
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+#include "sdf/sdf.h"
+#include "pcc/pcc.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACETOP_EMI_LINK_NOT_READY,
+ SCC_TRACETOP_STP_LINK_NOT_READY,
+ SCC_TRACETOP_NO_LINK_READY,
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACETOP_EMI_READY = 0,
+ SCC_TRACETOP_EMI_NOT_READY
+} SCC_TRACETOP_EMI_STATUS;
+
+typedef enum {
+ SCC_TRACETOP_STP_READY = 0,
+ SCC_TRACETOP_STP_NOT_READY,
+} SCC_TRACETOP_STP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef enum {
+ SCC_NO_PATH = 0x0,
+ SCC_STP_PATH = 0x1,
+ SCC_EMI_PATH = 0x2
+} SCC_SIB_PATH;
+
+typedef struct {
+ kal_uint32 Tracetop_IDFILTER_BIT127_96;
+ kal_uint32 Tracetop_IDFILTER_BIT95_64;
+ kal_uint32 Tracetop_IDFILTER_BIT63_32;
+ kal_uint32 Tracetop_IDFILTER_BIT31_0;
+} SCC_ATID_MASK;
+
+/* ATID dispatcher configuration */
+typedef struct {
+ SCC_SIB_PATH path_mask; /* path selection */
+ SCC_ATID_MASK to_emi_atids; /* ATIDs to EMI */
+ SCC_ATID_MASK to_sib_atids; /* ATIDs to SIB */
+} SCC_ATID_CFG;
+
+typedef struct _scc_decoded_data_t
+{
+ kal_uint8 ATID;
+ kal_uint8 data;
+} scc_decoded_data_t;
+
+/* 15/16B decode frame */
+typedef struct _scc_decoded_frame_data_t
+{
+ scc_decoded_data_t decoded_data[15];
+} scc_decoded_frame_data_t;
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACETOP_EMI_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(const CSTF_PORT port, const kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(const CSTF_PORT port, kal_uint16 *const MBps, kal_uint8 *const pct);
+
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * *pstCaptureConfig:
+ * As an input to specify capture node and selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_ST_PCC_CAPTURE_CONFIG* pstCaptureConfig);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+/*
+ * [FUNCTION]
+ * Let EL1D to update CC mapping info to PCC driver
+ *
+ * [PARAMETERS]
+ * u8cc_mask:
+ * specify the CC's mask (LTE:max 5bit, NR: max 2bit)
+ * p_Info_arrary:
+ * specify CC goes which MIMO/L-path. MIMO: -1 means invalid. L-path: -1 means path is not enable
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_rxdfe_cc_info_lte(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+SCC_RESULT scc_pcc_rxdfe_cc_info_nr(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+kal_bool scc_pcc_atcmd(kal_uint32 len, kal_uint8 *data);
+kal_bool scc_tracetop_atcmd(kal_uint32 len, kal_uint8 *data);
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FALSE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FALSE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info1(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info2(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info3(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL or SCC_RES_LOCKED
+ */
+SCC_RESULT scc_config_atid_dispatcher(const SCC_ATID_CFG *const atid_cfg);
+
+/**
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher w/o re-entry lock protection
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL
+ */
+SCC_RESULT scc_config_atid_dispatcher_nolock(const SCC_ATID_CFG *const atid_cfg);
+
+/*
+ * [FUNCTION]
+ * Decode 15/16B frame
+ *
+ * [PARAMETERS]
+ * emi: ATID configurations
+ * decoded_frame: decoded data
+ * current_ATID: current ATID
+ *
+ * [RETURN]
+ * Data length
+ */
+kal_uint32 scc_15B16B_frame_decode(kal_uint32 addr, scc_decoded_frame_data_t* decoded_frame, kal_uint8* current_ATID);
+
+/*
+ * [FUNCTION]
+ * Lock trace_top required DVFS vModem after
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_init_dvfs_ctrl(void);
+
+/*
+ * [FUNCTION]
+ * For setting non-WARP mode in Tractop DMA Control Module
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_set_emi_mem_full_stop(void);
+
+#endif /* !__SCC_H__ */
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/scc_mt6877.h b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6877.h
new file mode 100644
index 0000000..487435c
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6877.h
@@ -0,0 +1,770 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 08 20 2020 patty.chen
+ * [MOLY00558395] [IQ dump] Conditional trigger PCC IQ dump for CSD
+ * Support Conditional event trigger PCC Dump
+ *
+ * 12 10 2019 wiki.wang
+ * [MOLY00464901] [Margaux][SIB_DRV] EMI IQ dump ATCMD
+ *
+ * EMI dump ATcmd for Petrus and Marguax
+ *
+ * 09 11 2019 kerwin.chung
+ * [MOLY00439413] [SIB_DRV][SCC] integrate DVFS lock and bus remap
+ * Official scc of MT6885
+ *
+ * 07 30 2019 chwanhung.wang
+ * [MOLY00426278][SIB_DRV][PCC] Re-org the code for new SCC code architecture
+ *
+ * 07 19 2019 kerwin.chung
+ * [MOLY00423651] [SIB_DRV][SCC/SDF] re-arc for better de-coupling
+ * re-arc SCC w/ SDF for Petrus(MT6885)
+ *
+ * 07 18 2019 chwanhung.wang
+ * [MOLY00422863][SIB_DRV][PCC] Finish the Implementation of PCC AT Command
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+#include "sdf/sdf.h"
+#include "pcc/pcc.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACETOP_EMI_LINK_NOT_READY,
+ SCC_TRACETOP_STP_LINK_NOT_READY,
+ SCC_TRACETOP_NO_LINK_READY,
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACETOP_EMI_READY = 0,
+ SCC_TRACETOP_EMI_NOT_READY
+} SCC_TRACETOP_EMI_STATUS;
+
+typedef enum {
+ SCC_TRACETOP_STP_READY = 0,
+ SCC_TRACETOP_STP_NOT_READY,
+} SCC_TRACETOP_STP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef enum {
+ SCC_NO_PATH = 0x0,
+ SCC_STP_PATH = 0x1,
+ SCC_EMI_PATH = 0x2
+} SCC_SIB_PATH;
+
+typedef struct {
+ kal_uint32 Tracetop_IDFILTER_BIT127_96;
+ kal_uint32 Tracetop_IDFILTER_BIT95_64;
+ kal_uint32 Tracetop_IDFILTER_BIT63_32;
+ kal_uint32 Tracetop_IDFILTER_BIT31_0;
+} SCC_ATID_MASK;
+
+/* ATID dispatcher configuration */
+typedef struct {
+ SCC_SIB_PATH path_mask; /* path selection */
+ SCC_ATID_MASK to_emi_atids; /* ATIDs to EMI */
+ SCC_ATID_MASK to_sib_atids; /* ATIDs to SIB */
+} SCC_ATID_CFG;
+
+typedef struct _scc_decoded_data_t
+{
+ kal_uint8 ATID;
+ kal_uint8 data;
+} scc_decoded_data_t;
+
+/* 15/16B decode frame */
+typedef struct _scc_decoded_frame_data_t
+{
+ scc_decoded_data_t decoded_data[15];
+} scc_decoded_frame_data_t;
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACETOP_EMI_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(const CSTF_PORT port, const kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(const CSTF_PORT port, kal_uint16 *const MBps, kal_uint8 *const pct);
+
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * *pstCaptureConfig:
+ * As an input to specify capture node and selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_ST_PCC_CAPTURE_CONFIG* pstCaptureConfig);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+/*
+ * [FUNCTION]
+ * Let EL1D to update CC mapping info to PCC driver
+ *
+ * [PARAMETERS]
+ * u8cc_mask:
+ * specify the CC's mask (LTE:max 5bit, NR: max 2bit)
+ * p_Info_arrary:
+ * specify CC goes which MIMO/L-path. MIMO: -1 means invalid. L-path: -1 means path is not enable
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_rxdfe_cc_info_lte(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+SCC_RESULT scc_pcc_rxdfe_cc_info_nr(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+kal_bool scc_pcc_atcmd(kal_uint32 len, kal_uint8 *data);
+kal_bool scc_tracetop_atcmd(kal_uint32 len, kal_uint8 *data);
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FALSE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FALSE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info1(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info2(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info3(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL or SCC_RES_LOCKED
+ */
+SCC_RESULT scc_config_atid_dispatcher(const SCC_ATID_CFG *const atid_cfg);
+
+/**
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher w/o re-entry lock protection
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL
+ */
+SCC_RESULT scc_config_atid_dispatcher_nolock(const SCC_ATID_CFG *const atid_cfg);
+
+/*
+ * [FUNCTION]
+ * Decode 15/16B frame
+ *
+ * [PARAMETERS]
+ * emi: ATID configurations
+ * decoded_frame: decoded data
+ * current_ATID: current ATID
+ *
+ * [RETURN]
+ * Data length
+ */
+kal_uint32 scc_15B16B_frame_decode(kal_uint32 addr, scc_decoded_frame_data_t* decoded_frame, kal_uint8* current_ATID);
+
+/*
+ * [FUNCTION]
+ * Lock trace_top required DVFS vModem after
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_init_dvfs_ctrl(void);
+
+/*
+ * [FUNCTION]
+ * For setting non-WARP mode in Tractop DMA Control Module
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_set_emi_mem_full_stop(void);
+
+#endif /* !__SCC_H__ */
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/scc_mt6885.h b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6885.h
new file mode 100644
index 0000000..487435c
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6885.h
@@ -0,0 +1,770 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 08 20 2020 patty.chen
+ * [MOLY00558395] [IQ dump] Conditional trigger PCC IQ dump for CSD
+ * Support Conditional event trigger PCC Dump
+ *
+ * 12 10 2019 wiki.wang
+ * [MOLY00464901] [Margaux][SIB_DRV] EMI IQ dump ATCMD
+ *
+ * EMI dump ATcmd for Petrus and Marguax
+ *
+ * 09 11 2019 kerwin.chung
+ * [MOLY00439413] [SIB_DRV][SCC] integrate DVFS lock and bus remap
+ * Official scc of MT6885
+ *
+ * 07 30 2019 chwanhung.wang
+ * [MOLY00426278][SIB_DRV][PCC] Re-org the code for new SCC code architecture
+ *
+ * 07 19 2019 kerwin.chung
+ * [MOLY00423651] [SIB_DRV][SCC/SDF] re-arc for better de-coupling
+ * re-arc SCC w/ SDF for Petrus(MT6885)
+ *
+ * 07 18 2019 chwanhung.wang
+ * [MOLY00422863][SIB_DRV][PCC] Finish the Implementation of PCC AT Command
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+#include "sdf/sdf.h"
+#include "pcc/pcc.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACETOP_EMI_LINK_NOT_READY,
+ SCC_TRACETOP_STP_LINK_NOT_READY,
+ SCC_TRACETOP_NO_LINK_READY,
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACETOP_EMI_READY = 0,
+ SCC_TRACETOP_EMI_NOT_READY
+} SCC_TRACETOP_EMI_STATUS;
+
+typedef enum {
+ SCC_TRACETOP_STP_READY = 0,
+ SCC_TRACETOP_STP_NOT_READY,
+} SCC_TRACETOP_STP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef enum {
+ SCC_NO_PATH = 0x0,
+ SCC_STP_PATH = 0x1,
+ SCC_EMI_PATH = 0x2
+} SCC_SIB_PATH;
+
+typedef struct {
+ kal_uint32 Tracetop_IDFILTER_BIT127_96;
+ kal_uint32 Tracetop_IDFILTER_BIT95_64;
+ kal_uint32 Tracetop_IDFILTER_BIT63_32;
+ kal_uint32 Tracetop_IDFILTER_BIT31_0;
+} SCC_ATID_MASK;
+
+/* ATID dispatcher configuration */
+typedef struct {
+ SCC_SIB_PATH path_mask; /* path selection */
+ SCC_ATID_MASK to_emi_atids; /* ATIDs to EMI */
+ SCC_ATID_MASK to_sib_atids; /* ATIDs to SIB */
+} SCC_ATID_CFG;
+
+typedef struct _scc_decoded_data_t
+{
+ kal_uint8 ATID;
+ kal_uint8 data;
+} scc_decoded_data_t;
+
+/* 15/16B decode frame */
+typedef struct _scc_decoded_frame_data_t
+{
+ scc_decoded_data_t decoded_data[15];
+} scc_decoded_frame_data_t;
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACETOP_EMI_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(const CSTF_PORT port, const kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(const CSTF_PORT port, kal_uint16 *const MBps, kal_uint8 *const pct);
+
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * *pstCaptureConfig:
+ * As an input to specify capture node and selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_ST_PCC_CAPTURE_CONFIG* pstCaptureConfig);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+/*
+ * [FUNCTION]
+ * Let EL1D to update CC mapping info to PCC driver
+ *
+ * [PARAMETERS]
+ * u8cc_mask:
+ * specify the CC's mask (LTE:max 5bit, NR: max 2bit)
+ * p_Info_arrary:
+ * specify CC goes which MIMO/L-path. MIMO: -1 means invalid. L-path: -1 means path is not enable
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_rxdfe_cc_info_lte(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+SCC_RESULT scc_pcc_rxdfe_cc_info_nr(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+kal_bool scc_pcc_atcmd(kal_uint32 len, kal_uint8 *data);
+kal_bool scc_tracetop_atcmd(kal_uint32 len, kal_uint8 *data);
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FALSE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FALSE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info1(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info2(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info3(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL or SCC_RES_LOCKED
+ */
+SCC_RESULT scc_config_atid_dispatcher(const SCC_ATID_CFG *const atid_cfg);
+
+/**
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher w/o re-entry lock protection
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL
+ */
+SCC_RESULT scc_config_atid_dispatcher_nolock(const SCC_ATID_CFG *const atid_cfg);
+
+/*
+ * [FUNCTION]
+ * Decode 15/16B frame
+ *
+ * [PARAMETERS]
+ * emi: ATID configurations
+ * decoded_frame: decoded data
+ * current_ATID: current ATID
+ *
+ * [RETURN]
+ * Data length
+ */
+kal_uint32 scc_15B16B_frame_decode(kal_uint32 addr, scc_decoded_frame_data_t* decoded_frame, kal_uint8* current_ATID);
+
+/*
+ * [FUNCTION]
+ * Lock trace_top required DVFS vModem after
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_init_dvfs_ctrl(void);
+
+/*
+ * [FUNCTION]
+ * For setting non-WARP mode in Tractop DMA Control Module
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_set_emi_mem_full_stop(void);
+
+#endif /* !__SCC_H__ */
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/scc_mt6893.h b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6893.h
new file mode 100644
index 0000000..487435c
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/scc_mt6893.h
@@ -0,0 +1,770 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 08 20 2020 patty.chen
+ * [MOLY00558395] [IQ dump] Conditional trigger PCC IQ dump for CSD
+ * Support Conditional event trigger PCC Dump
+ *
+ * 12 10 2019 wiki.wang
+ * [MOLY00464901] [Margaux][SIB_DRV] EMI IQ dump ATCMD
+ *
+ * EMI dump ATcmd for Petrus and Marguax
+ *
+ * 09 11 2019 kerwin.chung
+ * [MOLY00439413] [SIB_DRV][SCC] integrate DVFS lock and bus remap
+ * Official scc of MT6885
+ *
+ * 07 30 2019 chwanhung.wang
+ * [MOLY00426278][SIB_DRV][PCC] Re-org the code for new SCC code architecture
+ *
+ * 07 19 2019 kerwin.chung
+ * [MOLY00423651] [SIB_DRV][SCC/SDF] re-arc for better de-coupling
+ * re-arc SCC w/ SDF for Petrus(MT6885)
+ *
+ * 07 18 2019 chwanhung.wang
+ * [MOLY00422863][SIB_DRV][PCC] Finish the Implementation of PCC AT Command
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SCC_H__
+#define __SCC_H__
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+#include "sdf/sdf.h"
+#include "pcc/pcc.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_OK = 0,
+ SCC_FAIL,
+ SCC_DISABLED,
+ SCC_RES_LOCKED,
+ SCC_FEATURE_NOT_SUPPORTED,
+ SCC_TRACETOP_EMI_LINK_NOT_READY,
+ SCC_TRACETOP_STP_LINK_NOT_READY,
+ SCC_TRACETOP_NO_LINK_READY,
+} SCC_RESULT;
+
+typedef enum {
+ SCC_TRACETOP_EMI_READY = 0,
+ SCC_TRACETOP_EMI_NOT_READY
+} SCC_TRACETOP_EMI_STATUS;
+
+typedef enum {
+ SCC_TRACETOP_STP_READY = 0,
+ SCC_TRACETOP_STP_NOT_READY,
+} SCC_TRACETOP_STP_STATUS;
+
+typedef enum {
+ SCC_CAPTURE_NOT_RUNNING = 0,
+ SCC_CAPTURE_RUNNING
+} SCC_CAPTURE_STATUS;
+
+typedef enum {
+ MODEM_L1_PORT = 0,
+ MTAD_PORT,
+ C2K_PORT,
+ LTEL2_PORT,
+ PTRNGEN1_PORT,
+ HSPAL2_PORT,
+ SDF_PORT,
+ FLUSH_MSTR_PORT,
+ TOTAL_PORT_NUM
+} CSTF_PORT;
+
+typedef enum {
+ SCC_MCULOG = 0,
+ SCC_DSPLOG_MDL,
+ SCC_DSPLOG_MDP,
+ SCC_DSPLOG_MTOL,
+ SCC_LOG_PATH_NUM
+} SCC_LOG_PATH;
+
+typedef enum {
+ SCC_NO_PATH = 0x0,
+ SCC_STP_PATH = 0x1,
+ SCC_EMI_PATH = 0x2
+} SCC_SIB_PATH;
+
+typedef struct {
+ kal_uint32 Tracetop_IDFILTER_BIT127_96;
+ kal_uint32 Tracetop_IDFILTER_BIT95_64;
+ kal_uint32 Tracetop_IDFILTER_BIT63_32;
+ kal_uint32 Tracetop_IDFILTER_BIT31_0;
+} SCC_ATID_MASK;
+
+/* ATID dispatcher configuration */
+typedef struct {
+ SCC_SIB_PATH path_mask; /* path selection */
+ SCC_ATID_MASK to_emi_atids; /* ATIDs to EMI */
+ SCC_ATID_MASK to_sib_atids; /* ATIDs to SIB */
+} SCC_ATID_CFG;
+
+typedef struct _scc_decoded_data_t
+{
+ kal_uint8 ATID;
+ kal_uint8 data;
+} scc_decoded_data_t;
+
+/* 15/16B decode frame */
+typedef struct _scc_decoded_frame_data_t
+{
+ scc_decoded_data_t decoded_data[15];
+} scc_decoded_frame_data_t;
+
+/*******************************************************************************
+ * Define exported function prototype
+ ******************************************************************************/
+
+/*
+ * [FUNCTION]
+ * Initialize SCC required resources
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - init operation succeeded
+ * SCC_FAIL - init operation failed
+ */
+SCC_RESULT scc_init(void);
+
+/*
+ * [FUNCTION]
+ * Get SIB's Trace top status
+ *
+ * [PARAMETERS]
+ * *status:
+ * SCC_TRACE_TOP_STATUS enum as a return value to indicate link ready or not ready
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_status(SCC_TRACETOP_EMI_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Allocate bandwidth for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * MBps:
+ * Specified bandwidth in MBps
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - bandwidth allocation operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_alloc(const CSTF_PORT port, const kal_uint16 MBps);
+
+/*
+ * [FUNCTION]
+ * Get bandwidth allocation status for specified CSTF port
+ *
+ * [PARAMETERS]
+ * port:
+ * CSTF_PORT enum to specify CSTF port
+ *
+ * *MBps:
+ * As a return value to indicate allocated bandwidth in MBps
+ *
+ * *pct:
+ * As a return value to indicate allocated bandwidth percentage
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_bandwidth_status(const CSTF_PORT port, kal_uint16 *const MBps, kal_uint8 *const pct);
+
+/*
+ * [FUNCTION]
+ * Set PCC config and start PCC capture
+ *
+ * [PARAMETERS]
+ * *pstCaptureConfig:
+ * As an input to specify capture node and selected path for capture
+ *
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config&stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_config_and_start(SCC_ST_PCC_CAPTURE_CONFIG* pstCaptureConfig);
+
+/*
+ * [FUNCTION]
+ * Stop PCC capture
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - stop operation succeeded
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get PCC capture status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate PCC capture running or not running
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_status(SCC_CAPTURE_STATUS *status);
+
+
+/*
+ * [FUNCTION]
+ * Get PCC FIFO status
+ *
+ * [PARAMETERS]
+ * *pstFIFOStatus:
+ * As a return value to indicate PCC FIFO status
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_fifo_status(SCC_ST_PCC_FIFO_STATUS *pstFIFOStatus);
+
+/*
+ * [FUNCTION]
+ * Let EL1D to update CC mapping info to PCC driver
+ *
+ * [PARAMETERS]
+ * u8cc_mask:
+ * specify the CC's mask (LTE:max 5bit, NR: max 2bit)
+ * p_Info_arrary:
+ * specify CC goes which MIMO/L-path. MIMO: -1 means invalid. L-path: -1 means path is not enable
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_pcc_rxdfe_cc_info_lte(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+SCC_RESULT scc_pcc_rxdfe_cc_info_nr(kal_uint8 u8cc_mask, SCC_ST_PCC_RF_RXDFE_PATH_INDEX* p_Info_arrary);
+kal_bool scc_pcc_atcmd(kal_uint32 len, kal_uint8 *data);
+kal_bool scc_tracetop_atcmd(kal_uint32 len, kal_uint8 *data);
+
+SCC_RESULT scc_ppc_start(void);
+SCC_RESULT scc_ppc_stop(void);
+SCC_RESULT scc_ppc_config(void);
+SCC_RESULT scc_ppc_status(void);
+
+/*
+ * [FUNCTION]
+ * Set SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * SCC_SDF_WIDTH_SEL enum to specify selected SDF signal width
+ *
+ * config.en_bitmap:
+ * bitmap to specify enabled signals for SDF monitoringa
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * SCC_SDF_MODE_SEL enum to specify selected traffic mode
+ *
+ * config.mux0:
+ * SCC_SDF_MUX_SEL enum to specify selected mux0
+ *
+ * config.mux1:
+ * SCC_SDF_MUX_SEL enum to specify selected mux1
+ *
+ * config.mux2:
+ * SCC_SDF_MUX_SEL enum to specify selected mux2
+ *
+ * config.mux3:
+ * SCC_SDF_MUX_SEL enum to specify selected mux3
+ *
+ * config.clock:
+ * SCC_SDF_CLOCK_SEL enum to specify selected clock frequency
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ * SCC_SDF_STARTED - SDF is already in running state, and therefore could not be configured
+ */
+SCC_RESULT scc_sdf_set_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Get SDF status
+ *
+ * [PARAMETERS]
+ * *status:
+ * As a return value to indicate SDF's status
+ * - Whether running or not
+ * - Ever occurred overflow or not
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_status(SCC_SDF_STATUS *const status);
+
+/*
+ * [FUNCTION]
+ * Set SDF SW GPIO
+ *
+ * [PARAMETERS]
+ * gpio_val:
+ * SW Program GPIO for debug flag
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - status has been got successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_set_sw_gpio(kal_uint32 gpio_val);
+
+/*
+ * [FUNCTION]
+ * Start SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been started successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_start(void);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_sdf_stop(void);
+
+/*
+ * [FUNCTION]
+ * Get SDF all config
+ *
+ * [PARAMETERS]
+ * config.width:
+ * Get selected SDF signal width setting config
+ *
+ * config.en_bitmap:
+ * Get bitmap config for SDF monitoring
+ * (bit as 1 - enable monitoring, bit as 0 - disable monitoring)
+ *
+ * config.mode:
+ * Get traffic mode config
+ *
+ * config.mux0:
+ * Get mux0 config
+ *
+ * config.mux1:
+ * Get mux1 config
+ *
+ * config.mux2:
+ * Get mux2 config
+ *
+ * config.mux3:
+ * Get mux3 config
+ *
+ * config.clock:
+ * Get clock frequency config
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - config has been set successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+*/
+SCC_RESULT scc_sdf_get_config(SCC_SDF_CONFIG_PARAM *config);
+
+/*
+ * [FUNCTION]
+ * Stop SDF
+ *
+ * [PARAMETERS]
+ * N/A:
+ *
+ * [RETURN]
+ * SCC_RESULT enum:
+ * SCC_OK - SDF has been stopped successfully
+ * SCC_FAIL - API operation failed due to SCC channel issue, and therefore need users to re-call API again
+ * SCC_DISABLED - SCC corresponding feature option not enabled
+ * SCC_RES_LOCKED - other thread is calling SCC API and using SCC resource
+ */
+SCC_RESULT scc_tracetop_stop(void);
+
+/*
+ * [FUNCTION]
+ * Return if selected log path output is set to SIB or not
+ *
+ * [PARAMETERS]
+ * path:
+ * SCC_LOG_PATH enum to specify selected log path
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - log path is to SIB
+ * KAL_FALSE - log path is to EMI
+ */
+kal_bool scc_is_log_path_to_sib(SCC_LOG_PATH path);
+
+/*
+ * [FUNCTION]
+ * Let EL1D get PCC current status
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * kal_bool:
+ * KAL_TRUE - The PCC current status is running
+ * KAL_FALSE - The PCC current status is not running
+ * or not support SCC_SIB_SUPPORT option
+ */
+kal_bool scc_force_mu_on_ind(void);
+
+/*
+ * [FUNCTION]
+ * SCC exception flow
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_exception_flow(void);
+
+/*
+ * [FUNCTION]
+ * SCC capture dump region info
+ *
+ * [PARAMETERS]
+ * *start_address:
+ * Get the capture dump region address
+ * *size:
+ * Get the cpature dump region size
+ *
+ * [RETURN]
+ * N/A
+ *
+ */
+void scc_dump_region_info(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info1(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info2(kal_uint32 *start_address, kal_uint32 *size);
+void scc_dump_region_info3(kal_uint32 *start_address, kal_uint32 *size);
+
+/*
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL or SCC_RES_LOCKED
+ */
+SCC_RESULT scc_config_atid_dispatcher(const SCC_ATID_CFG *const atid_cfg);
+
+/**
+ * [FUNCTION]
+ * Configure the tracetop ATID dispatcher w/o re-entry lock protection
+ *
+ * [PARAMETERS]
+ * atid_cfg: ATID configurations
+ *
+ * [RETURN]
+ * SCC_OK on success, otherwise SCC_FAIL
+ */
+SCC_RESULT scc_config_atid_dispatcher_nolock(const SCC_ATID_CFG *const atid_cfg);
+
+/*
+ * [FUNCTION]
+ * Decode 15/16B frame
+ *
+ * [PARAMETERS]
+ * emi: ATID configurations
+ * decoded_frame: decoded data
+ * current_ATID: current ATID
+ *
+ * [RETURN]
+ * Data length
+ */
+kal_uint32 scc_15B16B_frame_decode(kal_uint32 addr, scc_decoded_frame_data_t* decoded_frame, kal_uint8* current_ATID);
+
+/*
+ * [FUNCTION]
+ * Lock trace_top required DVFS vModem after
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_init_dvfs_ctrl(void);
+
+/*
+ * [FUNCTION]
+ * For setting non-WARP mode in Tractop DMA Control Module
+ *
+ * [PARAMETERS]
+ * N/A
+ *
+ * [RETURN]
+ * void
+ */
+void scc_set_emi_mem_full_stop(void);
+
+#endif /* !__SCC_H__ */
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/sdf/sdf.h b/mcu/interface/driver/sib_drv/scc/md97/sdf/sdf.h
new file mode 100644
index 0000000..9dd1ed8
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/sdf/sdf.h
@@ -0,0 +1,110 @@
+/******************************************************************************
+* 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) 2012
+*
+* 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 11 10 2020 hungjui.chen
+ * [MOLY00592435] [Montrose]call for check in
+ *
+ * [SibLA]Montrose call for check in
+ *
+ * 07 08 2020 hungjui.chen
+ * [MOLY00543803] [SDF]Add PetrusP definition
+ *
+ * [PetrusP]Add definition
+ *
+ * 07 07 2020 hungjui.chen
+ * [MOLY00543189] [SDF]Palmer definition patch
+ *
+ * [SDF]Palmer patch
+ *
+ * 07 06 2020 hungjui.chen
+ * [MOLY00542933] [SDF]Add Palmer definition
+ *
+ * [SDF]Add Palmer definition
+ *
+ * 01 15 2020 hungjui.chen
+ * [MOLY00474839] [SDF]Add Mouton definition
+ *
+ * [SDF]Add Mouton definition
+ *
+ * 10 14 2019 hungjui.chen
+ * [MOLY00441744] [SibLA]Add Margaux .h file definition
+ *
+ * [SDF]Add Margaux definition
+ *
+ * 07 24 2019 hungjui.chen
+ * [MOLY00424060] [SDF]Definition for MERCURY and __MD97P__
+ *
+ * [SDF]Add definition for MERCURY and __MD97P__
+ *
+ * 07 17 2019 kerwin.chung
+ * [MOLY00422524] [SIB_DRV][SCC] initial check in of Petrus
+ *
+ * 03 12 2018 kerwin.chung
+ * [MOLY00312787] [MT6297][SIB_DRV][SCC] Add SCC interface file for 6297 DEV
+ * .
+ *
+ * 10 19 2017 sen.chang
+ * [MOLY00284121][93/95 re-arch][SIB_DRV] Update SCC Module for SIB official Release - SCC 93/95 re-arch
+ *
+ *
+ *****************************************************************************/
+
+/* MTnnnn is specified by PLATFORM in project's make file */
+#if defined(MT6885) || defined(MERCURY) || defined(MT6873) || defined(MT6853) || defined(MT6833) || defined(CHIP10992) || defined(MT6893) || defined(MT6877)
+ #include "sdf_mt6885.h"
+#else //#if defined(MT6885)
+ #error "no PLATFORM match!"
+#endif //#if defined(MT6885)
+
diff --git a/mcu/interface/driver/sib_drv/scc/md97/sdf/sdf_mt6885.h b/mcu/interface/driver/sib_drv/scc/md97/sdf/sdf_mt6885.h
new file mode 100644
index 0000000..248e75f
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/md97/sdf/sdf_mt6885.h
@@ -0,0 +1,285 @@
+/*******************************************************************************
+ * 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) 2012
+ *
+ * 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ============================================================================
+ * $Log$
+ *
+ * 07 24 2019 hungjui.chen
+ * [MOLY00424060] [SDF]Definition for MERCURY and __MD97P__
+ *
+ * [SDF]Add definition for MERCURY and __MD97P__
+ *
+ * 12 24 2018 kerwin.chung
+ * [MOLY00374098] [SIB_DRV][SCC] support EMI capture and mcu core sleep control
+ * Update SDF clk rate for Apollo
+ *
+ * 11 29 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]
+ * Add the function for check corresponding PCC's formatter based on RXDFE cc mapping info
+ *
+ * 11 07 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC] add CC info API
+ *
+ * 11 06 2018 baoni.lee
+ * [MOLY00353369] [SIB_DRV][PCC]support INTP and CS
+ *
+ * .
+ *
+ * 09 20 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 09 19 2018 kerwin.chung
+ * [MOLY00353358] [SIB_DRV][SCC] check in dump region register
+ * .
+ *
+ * 07 16 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * Check in based on Baoni's Shelved#5987816
+ *
+ * 07 06 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * refinement
+ *
+ * 07 05 2018 kerwin.chung
+ * [MOLY00335576] [SIB_DRV][SCC] initial check in of scc for Gen97
+ * check in build pass code for both SCC_SIB_SUPPORT on/off
+ *
+ * 03 30 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]Update CC information mapping
+ *
+ * 03 26 2018 baoni.lee
+ * [MOLY00315950] [SIB_DRV][PCC]
+ * update for drvtest
+ *
+ * 01 24 2018 kerwin.chung
+ * [MOLY00304018] [SIB_DRV][SCC] initial check in for ET support
+ * inital check in for ET support
+ *
+ * 08 29 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]Update for 95 PCC
+ *
+ * 08 29 2017 sen.chang
+ * [MOLY00197455][MT6295][SIB_DRV] Update SCC Module for SIB official Release - Refine and Porting for EMI and STP path
+ *
+ * 08 09 2017 baoni.lee
+ * [MOLY00269479] [MT6295M][PCC]
+ *
+ * [MT6295M]Update PCC driver
+ *
+ * 03 30 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove SDF_CLOCK setting for FPGA
+ *
+ * 02 15 2017 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Update SCC for scc_sdf_to_sib usage
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix the typo
+ *
+ * 12 22 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Export the SCC capture dump region info
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Remove API Call restriction, add scc_sdf_start/stop_internal(), and support re-capture when IP start
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix naming from STP to Trace_top
+ *
+ * 11 30 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - SCC support SIBLA for target trigger mode
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Fix for init 64K dram tracetop, wrapper tracetop_stop feature, and disable funnel control for PCC
+ *
+ * 10 31 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Enable and integrate the PCC feature
+ *
+ * 09 01 2016 sen.chang
+ * [MOLY00197455][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Support SIBLA on 93 FPGA UMOLYA
+ *
+ * 06 27 2016 sen.chang
+ * [MOLY00167811][MT6763][SIB_DRV] Update SCC Module for SIB official Release - Sync from //UMOLY/TRUNK/UMOLY/ to //UMOLYA/TRUNK/UMOLYA/ with CL2504057
+ *
+ * 05 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the scc_exception_flow function prototype to void function
+ *
+ * 05 24 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Fix the function proto for void arguments
+ *
+ * 05 18 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support scc_force_mu_on_ind() for EL1D
+ *
+ * 05 10 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add misuse prevention for SCC external API. (When STP Link and build option ready, the API can be used)
+ *
+ * 04 25 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Add scc_sdf_get_config and scc_sdf_set_config
+ *
+ * 04 14 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Wrap PCC API interface under SCC, and remove pcc/inc in makefile by following the MSBB rule
+ *
+ * 04 12 2016 zeke.chang
+ * [MOLY00172338] [UMOLY][Elbrus][PCC]
+ * Update PCC driver. Add new API in SCC for EL1D.
+ *
+ * 03 31 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support SCC_SDF_32BIT_WIDTH
+ *
+ * 03 30 2016 sen.chang
+ * [MOLY00167811][ELBRUS][SIB_DRV] Update SCC Module for SIB official Release - Support for ELBRUS SCC driver
+ *
+ * 10 30 2015 gh.huang
+ * [MOLY00126218] [TK6291][SIB_DRV] Update SCC/SDF Module for SIB Official Release - Remove Inhibited PCORE/L1CORE Options
+ *
+ * 04 22 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Change API/MSG names for PCC/PPC
+ *
+ * 04 21 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk - Add PCC/BWL APIs and Messages
+ *
+ * 03 10 2015 gh.huang
+ * [MOLY00098317] [TK6291][SIB_DRV] Add SDF Module and Migrate SCC to UMOLY Trunk
+ *
+ * 02 03 2015 gh.huang
+ * [MOLY00093777] [TK6291][SIB_DRV] Add SCC Module Related Sources - Add Resource Lock and Enanble Option
+ *
+ *
+ ****************************************************************************/
+
+#ifndef __SDF_MT6885_H__
+#define __SDF_MT6885_H__
+
+/*******************************************************************************
+ * Include header files
+ ******************************************************************************/
+#include "kal_general_types.h"
+#include "reg_base.h"
+
+/*******************************************************************************
+ * Define data structure
+ ******************************************************************************/
+typedef enum {
+ SCC_SDF_OPERATION_MODE_STANDALONE /* */= 0,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_CONFIG /* */= SCC_SDF_OPERATION_MODE_STANDALONE,
+
+ SCC_SDF_OPERATION_MODE_AUTO /* */= 1,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_CONFIG /* */= SCC_SDF_OPERATION_MODE_AUTO,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_START /* */= SCC_SDF_OPERATION_MODE_AUTO,
+
+ SCC_SDF_OPERATION_MODE_SEMI_AUTO /* */= 2,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_START /* */= SCC_SDF_OPERATION_MODE_SEMI_AUTO,
+ SCC_SDF_OPERATION_MODE_TARGET_CAN_STOP /* */= SCC_SDF_OPERATION_MODE_SEMI_AUTO,
+
+ SCC_SDF_OPERATION_MODE_MANUAL /* */= 3,
+ SCC_SDF_OPERATION_MODE_SIB_CAN_STOP /* */= SCC_SDF_OPERATION_MODE_MANUAL,
+} SCC_SDF_OPERATION_MODE;
+
+typedef enum {
+ SCC_SDF_DISABLE_EN = 0,
+ SCC_SDF_ENABLE_EN = 1,
+} SCC_SDF_EN_SEL;
+
+typedef enum {
+ SCC_SDF_CONT_MODE = 0,
+ SCC_SDF_DIFF_MODE = 1,
+} SCC_SDF_MODE_SEL;
+
+typedef enum {
+ SCC_SDF_8BIT_WIDTH = 0,
+ SCC_SDF_16BIT_WIDTH = 1,
+ SCC_SDF_32BIT_WIDTH = 2
+} SCC_SDF_WIDTH_SEL;
+
+typedef enum {
+ SCC_SDF_624MHZ_CLOCK = 0,
+ SCC_SDF_312MHZ_CLOCK = 1,
+ SCC_SDF_156MHZ_CLOCK = 2,
+ SCC_SDF_78MHZ_CLOCK = 3
+} SCC_SDF_CLOCK_SEL;
+
+typedef struct {
+ kal_bool in_progress;
+ kal_bool overflowed;
+} SCC_SDF_STATUS;
+
+typedef enum {
+ SCC_SDF_DBGMON_BYTE0_MUX = 0,
+ SCC_SDF_DBGMON_BYTE1_MUX = 1,
+ SCC_SDF_DBGMON_BYTE2_MUX = 2,
+ SCC_SDF_DBGMON_BYTE3_MUX = 3,
+ SCC_SDF_SWGPIO_BYTE0_MUX = 4,
+ SCC_SDF_SWGPIO_BYTE1_MUX = 5,
+ SCC_SDF_SWGPIO_BYTE2_MUX = 6,
+ SCC_SDF_SWGPIO_BYTE3_MUX = 7
+} SCC_SDF_MUX_SEL;
+
+typedef enum {
+ SCC_SDF_ASSERT_STOP_NOTHING = 0,
+ SCC_SDF_ASSERT_STOP_ASSERT = 1,
+} SCC_SDF_ASSERT_STOP_SEL;
+
+typedef struct {
+ SCC_SDF_OPERATION_MODE operation;
+ SCC_SDF_EN_SEL en; //for sdf_get_config only
+ SCC_SDF_MODE_SEL mode;
+ SCC_SDF_WIDTH_SEL width;
+ kal_uint32 enBitmap;
+ SCC_SDF_CLOCK_SEL clock;
+ SCC_SDF_MUX_SEL mux0;
+ SCC_SDF_MUX_SEL mux1;
+ SCC_SDF_MUX_SEL mux2;
+ SCC_SDF_MUX_SEL mux3;
+ kal_uint32 swGpio;
+ SCC_SDF_ASSERT_STOP_SEL assert;
+} SCC_SDF_CONFIG_PARAM;
+
+#endif //#ifndef __SDF_MT6885_H__
diff --git a/mcu/interface/driver/sib_drv/scc/scc.h b/mcu/interface/driver/sib_drv/scc/scc.h
new file mode 100644
index 0000000..3507a0f
--- /dev/null
+++ b/mcu/interface/driver/sib_drv/scc/scc.h
@@ -0,0 +1,87 @@
+/******************************************************************************
+* 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) 2012
+*
+* 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:
+ * ---------
+ * scc.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ * SCC External Header File
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 07 24 2019 kerwin.chung
+ * [MOLY00424065] [SIB_DRV][SCC] initial check in for MERCURY
+ * mercury inital version
+ *
+ * 07 19 2019 kerwin.chung
+ * [MOLY00423651] [SIB_DRV][SCC/SDF] re-arc for better de-coupling
+ * re-arc SCC w/ SDF for Petrus(MT6885)
+ *
+ * 07 17 2019 kerwin.chung
+ * [MOLY00422524] [SIB_DRV][SCC] initial check in of Petrus
+ *
+ * 03 12 2018 kerwin.chung
+ * [MOLY00312787] [MT6297][SIB_DRV][SCC] Add SCC interface file for 6297 DEV
+ * .
+ *
+ * 10 19 2017 sen.chang
+ * [MOLY00284121][93/95 re-arch][SIB_DRV] Update SCC Module for SIB official Release - SCC 93/95 re-arch
+ *
+ *
+ *****************************************************************************/
+
+/* __MDnn__ is specified by MTK_MODEM_ARCH in project's make file */
+#if defined(__MD93__)
+#include "md93/scc_93.h"
+#elif defined(__MD95__)
+#include "md95/scc_95.h"
+#elif (defined(__MD97__) || defined(__MD97P__))
+#include "md97/scc_97.h"
+#else
+#error "no MTK_MODEM_ARCH match!"
+#endif
+