[Feature][ZXW-130]merge P50U02 version

Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I4f29ec5bb7c59385f23738d2b7ca84e67c100f69
diff --git a/cp/ps/driver/inc/misc/NvParam_tsc.h b/cp/ps/driver/inc/misc/NvParam_tsc.h
old mode 100644
new mode 100755
index 93a0197..f3a40d6
--- a/cp/ps/driver/inc/misc/NvParam_tsc.h
+++ b/cp/ps/driver/inc/misc/NvParam_tsc.h
@@ -65,7 +65,8 @@
 	UINT8  Dfs_En;		 /*ps ²àDFS¿ØÖÆ¿ª¹Ø£¬0xB2±íʾps ²àDFS¿ØÖÆ´ò¿ª,ÆäËûÖµ²»¿ª*/

 	UINT8  TansmitPower_En;	/* modem²à½µ·¢É书ÂÊ¿ØÖÆ¿ª¹Ø, 0xB2±íʾmodem²à½µ·¢É书ÂÊ¿ØÖÆ´ò¿ª,ÆäËûÖµ²»¿ª*/

 	UINT8  User_En;   /*Óû§²ßÂÔ¿ØÖÆ¿ª¹Ø0xB2±íʾ¿ª,ÆäËûÖµ²»¿ª*/

-	UINT8  reserved2[3];

+	UINT8  AdcRFd_En;   /*VEHICLE_DC ÊÇ·ñ²ÉÓÃAdcRFd»ñÈ¡DBBζÈ×öοأ¬ 0xB2±íʾ²ÉÓÃ,ÆäËûÖµ²»ÓÃ*/

+	UINT8  reserved2[2];

 }T_SYS_NV_TSC_CONFIG;

 

 /******************************************************

diff --git a/cp/ps/driver/inc/misc/drvs_voiceprocess.h b/cp/ps/driver/inc/misc/drvs_voiceprocess.h
index db2104e..a5ab9f4 100755
--- a/cp/ps/driver/inc/misc/drvs_voiceprocess.h
+++ b/cp/ps/driver/inc/misc/drvs_voiceprocess.h
@@ -247,6 +247,7 @@
     SINT32 muteCount;//22 mute_count

     BOOL vpLoopBkRunning;//23 

 	BOOL rxMuteEn; //24

+	BOOL firstRegZCATFlag; //25

 } T_zDrvVoice_GbVar; //T_zDrvVoice_GbVar

 

 typedef struct

diff --git a/cp/ps/driver/src/chipsets/src/audio_base/audio_config/audioRef_cfg.c b/cp/ps/driver/src/chipsets/src/audio_base/audio_config/audioRef_cfg.c
index 480c4cf..1c21e8b 100755
--- a/cp/ps/driver/src/chipsets/src/audio_base/audio_config/audioRef_cfg.c
+++ b/cp/ps/driver/src/chipsets/src/audio_base/audio_config/audioRef_cfg.c
@@ -332,6 +332,8 @@
 //extern T_ZDrvI2S_Cfg s_vpFmI2sCfg  ;//TEST FOR i2s

 extern T_ZDrvTdm_Cfg s_vpTdmNbCfg  ;//TEST FOR tdm

 extern T_ZDrvTdm_Cfg s_vpTdmWbCfg ;//TEST FOR tdm

+extern T_ZDrvTdm_Cfg s_vpTdmWbCfg_codec ;//TEST FOR codec tdm

+

 

 static T_ZDrvCodec_Handle gCodecHandle = 0;//xiu

 

@@ -588,8 +590,7 @@
 	aud_dsp_dai_configuration_type *p_dspPcmCfg	= NULL;

 	aud_dsp_dai_configuration_type *p_dspI2sCfg = NULL;

 

-

-	zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, " zDrvVoiceConfig_Init audio nv addr=0x%x!\n", OS_FLASH_VOICE_DRV_RW_NONFAC_BASE_ADDR);

+    zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, " zDrvVoiceConfig_Init audio nv addr=0x%x!\n", OS_FLASH_VOICE_DRV_RW_NONFAC_BASE_ADDR);

 

 	//ret = zDrvNand_Read(OS_FLASH_VOICE_DRV_RW_NONFAC_BASE_ADDR,  sizeof(audionvflag), ((UINT8 *)(&audionvflag)));

 	ret = zOss_NvItemRead(OS_FLASH_VOICE_DRV_RW_NONFAC_BASE_ADDR, ((UINT8 *)(&audionvflag)),  sizeof(audionvflag));

@@ -660,7 +661,8 @@
 		}

 		else

 		{

-			zDrvVp_SetExtAudioCfg(&s_vpExtI2sNbCfg,&s_vpExtI2sWbCfg,&s_vpTdmNbCfg,&s_vpTdmWbCfg);

+			zDrvVp_SetExtAudioCfg(&s_vpExtI2sNbCfg,&s_vpExtI2sWbCfg,&s_vpTdmNbCfg,&s_vpTdmWbCfg_codec);

+			//zDrvVp_SetExtAudioCfg(&s_vpExtI2sNbCfg,&s_vpExtI2sWbCfg,&s_vpTdmNbCfg,&s_vpTdmWbCfg);

 		}

 		/*klocwork 3 INVARIANT_CONDITION.UNREACH  delete if*/

 		/*if (ret != DRV_SUCCESS)

@@ -707,13 +709,35 @@
 				return DRV_ERROR;

 			}

 			#endif

-			zCatAgt_Audio_Reg(10,VP_INOUT_BAK_BUFFER_SIZE,(UINT32)vpInOutBuffer.p_voiceRxInBuffer);

-			zCatAgt_Audio_Reg(12,VP_INOUT_BAK_BUFFER_SIZE,(UINT32)vpInOutBuffer.p_voiceTxInBuffer);

-			zCatAgt_Audio_Reg(13,VP_INOUT_BAK_BUFFER_SIZE,(UINT32)vpInOutBuffer.p_voiceTxOutPutBuffer);

+

+#if 0

+            ret = zCatAgt_Audio_Reg(10,VP_INOUT_BAK_BUFFER_SIZE,(UINT32)vpInOutBuffer.p_voiceRxInBuffer);

+            if(ret != DRV_SUCCESS){

+                zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "zDrvVoiceConfig_Init RXIN register zCatAgt_Audio_Reg err\n");

+            }

+            

+			ret = zCatAgt_Audio_Reg(12,VP_INOUT_BAK_BUFFER_SIZE,(UINT32)vpInOutBuffer.p_voiceTxInBuffer);

+            if(ret != DRV_SUCCESS){

+                zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "zDrvVoiceConfig_Init TXIN register zCatAgt_Audio_Reg err\n");

+            }

+            

+			ret = zCatAgt_Audio_Reg(13,VP_INOUT_BAK_BUFFER_SIZE,(UINT32)vpInOutBuffer.p_voiceTxOutPutBuffer);

+            if(ret != DRV_SUCCESS){

+                zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "zDrvVoiceConfig_Init TXOUT register zCatAgt_Audio_Reg err\n");

+            }

+            

 #ifdef _USE_VP_OUTPUT_RXOUT_DATA

-			zCatAgt_Audio_Reg(11, VP_INOUT_BAK_BUFFER_SIZE, (UINT32)vpInOutBuffer.p_voiceRxOutPutBuffer);

+			ret = zCatAgt_Audio_Reg(11, VP_INOUT_BAK_BUFFER_SIZE, (UINT32)vpInOutBuffer.p_voiceRxOutPutBuffer);

+            if(ret != DRV_SUCCESS){

+                zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "zDrvVoiceConfig_Init RXOUT register zCatAgt_Audio_Reg err\n");

+            }

+

 #else

-			zCatAgt_Audio_Reg(11,VP_INOUT_NOBAK_BUFSIZE,(UINT32)vpInOutBuffer.p_voiceRxOutPutBuffer);

+			ret = zCatAgt_Audio_Reg(11,VP_INOUT_NOBAK_BUFSIZE,(UINT32)vpInOutBuffer.p_voiceRxOutPutBuffer);

+            if(ret != DRV_SUCCESS){

+                zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "zDrvVoiceConfig_Init RXOUT register zCatAgt_Audio_Reg err\n");

+            }

+#endif

 #endif

 		}

 		else

diff --git a/cp/ps/driver/src/chipsets/src/audio_base/audio_lib/amr/lib/armv7-a/GCC/amr.a b/cp/ps/driver/src/chipsets/src/audio_base/audio_lib/amr/lib/armv7-a/GCC/amr.a
index 3f58298..e1f4f7d 100755
--- a/cp/ps/driver/src/chipsets/src/audio_base/audio_lib/amr/lib/armv7-a/GCC/amr.a
+++ b/cp/ps/driver/src/chipsets/src/audio_base/audio_lib/amr/lib/armv7-a/GCC/amr.a
Binary files differ
diff --git a/cp/ps/driver/src/chipsets/src/audio_base/voiceprocess/hal_voiceprocess.c b/cp/ps/driver/src/chipsets/src/audio_base/voiceprocess/hal_voiceprocess.c
index 95f6404..0acd415 100755
--- a/cp/ps/driver/src/chipsets/src/audio_base/voiceprocess/hal_voiceprocess.c
+++ b/cp/ps/driver/src/chipsets/src/audio_base/voiceprocess/hal_voiceprocess.c
@@ -54,6 +54,9 @@
 #define VP_FRAME_BUFFER_SIZE 320 //20ms 800KHZ

 #define VP_I2S_BUFFER_SIZE 320

 #define VOICE_SYNC_TIMEOUT_TIME 100

+

+#define VP_INOUT_BAK_BUFFER_SIZE 0x30000  // 0x60000

+#define VP_INOUT_NOBAK_BUFSIZE  640

 /****************************************************************************

 * 	                                           Local Types

 ****************************************************************************/

@@ -104,8 +107,9 @@
     0, //sample_rate 20 

 	0, //useDtmfLoop; 21

 	0, //muteCount;//mute_count 22	

-    FALSE,				//23 vpLoopBkRunning

-	FALSE,              //24 rxMuteEn

+    FALSE, //23 vpLoopBkRunning

+	FALSE, //24 rxMuteEn

+	FALSE, //25 firstRegZCATFlag

 };

 

 static T_zDrvVp_State s_vpState =

@@ -152,6 +156,8 @@
 #endif

 */

 

+extern T_ZDrv_VpInOutBuffer vpInOutBuffer;

+

 /****************************************************************************

 * 	                                          Global Function Prototypes

 ****************************************************************************/

@@ -777,9 +783,43 @@
 

 	g_voiceVar.voiceMode = voiceMode;

 	g_voiceVar.muteEn = FALSE;

+	g_voiceVar.rxMuteEn = FALSE;

 	g_voiceVar.vpI2sStatus = VP_I2S_OPEN;

 	g_voiceVar.vProcIsNormal = FALSE;

     g_voiceVar.dtmfDirSel = DTMF_IDLE;

+

+    if (FALSE == g_voiceVar.firstRegZCATFlag) {

+        ret = zCatAgt_Audio_Reg(10,VP_INOUT_BAK_BUFFER_SIZE,(UINT32)vpInOutBuffer.p_voiceRxInBuffer);

+        if(ret != DRV_SUCCESS){

+            zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "vp_Open RXIN register zCatAgt_Audio_Reg err\n");

+        }

+        

+        ret = zCatAgt_Audio_Reg(12,VP_INOUT_BAK_BUFFER_SIZE,(UINT32)vpInOutBuffer.p_voiceTxInBuffer);

+        if(ret != DRV_SUCCESS){

+            zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "vp_Open TXIN register zCatAgt_Audio_Reg err\n");

+        }

+            

+		ret = zCatAgt_Audio_Reg(13,VP_INOUT_BAK_BUFFER_SIZE,(UINT32)vpInOutBuffer.p_voiceTxOutPutBuffer);

+        if(ret != DRV_SUCCESS){

+            zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "vp_Open TXOUT register zCatAgt_Audio_Reg err\n");

+        }

+

+#ifdef _USE_VP_OUTPUT_RXOUT_DATA

+		ret = zCatAgt_Audio_Reg(11, VP_INOUT_BAK_BUFFER_SIZE, (UINT32)vpInOutBuffer.p_voiceRxOutPutBuffer);

+        if(ret != DRV_SUCCESS){

+            zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "vp_Open RXOUT register zCatAgt_Audio_Reg err\n");

+        }

+

+#else

+		ret = zCatAgt_Audio_Reg(11,VP_INOUT_NOBAK_BUFSIZE,(UINT32)vpInOutBuffer.p_voiceRxOutPutBuffer);

+        if(ret != DRV_SUCCESS){

+            zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "vp_Open RXOUT register zCatAgt_Audio_Reg err\n");

+        }

+#endif

+

+        g_voiceVar.firstRegZCATFlag = TRUE;   

+    }

+   

 	zDrvRamlog_PRINTF(RAMLOG_MOD_AUDIO, "vp_Open  end!\n");

 #if 0

     //dtmf检测-测试用

diff --git a/cp/ps/driver/src/chipsets/src/uicc/infineonIp/uicc_ref.c b/cp/ps/driver/src/chipsets/src/uicc/infineonIp/uicc_ref.c
old mode 100644
new mode 100755
index bdaf729..bba2e94
--- a/cp/ps/driver/src/chipsets/src/uicc/infineonIp/uicc_ref.c
+++ b/cp/ps/driver/src/chipsets/src/uicc/infineonIp/uicc_ref.c
@@ -33,6 +33,7 @@
 extern void uicc_insert_isr(void);

 extern void uicc_remove_isr(void);

 extern SINT32 pcu_ClearInt(UINT32 intLine);

+extern SINT32 pcu_clr_irq_pending(UINT32 gic);

 

 extern  hotplugCallback_func uicc_hotplugCallback;

 typedef VOID* T_ZDrvGpio_Pin;

@@ -146,7 +147,7 @@
 				

 				uiccRecovFlag = 0;

 

-				pcu_ClearInt(UICC_EXT_INT);

+				pcu_clr_irq_pending(UICC_EXT_INT);

 				zDrvInt_UnmaskIrq(UICC_EXT_INT);

 

 				continue;

@@ -184,7 +185,7 @@
 				

 				uiccRecovFlag = 0;

 

-				pcu_ClearInt(UICC_EXT_INT);

+				pcu_clr_irq_pending(UICC_EXT_INT);

 				zDrvInt_UnmaskIrq(UICC_EXT_INT);

 

 				continue;

@@ -224,7 +225,7 @@
 		}

 		uiccRecovFlag = 0;

 		

-        pcu_ClearInt(UICC_EXT_INT);

+        pcu_clr_irq_pending(UICC_EXT_INT);

 		zDrvInt_UnmaskIrq(UICC_EXT_INT);

 		}

 

@@ -341,12 +342,14 @@
 	zDrvInt_DelayUnmaskAdd(UICC_EXT_INT);

 //	zDrvGpio_SetFunc(s_uicc_insert_detect, UICC_GPIO_EXT_INT);

 	zx29_gpio_config(UICC_GPIO,UICC_GPIO_EXT_INT);

+	pcu_clr_irq_pending(UICC_EXT_INT);

 

 	if (temp == SIM_OUT){

        //µÍµçƽÎÞ¿¨µÈ´ý¿¨²åÈë   

 	 //zDrvPcu_SetIntLevel(EX3_INT, INT_POSEDGE);

      s_simHisr = sim_HisrCreate();

      if(s_simHisr != NULL){

+	 	zDrvInt_SetLineLevel(UICC_EXT_INT, SIM_IN_LEVEL);

 		ret = zDrvInt_InstallIsr(UICC_EXT_INT, (void *)UICC_usim_in_or_out_lisr, "Sim_inout",SIM_IN_LEVEL); 

 		if (ret < 0)

 		{

@@ -366,6 +369,7 @@
 		//zDrvPcu_SetIntLevel(EX3_INT,INT_LOWLEVEL);

 		s_simHisr = sim_HisrCreate();

 		if(s_simHisr != NULL){

+			zDrvInt_SetLineLevel(UICC_EXT_INT, SIM_OUT_LEVEL);

 			ret = zDrvInt_InstallIsr(UICC_EXT_INT, (void *)UICC_usim_in_or_out_lisr, "Sim_inout",SIM_OUT_LEVEL);

 			if (ret < 0)

 			{