changeset 568:ae24e49c41a9

L1: l1_sync.c compiles for XIP
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 10 Aug 2014 17:52:59 +0000
parents 528fa901ae79
children 9df89f93d311
files gsm-fw/L1/cfile/Makefile gsm-fw/L1/cfile/l1_sync.c
diffstat 2 files changed, 76 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/L1/cfile/Makefile	Fri Aug 08 07:35:35 2014 +0000
+++ b/gsm-fw/L1/cfile/Makefile	Sun Aug 10 17:52:59 2014 +0000
@@ -8,7 +8,7 @@
 
 IOBJS=	l1_api_hisr.o l1_cmplx_intram.o l1_ctl.o l1_drive.o l1_func.o \
 	l1_mfmgr.o
-XOBJS=	l1_afunc.o l1_async.o l1_cmplx.o l1_init.o l1_pwmgr.o
+XOBJS=	l1_afunc.o l1_async.o l1_cmplx.o l1_init.o l1_pwmgr.o l1_sync.o
 
 all:	${IOBJS} ${XOBJS}
 
--- a/gsm-fw/L1/cfile/l1_sync.c	Fri Aug 08 07:35:35 2014 +0000
+++ b/gsm-fw/L1/cfile/l1_sync.c	Sun Aug 10 17:52:59 2014 +0000
@@ -8,8 +8,9 @@
  ************* Revision Controle System Header *************/
 
 //#pragma DUPLICATE_FOR_INTERNAL_RAM_START
+  #include "config.h"
+  #include "l1_confg.h"
   #include "l1_macro.h"
-  #include "l1_confg.h"
 //#pragma DUPLICATE_FOR_INTERNAL_RAM_END
 
 #if !((MOVE_IN_INTERNAL_RAM == 1) && (GSM_IDLE_RAM !=0))  // MOVE TO INTERNAL MEM IN CASE GSM_IDLE_RAM enabled
@@ -129,7 +130,7 @@
   #endif
 
   #include "l1_defty.h"
-  #include "cust_os.h"
+  #include "../../gpf/inc/cust_os.h"
   #include "l1_msgty.h"
   #include "l1_varex.h"
   #include "l1_proto.h"
@@ -142,10 +143,10 @@
     #include "hw_debug.h"
   #endif // L2_L3 SIMUL
 
-  #include "ulpd.h"
-  #include "mem.h"
-  #include "inth.h"
-  #include "iq.h"
+  #include "../../bsp/ulpd.h"
+  #include "../../bsp/mem.h"
+  #include "../../bsp/inth.h"
+  #include "../../bsp/iq.h"
 
   #if L1_GPRS
     #include "l1p_cons.h"
@@ -174,7 +175,9 @@
 #endif
 #endif
 
-#include "sys_conf.h"
+#if (CHIPSET >= 12)
+  #include "sys_conf.h"
+#endif
 
 #if (OP_L1_STANDALONE != 1) && (WCP_PROF == 1)
   #include "prf/prf_api.h"
@@ -185,7 +188,10 @@
 #define TOTAL_NO_OF_BITS_IDLE_MEAS    625
 extern UWORD32 qual_acc_idle1[2];
 
-#include "tpudrv61.h"
+#if (RF_FAM == 61)
+  #include "tpudrv61.h"
+#endif
+
 #if W_A_DSP1
   UWORD8 old_sacch_DSP_bug = FALSE;
 #endif
@@ -368,11 +374,20 @@
       (*( volatile unsigned short* )(0xFFFE4802)) |= (1 << 2);    // GPIO-2=1
     #endif
 
+/*
+ * FreeCalypso change: the conditioned-out GPIO twiddling below appears in
+ * the LoCosto version of this L1 code without any conditionals around it.
+ * Checking the disassembly of the Leonardo binary object confirms that
+ * NO GPIO muck takes places in that version.  Needless to say, I am
+ * disabling it for FreeCalypso - we don't want to wreak havoc on some
+ * target that uses GPIO 0 for something else.
+ */
+#if 0
    // Configure GPIO0 pin as output - Reset Bit 0 i.e. set Bit 0 to 0
    (*( volatile unsigned short* )(0xFFFE4804)) &= (~(1 << 0));    // GPIO-2=1
    // write 1 in GPIO pin 0
    (*( volatile unsigned short* )(0xFFFE4802)) |= (1 << 0);    // GPIO-2=1
-
+#endif
 
     // stop the gauging.This function must be called at the
     // begining of the HISR in order to have the IT_GAUGING
@@ -518,9 +533,10 @@
       }
     #endif
 
+#if 0
    // write 0 in GPIO pin 0
    (*( volatile unsigned short* )(0xFFFE4802)) &= (~(1 << 0));    // GPIO-2=1
-
+#endif
 
   }
 
@@ -6061,7 +6077,7 @@
       // Accumulate the new measurement with the partial result.
       // Compensate AGC for current measurement value.
       l1a_l1s_com.Scell_info.meas.acc += l1a_l1s_com.Scell_IL_for_rxlev;
-	  static_s_rxlev_cntr++;
+      static_s_rxlev_cntr++;
 
       // **********
       // Reporting
@@ -6125,7 +6141,7 @@
 
         // Reset pointer for debugg.
         pch_msg = NULL;
-		static_s_rxlev_cntr = 0;
+	static_s_rxlev_cntr = 0;
       }
 
     }// end of READ
@@ -7501,6 +7517,12 @@
       {
         l1a_l1s_com.dedic_set.stop_tch = TRUE;
 
+	/*
+	 * FreeCalypso change: this module was failing to compile without
+	 * AUDIO_TASK enabled because of the following code;
+	 * conditional has been added.
+	 */
+      #if AUDIO_TASK
         // If audio enabling was forced by L1S because of a HO failure, do not force it anymore.
         // Restore it in the state required by the MMI if the feature is compiled.
         if (l1a_l1s_com.audio_forced_by_l1s == TRUE)
@@ -7515,6 +7537,7 @@
         #endif // L1_EXTERNAL_AUDIO_VOICE_ONOFF
           l1a_l1s_com.audio_forced_by_l1s = FALSE;
         }
+      #endif
       }
 
       // The new channel becomes the ACTIVE one.
@@ -7802,6 +7825,8 @@
     {
       l1a_l1s_com.dedic_set.stop_tch = TRUE;
 
+      /* FreeCalypso change: same situation as earlier in this function */
+    #if AUDIO_TASK
       // If audio enabling was forced by L1S because of a HO failure, do not force it anymore.
       // Restore it in the state required by the MMI if the feature is compiled.
       if (l1a_l1s_com.audio_forced_by_l1s == TRUE)
@@ -7816,6 +7841,7 @@
       #endif // L1_EXTERNAL_AUDIO_VOICE_ONOFF
         l1a_l1s_com.audio_forced_by_l1s = FALSE;
       }
+    #endif
 
    #if (AMR == 1)
       // Reset DTX AMR status
@@ -7839,36 +7865,38 @@
     l1a_l1s_com.l1s_en_task[TCHA]  = TASK_DISABLED;
 
 
-		// Reset active dedicated set.
-		l1a_l1s_com.dedic_set.aset = NULL;
-
-	}
-	else
-	{
-	     if (l1a_l1s_com.audio_forced_by_l1s == TRUE)
-	    {
-		  #if (L1_EXTERNAL_AUDIO_VOICE_ONOFF == 1)
-			if (l1a_l1s_com.audio_onoff_task.parameters.onoff_value == FALSE)
-			{
-			  l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (API) B_AUDIO_OFF_STOP;
-			}
-		  #else // L1_EXTERNAL_AUDIO_VOICE_ONOFF
-			l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (API) B_AUDIO_OFF_STOP;
-		  #endif // L1_EXTERNAL_AUDIO_VOICE_ONOFF
-			l1a_l1s_com.audio_forced_by_l1s = FALSE;
-         }
-         #if (AMR == 1)
-	  // Reset DTX AMR status
-	 l1s.dtx_amr_dl_on=FALSE;
-	 #endif
-
-	}
-
-    // Clear d_ra_conf => default value
-    l1s_dsp_com.dsp_ndb_ptr->d_ra_conf = 0;
-
-	// Reset input msg.
-	l1a_l1s_com.dedic_set.SignalCode = NULL;
+    // Reset active dedicated set.
+    l1a_l1s_com.dedic_set.aset = NULL;
+
+  }
+  else
+  {
+    /* FreeCalypso change: same AUDIO_TASK situation as earlier */
+    #if AUDIO_TASK
+      if (l1a_l1s_com.audio_forced_by_l1s == TRUE)
+      {
+        #if (L1_EXTERNAL_AUDIO_VOICE_ONOFF == 1)
+          if (l1a_l1s_com.audio_onoff_task.parameters.onoff_value == FALSE)
+          {
+            l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (API) B_AUDIO_OFF_STOP;
+          }
+        #else // L1_EXTERNAL_AUDIO_VOICE_ONOFF
+          l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (API) B_AUDIO_OFF_STOP;
+        #endif // L1_EXTERNAL_AUDIO_VOICE_ONOFF
+        l1a_l1s_com.audio_forced_by_l1s = FALSE;
+      }
+    #endif
+    #if (AMR == 1)
+      // Reset DTX AMR status
+      l1s.dtx_amr_dl_on=FALSE;
+    #endif
+  }
+
+  // Clear d_ra_conf => default value
+  l1s_dsp_com.dsp_ndb_ptr->d_ra_conf = 0;
+
+  // Reset input msg.
+  l1a_l1s_com.dedic_set.SignalCode = NULL;
  #if ((REL99 == 1) && (FF_BHO == 1))
     // this is required in BHO as you need to retain the previous channel info.
     //This is checked in HO_REQ to L1S.....In normal handover this does not happen
@@ -8162,11 +8190,16 @@
         {
           l1a_l1s_com.dedic_set.stop_tch = TRUE;
 
+	/*
+	 * FreeCalypso change: same AUDIO_TASK conditional issue as earlier.
+	 */
+	#if AUDIO_TASK
           // CQ: Force the Audio ON to avoid having the DSP reseting the VDLON and producing a pop noise
           // on single ended outputs.
           l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (API) B_AUDIO_ON_START;
           l1s.l1_audio_it_com = TRUE;
           l1a_l1s_com.audio_forced_by_l1s = TRUE;
+	#endif
         }
 
         // Clear ciphering setting in MCU-DSP com.