comparison gsm-fw/L1/cust0/l1_cust.c @ 528:1affe428bf72

getting closer to compiling l1_cust.c
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 15 Jul 2014 16:54:52 +0000
parents b92febec14aa
children 9c91a1f670bd
comparison
equal deleted inserted replaced
527:a6ff7b513bcf 528:1affe428bf72
2 * This FreeCalypso version of l1_cust.c is based on the LoCosto version; 2 * This FreeCalypso version of l1_cust.c is based on the LoCosto version;
3 * see ../cust1/l1_cust.c for the original. 3 * see ../cust1/l1_cust.c for the original.
4 */ 4 */
5 5
6 #include <string.h> 6 #include <string.h>
7 #include "../../include/config.h" 7 #include "config.h"
8 8 #include "sys_types.h"
9 #include "../include/l1_confg.h" 9
10 #include "../include/l1_const.h" 10 #include "../../riviera/rv/general.h"
11 #include "../../bsp/ulpd.h"
12 #include "../../nucleus/nucleus.h" 11 #include "../../nucleus/nucleus.h"
13 #include "../../nucleus/tm_defs.h" 12 #include "../../nucleus/tm_defs.h"
14 #include "../include/l1_types.h" 13 #include "../../gpf/inc/cust_os.h"
15 #include "../include/l1_time.h" 14
16 #include "../include/l1_trace.h" 15 #include "l1_confg.h"
17 #include "../../include/sys_types.h" 16 #include "l1_const.h"
18 #include "../include/l1_macro.h" 17 #include "../../bsp/ulpd.h"
18 #include "l1_types.h"
19 #include "l1_time.h"
20 #include "l1_trace.h"
21 #include "l1_macro.h"
19 #include "../../serial/serialswitch.h" 22 #include "../../serial/serialswitch.h"
20 #include "../../bsp/abb+spi/abb.h" 23 #include "../../bsp/abb+spi/abb.h"
21 24
22 #if(OP_L1_STANDALONE == 0) 25 #if CONFIG_GSM
23 #include "buzzer/buzzer.h" // for BZ_KeyBeep_OFF function 26 #include "../../bsp/sim.h"
24 #include "sim/sim.h"
25 #endif 27 #endif
26 28
27 #if TESTMODE 29 #if TESTMODE
28 #include "l1tm_defty.h" 30 #include "l1tm_defty.h"
29 #endif 31 #endif
56 #include "l1_ctl.h" 58 #include "l1_ctl.h"
57 #endif 59 #endif
58 60
59 61
60 #if (RF_FAM == 61) 62 #if (RF_FAM == 61)
61 #include "drp_drive.h" 63 #include "drp_drive.h"
62 #include "tpudrv61.h" 64 #include "tpudrv61.h"
63 #include "l1_rf61.h" 65 #include "l1_rf61.h"
64 #include "l1_rf61.c" 66 //#include "l1_rf61.c"
65 #endif 67 #endif
66 68
67 69
68 #if (RF_FAM == 60 ) 70 #if (RF_FAM == 60 )
69 #include "drp_drive.h" 71 #include "drp_drive.h"
70 #include "tpudrv60.h" 72 #include "tpudrv60.h"
71 #include "l1_rf60.h" 73 #include "l1_rf60.h"
72 #include "l1_rf60.c" 74 //#include "l1_rf60.c"
73 //#include "rf60.h" 75 //#include "rf60.h"
74 #endif 76 #endif
75 77
76 #if (RF_FAM == 43) 78 #if (RF_FAM == 43)
77 #include "tpudrv43.h" 79 #include "tpudrv43.h"
78 #include "l1_rf43.h" 80 #include "l1_rf43.h"
79 #include "l1_rf43.c" 81 //#include "l1_rf43.c"
80 #endif 82 #endif
81 83
82 #if (RF_FAM == 35) 84 #if (RF_FAM == 35)
83 #include "tpudrv35.h" 85 #include "tpudrv35.h"
84 #include "l1_rf35.h" 86 #include "l1_rf35.h"
85 #include "l1_rf35.c" 87 //#include "l1_rf35.c"
86 #endif 88 #endif
87 89
88 #if (RF_FAM == 12) 90 #if (RF_FAM == 12)
89 #include "tpudrv12.h" 91 #include "tpudrv12.h"
90 #include "l1_rf12.h" 92 #include "l1_rf12.h"
91 #include "l1_rf12.c" 93 //#include "l1_rf12.c"
92 #endif 94 #endif
93 95
94 #if (RF_FAM == 10) 96 #if (RF_FAM == 10)
95 #include "tpudrv10.h" 97 #include "tpudrv10.h"
96 #include "l1_rf10.h" 98 #include "l1_rf10.h"
97 #include "l1_rf10.c" 99 //#include "l1_rf10.c"
98 #endif 100 #endif
99 101
100 #if (RF_FAM == 8) 102 #if (RF_FAM == 8)
101 #include "tpudrv8.h" 103 #include "tpudrv8.h"
102 #include "l1_rf8.h" 104 #include "l1_rf8.h"
103 #include "l1_rf8.c" 105 //#include "l1_rf8.c"
104 #endif 106 #endif
105 107
106 #if (RF_FAM == 2) 108 #if (RF_FAM == 2)
107 #include "l1_rf2.h" 109 #include "l1_rf2.h"
108 #include "l1_rf2.c" 110 //#include "l1_rf2.c"
109 #endif 111 #endif
110 112
111 #if (DRP_FW_EXT == 1) 113 #if (DRP_FW_EXT == 1)
112 #include "l1_drp_inc.h" 114 #include "l1_drp_inc.h"
113 #include "l1_ver.h" 115 #include "l1_ver.h"
114 #endif 116 #endif
115 117
118 /*
119 * FreeCalypso change: l1_rf12.c is now a separate compilation unit,
120 * so we need to extern the data objects defined therein.
121 */
122 extern T_RF rf;
123 extern T_RF_BAND rf_band[GSM_BANDS];
124 extern const T_RF_BAND rf_850, rf_900, rf_1800, rf_1900;
125 extern UWORD16 abb[ABB_TABLE_SIZE];
126 extern UWORD16 AGC_TABLE[AGC_TABLE_SIZE];
127 extern T_ADC adc;
128 extern T_ADCCAL adc_cal;
129 extern T_TEMP temperature[TEMP_TABLE_SIZE];
116 130
117 // Nucleus functions 131 // Nucleus functions
118 extern INT TMD_Timer_State; 132 extern INT TMD_Timer_State;
119 extern UWORD32 TMD_Timer; // for big sleep 133 extern UWORD32 TMD_Timer; // for big sleep
120 extern UWORD32 TCD_Priority_Groups; 134 extern UWORD32 TCD_Priority_Groups;
121 extern VOID *TCD_Current_Thread; 135 extern VOID *TCD_Current_Thread;
122 extern TC_HCB *TCD_Active_HISR_Heads[TC_HISR_PRIORITIES]; 136 extern TC_HCB *TCD_Active_HISR_Heads[TC_HISR_PRIORITIES];
123 extern TC_HCB *TCD_Active_HISR_Tails[TC_HISR_PRIORITIES]; 137 extern TC_HCB *TCD_Active_HISR_Tails[TC_HISR_PRIORITIES];
124 extern TC_PROTECT TCD_System_Protect; 138 extern TC_PROTECT TCD_System_Protect;
125 139
126 #if (L2_L3_SIMUL == 0) 140 #define FFS_WORKAROUND 0
127 #define FFS_WORKAROUND 0 141
142 #if 1 // (FFS_WORKAROUND == 1)
143 #include "../../services/ffs/ffs.h"
128 #else 144 #else
129 #define FFS_WORKAROUND 0
130 #endif
131 #if (FFS_WORKAROUND == 1)
132 #include "ffs/ffs.h"
133 #else
134 /* typedef signed int int32; 145 /* typedef signed int int32;
135 typedef signed char effs_t;*/ 146 typedef signed char effs_t;*/
136 typedef signed int filesize_t; 147 typedef signed int filesize_t;
137 effs_t ffs_fwrite(const char *name, void *addr, filesize_t size); 148 effs_t ffs_fwrite(const char *name, void *addr, filesize_t size);
138 #if (DRP_FW_EXT == 0) 149 #if (DRP_FW_EXT == 0)
139 effs_t ffs_fread(const char *name, void *addr, filesize_t size); 150 effs_t ffs_fread(const char *name, void *addr, filesize_t size);
140 #endif 151 #endif
141 #endif 152 #endif
142 153
143 // Import band configuration from Flash module (need to replace by an access function) 154 // Import band configuration from Flash module (need to replace by an access function)
144 //extern UWORD8 std; 155 //extern UWORD8 std;
145 extern T_L1_CONFIG l1_config; 156 extern T_L1_CONFIG l1_config;
146 extern T_L1S_GLOBAL l1s; 157 extern T_L1S_GLOBAL l1s;
147 158
148 #if(OP_L1_STANDALONE == 0) 159 #if 0 //(OP_L1_STANDALONE == 0)
149 extern SYS_BOOL cama_sleep_status(void); 160 extern SYS_BOOL cama_sleep_status(void);
150 #endif 161 #endif
151 162
152 #if (CODE_VERSION != SIMULATION) 163 #if (CODE_VERSION != SIMULATION)
153 // Import serial switch configuration 164 // Import serial switch configuration
171 void config_rf_read(char type); 182 void config_rf_read(char type);
172 void config_rf_write(char type); 183 void config_rf_write(char type);
173 184
174 #if (RF_FAM == 61) 185 #if (RF_FAM == 61)
175 #include "drp_api.h" 186 #include "drp_api.h"
176
177 187
178 extern T_DRP_SW_DATA drp_sw_data_init; 188 extern T_DRP_SW_DATA drp_sw_data_init;
179 extern T_DRP_SW_DATA drp_sw_data_calib; 189 extern T_DRP_SW_DATA drp_sw_data_calib;
180 extern T_DRP_SW_DATA drp_sw_data_calib_saved; 190 extern T_DRP_SW_DATA drp_sw_data_calib_saved;
181 #endif 191 #endif
314 if (l1_config.pwr_mngt == PWR_MNGT) 324 if (l1_config.pwr_mngt == PWR_MNGT)
315 { 325 {
316 326
317 #if (L2_L3_SIMUL == 0) 327 #if (L2_L3_SIMUL == 0)
318 // Forbid deep sleep if the light is on 328 // Forbid deep sleep if the light is on
329 /* FreeCalypso change: this LT_Status() function is defunct */
330 #if 0
319 if(LT_Status()) 331 if(LT_Status())
320 { 332 {
321 //cut ARMIO and UWIRE clocks in big sleep 333 //cut ARMIO and UWIRE clocks in big sleep
322 l1s.pw_mgr.modules_status = ARMIO_CLK_CUT | UWIRE_CLK_CUT ; 334 l1s.pw_mgr.modules_status = ARMIO_CLK_CUT | UWIRE_CLK_CUT ;
323 l1s.pw_mgr.why_big_sleep = BIG_SLEEP_DUE_TO_LIGHT_ON; 335 l1s.pw_mgr.why_big_sleep = BIG_SLEEP_DUE_TO_LIGHT_ON;
324 return(FRAME_STOP); // BIG sleep 336 return(FRAME_STOP); // BIG sleep
325 } 337 }
338 #endif
326 339
327 #if (OP_L1_STANDALONE == 0) 340 #if (OP_L1_STANDALONE == 0)
328 // Forbid deep sleep if the camera is working 341 // Forbid deep sleep if the camera is working
342 /* FreeCalypso change: no camera */
343 #if 0
329 if(!cama_sleep_status()) 344 if(!cama_sleep_status())
330 { 345 {
331 l1s.pw_mgr.why_big_sleep = BIG_SLEEP_DUE_TO_CAMERA; 346 l1s.pw_mgr.why_big_sleep = BIG_SLEEP_DUE_TO_CAMERA;
332 return(FRAME_STOP); // BIG sleep 347 return(FRAME_STOP); // BIG sleep
333 } 348 }
349 #endif
334 350
335 // Forbid deep sleep if the SIM and UARTs not ready 351 // Forbid deep sleep if the SIM and UARTs not ready
336 #if (REQUIRED_FOR_ESAMPLE_LOCOSTO) 352 // FC note: this call to SIM_SleepStatus() *is* present in the Leonardo object
353 #if CONFIG_GSM //(REQUIRED_FOR_ESAMPLE_LOCOSTO)
337 // Forbid deep sleep if the SIM and UARTs not ready 354 // Forbid deep sleep if the SIM and UARTs not ready
338 if(SIM_SleepStatus()) 355 if(SIM_SleepStatus())
339 #endif 356 #endif
340 { 357 {
341 #endif 358 #endif
347 else l1s.pw_mgr.why_big_sleep = BIG_SLEEP_DUE_TO_UART; 364 else l1s.pw_mgr.why_big_sleep = BIG_SLEEP_DUE_TO_UART;
348 #if (L2_L3_SIMUL == 0) 365 #if (L2_L3_SIMUL == 0)
349 #if (OP_L1_STANDALONE == 0) 366 #if (OP_L1_STANDALONE == 0)
350 } 367 }
351 // Forbid deep sleep if the SIM and UARTs not ready 368 // Forbid deep sleep if the SIM and UARTs not ready
352 #if (REQUIRED_FOR_ESAMPLE_LOCOSTO) 369 #if CONFIG_GSM //(REQUIRED_FOR_ESAMPLE_LOCOSTO)
353 else l1s.pw_mgr.why_big_sleep = BIG_SLEEP_DUE_TO_SIM; 370 else l1s.pw_mgr.why_big_sleep = BIG_SLEEP_DUE_TO_SIM;
354 #endif 371 #endif
355 #endif 372 #endif
356 #endif 373 #endif
357 // cut ARMIO and UWIRE clocks in big sleep 374 // cut ARMIO and UWIRE clocks in big sleep
771 #else 788 #else
772 l1_config.params.dco_enabled = FALSE; 789 l1_config.params.dco_enabled = FALSE;
773 #endif 790 #endif
774 #endif 791 #endif
775 792
776 #if (ANLG_FAM == 1) 793 #if (ANALOG == 1)
777 l1_config.params.debug1 = C_DEBUG1; // Enable f_tx delay of 400000 cyc DEBUG 794 l1_config.params.debug1 = C_DEBUG1; // Enable f_tx delay of 400000 cyc DEBUG
778 l1_config.params.afcctladd = abb[ABB_AFCCTLADD]; // Value at reset 795 l1_config.params.afcctladd = abb[ABB_AFCCTLADD]; // Value at reset
779 l1_config.params.vbuctrl = abb[ABB_VBUCTRL]; // Uplink gain amp 0dB, Sidetone gain to mute 796 l1_config.params.vbuctrl = abb[ABB_VBUCTRL]; // Uplink gain amp 0dB, Sidetone gain to mute
780 l1_config.params.vbdctrl = abb[ABB_VBDCTRL]; // Downlink gain amp 0dB, Volume control 0 dB 797 l1_config.params.vbdctrl = abb[ABB_VBDCTRL]; // Downlink gain amp 0dB, Volume control 0 dB
781 l1_config.params.bbctrl = abb[ABB_BBCTRL]; // value at reset 798 l1_config.params.bbctrl = abb[ABB_BBCTRL]; // value at reset
785 l1_config.params.dai_onoff = abb[ABB_DAI_ON_OFF]; // value at reset 802 l1_config.params.dai_onoff = abb[ABB_DAI_ON_OFF]; // value at reset
786 l1_config.params.auxdac = abb[ABB_AUXDAC]; // value at reset 803 l1_config.params.auxdac = abb[ABB_AUXDAC]; // value at reset
787 l1_config.params.vbctrl = abb[ABB_VBCTRL]; // VULSWITCH=0, VDLAUX=1, VDLEAR=1 804 l1_config.params.vbctrl = abb[ABB_VBCTRL]; // VULSWITCH=0, VDLAUX=1, VDLEAR=1
788 l1_config.params.apcdel1 = abb[ABB_APCDEL1]; // value at reset 805 l1_config.params.apcdel1 = abb[ABB_APCDEL1]; // value at reset
789 #endif 806 #endif
790 #if (ANLG_FAM == 2) 807 #if (ANALOG == 2)
791 l1_config.params.debug1 = C_DEBUG1; // Enable f_tx delay of 400000 cyc DEBUG 808 l1_config.params.debug1 = C_DEBUG1; // Enable f_tx delay of 400000 cyc DEBUG
792 l1_config.params.afcctladd = abb[ABB_AFCCTLADD]; // Value at reset 809 l1_config.params.afcctladd = abb[ABB_AFCCTLADD]; // Value at reset
793 l1_config.params.vbuctrl = abb[ABB_VBUCTRL]; // Uplink gain amp 0dB, Sidetone gain to mute 810 l1_config.params.vbuctrl = abb[ABB_VBUCTRL]; // Uplink gain amp 0dB, Sidetone gain to mute
794 l1_config.params.vbdctrl = abb[ABB_VBDCTRL]; // Downlink gain amp 0dB, Volume control 0 dB 811 l1_config.params.vbdctrl = abb[ABB_VBDCTRL]; // Downlink gain amp 0dB, Volume control 0 dB
795 l1_config.params.bbctrl = abb[ABB_BBCTRL]; // value at reset 812 l1_config.params.bbctrl = abb[ABB_BBCTRL]; // value at reset
802 l1_config.params.vbctrl1 = abb[ABB_VBCTRL1]; // VULSWITCH=0, VDLAUX=1, VDLEAR=1 819 l1_config.params.vbctrl1 = abb[ABB_VBCTRL1]; // VULSWITCH=0, VDLAUX=1, VDLEAR=1
803 l1_config.params.vbctrl2 = abb[ABB_VBCTRL2]; // MICBIASEL=0, VDLHSO=0, MICAUX=0 820 l1_config.params.vbctrl2 = abb[ABB_VBCTRL2]; // MICBIASEL=0, VDLHSO=0, MICAUX=0
804 l1_config.params.apcdel1 = abb[ABB_APCDEL1]; // value at reset 821 l1_config.params.apcdel1 = abb[ABB_APCDEL1]; // value at reset
805 l1_config.params.apcdel2 = abb[ABB_APCDEL2]; // value at reset 822 l1_config.params.apcdel2 = abb[ABB_APCDEL2]; // value at reset
806 #endif 823 #endif
807 #if (ANLG_FAM == 3) 824 #if (ANALOG == 3)
808 l1_config.params.debug1 = C_DEBUG1; // Enable f_tx delay of 400000 cyc DEBUG 825 l1_config.params.debug1 = C_DEBUG1; // Enable f_tx delay of 400000 cyc DEBUG
809 l1_config.params.afcctladd = abb[ABB_AFCCTLADD]; // Value at reset 826 l1_config.params.afcctladd = abb[ABB_AFCCTLADD]; // Value at reset
810 l1_config.params.vbuctrl = abb[ABB_VBUCTRL]; // Uplink gain amp 0dB, Sidetone gain to mute 827 l1_config.params.vbuctrl = abb[ABB_VBUCTRL]; // Uplink gain amp 0dB, Sidetone gain to mute
811 l1_config.params.vbdctrl = abb[ABB_VBDCTRL]; // Downlink gain amp 0dB, Volume control 0 dB 828 l1_config.params.vbdctrl = abb[ABB_VBDCTRL]; // Downlink gain amp 0dB, Volume control 0 dB
812 l1_config.params.bbctrl = abb[ABB_BBCTRL]; // value at reset 829 l1_config.params.bbctrl = abb[ABB_BBCTRL]; // value at reset
831 #if (RF_FAM == 61) 848 #if (RF_FAM == 61)
832 l1_config.params.apcctrl2 = drp_wrapper[DRP_WRAPPER_APCCTRL2]; 849 l1_config.params.apcctrl2 = drp_wrapper[DRP_WRAPPER_APCCTRL2];
833 l1_config.params.apcdel1 = drp_wrapper[DRP_WRAPPER_APCDEL1]; 850 l1_config.params.apcdel1 = drp_wrapper[DRP_WRAPPER_APCDEL1];
834 l1_config.params.apcdel2 = drp_wrapper[DRP_WRAPPER_APCDEL2]; 851 l1_config.params.apcdel2 = drp_wrapper[DRP_WRAPPER_APCDEL2];
835 #endif 852 #endif
836 #if (ANLG_FAM == 11) 853 #if (ANALOG == 11)
837 l1_config.params.vulgain = abb[ABB_VULGAIN]; 854 l1_config.params.vulgain = abb[ABB_VULGAIN];
838 l1_config.params.vdlgain = abb[ABB_VDLGAIN]; 855 l1_config.params.vdlgain = abb[ABB_VDLGAIN];
839 l1_config.params.sidetone = abb[ABB_SIDETONE]; 856 l1_config.params.sidetone = abb[ABB_SIDETONE];
840 l1_config.params.ctrl1 = abb[ABB_CTRL1]; 857 l1_config.params.ctrl1 = abb[ABB_CTRL1];
841 l1_config.params.ctrl2 = abb[ABB_CTRL2]; 858 l1_config.params.ctrl2 = abb[ABB_CTRL2];
894 /* Return : band number */ 911 /* Return : band number */
895 /* Functionality : Computes the band for RF calibration */ 912 /* Functionality : Computes the band for RF calibration */
896 /*-------------------------------------------------------*/ 913 /*-------------------------------------------------------*/
897 /*---------------------------------------------*/ 914 /*---------------------------------------------*/
898 915
899 UWORD8 band_number;
900 #if (CODE_VERSION == SIMULATION) 916 #if (CODE_VERSION == SIMULATION)
901 UWORD16 Cust_get_agc_band(UWORD16 arfcn, UWORD8 gsm_band) 917 UWORD16 Cust_get_agc_band(UWORD16 arfcn, UWORD8 gsm_band)
902 #else 918 #else
903 UWORD16 inline Cust_get_agc_band(UWORD16 arfcn, UWORD8 gsm_band) 919 UWORD16 inline Cust_get_agc_band(UWORD16 arfcn, UWORD8 gsm_band)
904 #endif 920 #endif
905 { 921 {
906 // WORD32 i =0 ; //omaps00090550 922 // WORD32 i =0 ; //omaps00090550
923 UWORD8 band_number;
907 924
908 for (band_number=0;band_number<RF_RX_CAL_CHAN_SIZE;band_number++) 925 for (band_number=0;band_number<RF_RX_CAL_CHAN_SIZE;band_number++)
909 { 926 {
910 if (arfcn <= rf_band[gsm_band].rx.agc_bands[band_number].upper_bound) 927 if (arfcn <= rf_band[gsm_band].rx.agc_bands[band_number].upper_bound)
911 return(band_number); 928 return(band_number);
1095 #endif //if( L1_FF_MULTIBAND == 0) 1112 #endif //if( L1_FF_MULTIBAND == 0)
1096 1113
1097 index_up = rf_band[band].tx.levels[txpwr_ramp_up].ramp_index; 1114 index_up = rf_band[band].tx.levels[txpwr_ramp_up].ramp_index;
1098 index_down = rf_band[band].tx.levels[txpwr_ramp_down].ramp_index; 1115 index_down = rf_band[band].tx.levels[txpwr_ramp_down].ramp_index;
1099 1116
1100 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3)) 1117 #if ((ANALOG == 1) || (ANALOG == 2) || (ANALOG == 3))
1101 for (j=0; j<16; j++) 1118 for (j=0; j<16; j++)
1102 { 1119 {
1103 a_ramp[j]=((rf_band[band].tx.ramp_tables[index_down].ramp_down[j])<<11) | 1120 a_ramp[j]=((rf_band[band].tx.ramp_tables[index_down].ramp_down[j])<<11) |
1104 ((rf_band[band].tx.ramp_tables[index_up].ramp_up[j]) << 6) | 1121 ((rf_band[band].tx.ramp_tables[index_up].ramp_up[j]) << 6) |
1105 0x14; 1122 0x14;
1122 /* Parameters : */ 1139 /* Parameters : */
1123 /* Return : */ 1140 /* Return : */
1124 /* Functionality : */ 1141 /* Functionality : */
1125 /*-------------------------------------------------------*/ 1142 /*-------------------------------------------------------*/
1126 1143
1127 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3) || (RF_FAM == 61)) 1144 #if ((ANALOG == 1) || (ANALOG == 2) || (ANALOG == 3) || (RF_FAM == 61))
1128 UWORD16 Cust_get_pwr_data(UWORD8 txpwr, UWORD16 radio_freq 1145 UWORD16 Cust_get_pwr_data(UWORD8 txpwr, UWORD16 radio_freq
1129 #if (REL99 && FF_PRF) 1146 #if (REL99 && FF_PRF)
1130 , UWORD8 number_uplink_timeslot 1147 , UWORD8 number_uplink_timeslot
1131 #endif 1148 #endif
1132 ) 1149 )
1320 #endif 1337 #endif
1321 1338
1322 l1_initialize(&cfg); 1339 l1_initialize(&cfg);
1323 1340
1324 //add below line for CSR 174476 1341 //add below line for CSR 174476
1325 trace_info.current_config->l1_dyn_trace = 0; //disable L1 trace after L1 init 1342 //FC note: not present in Leonardo binary object, will take closer look later
1343 trace_info.current_config->l1_dyn_trace = 0; //disable L1 trace after L1 init
1326 1344
1327 get_cal_from_nvmem((UWORD8 *)&rf, sizeof(rf), RF_ID); 1345 get_cal_from_nvmem((UWORD8 *)&rf, sizeof(rf), RF_ID);
1328 get_cal_from_nvmem((UWORD8 *)&adc_cal, sizeof(adc_cal), ADC_ID); 1346 get_cal_from_nvmem((UWORD8 *)&adc_cal, sizeof(adc_cal), ADC_ID);
1329 1347
1330 } 1348 }
1518 #if (OP_L1_STANDALONE == 0) 1536 #if (OP_L1_STANDALONE == 0)
1519 l1s.pw_mgr.enough_gaug = FALSE; 1537 l1s.pw_mgr.enough_gaug = FALSE;
1520 #endif 1538 #endif
1521 } 1539 }
1522 #endif 1540 #endif
1523 //added for L1 standalone DRP calibration- this will overwrite the previous data
1524 #if (OP_L1_STANDALONE == 1)
1525 #pragma DATA_SECTION(drp_l1_standalone_calib_data, ".drp_l1_standalone_calib_data");
1526 T_DRP_SW_DATA drp_l1_standalone_calib_data;
1527 #pragma DATA_SECTION(valid_dro_standalone_calib_data_flag , ".valid_dro_standalone_calib_data_flag");
1528 UWORD32 valid_dro_standalone_calib_data_flag;
1529 //const T_DRP_SW_DATA drp_sw_data_init = { (UINT16) sizeof(T_DRP_CALIB), } -this needs to be filled by CCS
1530 //added for L1 standalone DRP calibration- ends
1531 #endif
1532 // for DRP Calibration
1533 /*-------------------------------------------------------*/
1534 /* Cust_init_params_drp() */
1535 /*-------------------------------------------------------*/
1536 /* Parameters : none */
1537 /* Return : none */
1538 /* Functionality : Intialization of DRP calibration. */
1539 /*-------------------------------------------------------*/
1540 #if (L1_DRP == 1)
1541 void Cust_init_params_drp(void)
1542 {
1543 #if (DRP_FW_EXT==1)
1544 l1s.boot_result=drp_sw_data_calib_upload_from_ffs(&drp_sw_data_calib);
1545 drp_copy_sw_data_to_drpsrm(&drp_sw_data_calib);
1546 #else // DRP_FW_EXT==0
1547 volatile UINT16 indx, strsize;
1548 volatile UINT8 *ptrsrc, *ptrdst;
1549
1550 #if (OP_L1_STANDALONE == 0)
1551 if(drp_sw_data_calib.length != drp_sw_data_init.length)
1552 {
1553 #endif
1554
1555 // For the 1st time FFS might have garbage, if so use the above as check to ensure
1556 //and copy from the .drp_sw_data_init structure.
1557
1558 // Copy drp_sw_data_init into drp_sw_data_calib
1559 strsize = sizeof(T_DRP_SW_DATA);
1560 ptrsrc = (UINT8 *)(&drp_sw_data_init);
1561 ptrdst = (UINT8 *)(&drp_sw_data_calib);
1562
1563 for(indx=0;indx < strsize;indx++)
1564 *ptrdst++ = *ptrsrc++;
1565
1566 #if (OP_L1_STANDALONE == 0)
1567 }
1568 #endif
1569
1570 drp_copy_sw_data_to_drpsrm(&drp_sw_data_calib);
1571
1572 //added for L1 standalone DRP calibration- this will overwrite the previous data
1573 #if (OP_L1_STANDALONE == 1)
1574 if(valid_dro_standalone_calib_data_flag == 0xDEADBEAF ) //indicates down the data via CCS
1575 drp_copy_sw_data_to_drpsrm(&drp_l1_standalone_calib_data);
1576 #endif
1577 //added for L1 standalone DRP calibration- ends
1578 #endif // DRP_FW_EXT
1579 }
1580 #endif
1581
1582
1583 #if (DRP_FW_EXT==1)
1584 void l1_get_boot_result_and_version(T_L1_BOOT_VERSION_CODE * p_version)
1585 {
1586 if(! p_version)
1587 {
1588 return;
1589 }
1590 p_version->dsp_code_version = l1s_dsp_com.dsp_ndb_ptr->d_version_number1;
1591 p_version->dsp_patch_version = l1s_dsp_com.dsp_ndb_ptr->d_version_number2;
1592 p_version->mcu_tcs_program_release = PROGRAM_RELEASE_VERSION;
1593 p_version->mcu_tcs_internal = INTERNAL_VERSION;
1594 p_version->mcu_tcs_official = OFFICIAL_VERSION;
1595
1596 p_version->drp_maj_ver = drp_ref_sw_ver;
1597 p_version->drp_min_ver = drp_ref_sw_tag;
1598
1599 p_version->boot_result = l1s.boot_result;
1600 }
1601 #endif /* DRP_FW_EXT */
1602
1603
1604
1605