changeset 542:9dd6ca16f13d

gsm-fw/L1/cust0: split between IRAM and XIP code
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 03 Aug 2014 04:59:30 +0000
parents 9c91a1f670bd
children 2dccd2b4e5a2
files gsm-fw/L1/cust0/Makefile gsm-fw/L1/cust0/l1_cust.c
diffstat 2 files changed, 38 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/L1/cust0/Makefile	Sat Aug 02 04:22:36 2014 +0000
+++ b/gsm-fw/L1/cust0/Makefile	Sun Aug 03 04:59:30 2014 +0000
@@ -4,9 +4,22 @@
 CFLAGS=	-O2 -fno-builtin -mthumb-interwork
 LD=	arm-elf-ld
 
-IOBJS=	ind_os.o l1_cust.o l1_rf12.o
+IOBJS=	ind_os.o l1_cust_iram.o
+XOBJS=	l1_cust_xip.o l1_rf12.o
+
+all:	iramcode.o xipcode.o
+
+l1_cust_iram.o:	l1_cust.c
+	${CC} ${CFLAGS} ${CPPFLAGS} -DRUN_INT_RAM -c -o $@ $<
 
-all:	${IOBJS}
+l1_cust_xip.o:	l1_cust.c
+	${CC} ${CFLAGS} ${CPPFLAGS} -DRUN_FLASH -c -o $@ $<
+
+iramcode.o:	${IOBJS}
+	${LD} -r -o $@ ${IOBJS}
+
+xipcode.o:	${XOBJS}
+	${LD} -r -o $@ ${XOBJS}
 
 clean:
 	rm -f *.[oa] *.out *errs
--- a/gsm-fw/L1/cust0/l1_cust.c	Sat Aug 02 04:22:36 2014 +0000
+++ b/gsm-fw/L1/cust0/l1_cust.c	Sun Aug 03 04:59:30 2014 +0000
@@ -199,7 +199,7 @@
   ADC_ID       = 1
 };
 
-#if (L1_FF_MULTIBAND == 0)
+#if (L1_FF_MULTIBAND == 0) && !defined(RUN_INT_RAM)
 /*-------------------------------------------------------*/
 /* Parameters:    none                                   */
 /* Return:        none                                   */
@@ -207,7 +207,7 @@
 /*                for each std.                          */
 /*-------------------------------------------------------*/
 //omaps00090550 #83 warinng removal
-static const T_BAND_CONFIG band_config[] =
+const T_BAND_CONFIG band_config[] =
 { /*ffs name, default addr, max carrier, min tx pwr */
   {"",(T_RF_BAND *) 0,0,0},//undefined
   {"900", (T_RF_BAND *)&rf_900,  174, 19 },//EGSM
@@ -245,6 +245,11 @@
 };
 #endif //if (L1_FF_MULTIBAND == 0)
 
+#if (L1_FF_MULTIBAND == 0) && defined(RUN_INT_RAM)
+extern const T_BAND_CONFIG band_config[];
+extern const T_STD_CONFIG std_config[];
+#endif
+
 /*-------------------------------------------------------*/
 /* Prototypes of external functions used in this file.   */
 /*-------------------------------------------------------*/
@@ -252,6 +257,8 @@
 #if (L1_FF_MULTIBAND == 0)
 WORD16 Convert_l1_radio_freq  (UWORD16 radio_freq);
 #endif
+
+#ifndef RUN_FLASH
 /*-------------------------------------------------------*/
 /* Cust_recover_Os()                                      */
 /*-------------------------------------------------------*/
@@ -384,8 +391,9 @@
 #endif
 return(CLOCK_STOP); // omaps00090550
 }
+#endif	/* !RUN_FLASH */
 
-
+#ifndef RUN_INT_RAM
 /*-------------------------------------------------------*/
 /* Parameters:    none                                   */
 /* Return:        none                                   */
@@ -872,8 +880,9 @@
     l1_config.params.aurga		= abb[ABB_AURGA];
   #endif
 }
+#endif	/* !RUN_INT_RAM */
 
-
+#ifndef	RUN_FLASH
 /************************************/
 /* Automatic Gain Control           */
 /************************************/
@@ -1294,7 +1303,9 @@
 }
 
 #endif
+#endif	/* !RUN_FLASH */
 
+#ifndef	RUN_INT_RAM
 /*-------------------------------------------------------*/
 /* Cust_Init_Layer1                                      */
 /*-------------------------------------------------------*/
@@ -1350,14 +1361,14 @@
   get_cal_from_nvmem((UWORD8 *)&adc_cal, sizeof(adc_cal), ADC_ID);
 
 }
-
+#endif	/* !RUN_INT_RAM */
 
 /*****************************************************************************************/
 /***************************     TESTMODE functions     **********************************/
 /*****************************************************************************************/
 
 
-
+#ifndef	RUN_FLASH
   /*------------------------------------------------------*/
   /* madc_hex_2_physical                                  */
   /*------------------------------------------------------*/
@@ -1400,8 +1411,9 @@
   //store converted ADC values
   memcpy(adc_phy, &adc.converted[0], sizeof(adc.raw));
 }
+#endif	/* !RUN_FLASH */
 
-
+#ifndef	RUN_INT_RAM
   /*------------------------------------------------------*/
   /*  get_cal_from_nvmem                                  */
   /*------------------------------------------------------*/
@@ -1429,8 +1441,9 @@
 {
   return (0);
 }
+#endif	/* !RUN_INT_RAM */
 
-#if (TRACE_TYPE == 4)
+#if (TRACE_TYPE == 4) && !defined(RUN_FLASH)
 
 /*------------------------------------------------------*/
 /*  l1_cst_l1_parameters                                */
@@ -1516,6 +1529,7 @@
      (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || \
      (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || \
      (CHIPSET == 11) || (CHIPSET == 12))
+#ifndef RUN_FLASH
 /*-------------------------------------------------------*/
 /* power_down_config() : temporary implementation !!!    */
 /*-------------------------------------------------------*/
@@ -1542,3 +1556,4 @@
 #endif
 }
 #endif
+#endif