# HG changeset patch # User Mychaela Falconia # Date 1460042847 0 # Node ID 6062d349e74754f09cb50abc12c49b79c67e32ad # Parent 9348cbd02cab09d852828dc010cece050f5be477 l1_drive.c: fixes from the freecalypso-sw/gsm-fw version diff -r 9348cbd02cab -r 6062d349e747 chipsetsw/layer1/cfile/l1_drive.c --- a/chipsetsw/layer1/cfile/l1_drive.c Thu Apr 07 15:19:58 2016 +0000 +++ b/chipsetsw/layer1/cfile/l1_drive.c Thu Apr 07 15:27:27 2016 +0000 @@ -9,10 +9,8 @@ #define L1_DRIVE_C - #include "l1_confg.h" - #if (RF_FAM == 61) #include "apc.h" #endif @@ -135,51 +133,13 @@ -/*-------------------------------------------------------*/ -/* Prototypes of external functions used in this file. */ -/*-------------------------------------------------------*/ -void l1dmacro_reset_hw (UWORD32 servingCellOffset); -void l1dmacro_idle (void); -void l1dmacro_rx_synth (UWORD16 arfcn); -void l1dmacro_tx_synth (UWORD16 arfcn); -void l1dmacro_agc (UWORD16 arfcn,WORD8 gain, UWORD8 lna - #if (RF_FAM == 61) - , UWORD8 if_ctl - #endif - ); -void l1dmacro_afc (UWORD16 afc_value, UWORD8 win_id); -#if (CODE_VERSION == SIMULATION) - void l1dmacro_rx_ms (UWORD16 arfcn, BOOL rxnb_select); -#else -#if (L1_MADC_ON == 1) -#if (RF_FAM == 61) -void l1dmacro_rx_ms (SYS_UWORD16 arfcn,UWORD8 adc_active); -#endif -#else -void l1dmacro_rx_ms (SYS_UWORD16 arfcn); -#endif -#endif +/* + * Prototypes of external functions used in this file. + * + * FreeCalypso change: removed all those prototypes which appear + * in tpudrv.h, and kept only the additional ones. + */ -#if (L1_MADC_ON == 1) -#if (RF_FAM == 61) -void l1dmacro_rx_fb (UWORD16 arfcn , UWORD8 adc_active); -void l1dmacro_rx_fb26 (UWORD16 arfcn, UWORD8 adc_active); -#endif -#else -void l1dmacro_rx_fb (UWORD16 arfcn); -void l1dmacro_rx_fb26 (UWORD16 arfcn); -#endif -void l1dmacro_offset (UWORD32 offset_value, WORD32 relative_time); -void l1dmacro_synchro (UWORD32 when, UWORD32 value); -#if (L1_MADC_ON == 1) -#if (RF_FAM == 61) -void l1dmacro_rx_sb (UWORD16 arfcn, UWORD8 adc_active); -void l1dmacro_rx_nb (UWORD16 arfcn, UWORD8 adc_active, UWORD8 csf_filter_choice - #if (NEW_SNR_THRESHOLD == 1) - ,UWORD8 saic_flag - #endif /* NEW_SNR_THRESHOLD*/ - ); -#endif #if ((REL99 == 1) && (FF_BHO == 1)) #if (L1_MADC_ON == 1) void l1dmacro_rx_fbsb (SYS_UWORD16 radio_freq,UWORD8 adc_active); @@ -187,13 +147,6 @@ void l1dmacro_rx_fbsb (SYS_UWORD16 radio_freq); #endif #endif//#if ((REL99 == 1) && (FF_BHO == 1)) -#else -void l1dmacro_rx_sb (UWORD16 arfcn); -void l1dmacro_rx_nb (UWORD16 arfcn, UWORD8 csf_filter_choice); -#endif -void l1dmacro_tx_nb (UWORD16 arfcn, UWORD8 txpwr, UWORD8 adc_active); -void l1dmacro_tx_ra (UWORD16 arfcn, UWORD8 txpwr, UWORD8 adc_active); -void l1dmacro_adc_read_rx (void); void Cust_get_ramp_tab(API *a_ramp, UWORD8 txpwr_ramp_up, UWORD8 txpwr_ramp_down, UWORD16 radio_freq); #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3) || (RF_FAM == 61)) @@ -439,10 +392,10 @@ Cust_get_ramp_tab(l1s_dsp_com.dsp_ndb_ptr->a_drp_ramp, txpwr, txpwr, radio_freq); #endif #else - #if (CODE_VERSION != SIMULATION) + #if (CODE_VERSION != SIMULATION) /*** Reference to real ramp array (GSM: 15 power levels, 5-19, DCS: 16 power levels, 0-15) ***/ Cust_get_ramp_tab(l1s_dsp_com.dsp_ndb_ptr->a_ramp, txpwr, txpwr, radio_freq); - #endif + #endif #endif #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3)) @@ -565,13 +518,13 @@ /*** Reference to real ramp array (GSM: 15 power levels, 5-19, DCS: 16 power levels, 0-15) ***/ #if(RF_FAM == 61) - #if (DSP == 38) || (DSP == 39) + #if (DSP == 38) || (DSP == 39) Cust_get_ramp_tab(l1s_dsp_com.dsp_ndb_ptr->a_drp_ramp, txpwr, txpwr, radio_freq); - #endif - #else - #if (CODE_VERSION != SIMULATION) + #endif + #else + #if (CODE_VERSION != SIMULATION) Cust_get_ramp_tab(l1s_dsp_com.dsp_ndb_ptr->a_ramp, txpwr, txpwr, radio_freq); - #endif + #endif #endif #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3) ||(RF_FAM == 61)) @@ -692,7 +645,7 @@ UWORD8 reset_sacch, #if !FF_L1_IT_DSP_DTX UWORD8 vocoder_on) -#else + #else UWORD8 vocoder_on, BOOL dtx_dsp_interrupt) #endif @@ -790,7 +743,7 @@ UWORD8 tch_loop, UWORD8 sync_tch, #if !FF_L1_IT_DSP_DTX UWORD8 reset_sacch, UWORD8 vocoder_on) -#else + #else UWORD8 reset_sacch, UWORD8 vocoder_on, BOOL dtx_dsp_interrupt) #endif @@ -949,10 +902,10 @@ #else - l1s_dsp_com.dsp_ndb_ptr->a_a5_kc[0] = (ciph_key->A[0]) | (ciph_key->A[1] << 8); - l1s_dsp_com.dsp_ndb_ptr->a_a5_kc[1] = (ciph_key->A[2]) | (ciph_key->A[3] << 8); - l1s_dsp_com.dsp_ndb_ptr->a_a5_kc[2] = (ciph_key->A[4]) | (ciph_key->A[5] << 8); - l1s_dsp_com.dsp_ndb_ptr->a_a5_kc[3] = (ciph_key->A[6]) | (ciph_key->A[7] << 8); + l1s_dsp_com.dsp_ndb_ptr->a_kc[0] = (ciph_key->A[0]) | (ciph_key->A[1] << 8); + l1s_dsp_com.dsp_ndb_ptr->a_kc[1] = (ciph_key->A[2]) | (ciph_key->A[3] << 8); + l1s_dsp_com.dsp_ndb_ptr->a_kc[2] = (ciph_key->A[4]) | (ciph_key->A[5] << 8); + l1s_dsp_com.dsp_ndb_ptr->a_kc[3] = (ciph_key->A[6]) | (ciph_key->A[7] << 8); #endif } @@ -1047,7 +1000,7 @@ if(SWH_flag) { l1s_dsp_com.dsp_db_common_w_ptr->d_swh_ctrl_db |= (0x01<< B_SWH_DB); - } + } } else { @@ -1152,7 +1105,7 @@ } // write dsp tasks..... - #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39) + #if (DSP >= 33) l1s_dsp_com.dsp_ndb_ptr->d_dsp_page = (API) dsp_task; #else l1s_dsp_com.dsp_param_ptr->d_dsp_page = (API) dsp_task; @@ -1161,8 +1114,10 @@ // Enable frame IT on next TDMA l1dmacro_set_frame_it(); + #if (DSP >= 38) // DSP CPU load measurement - write logic (provide TDMA frame number to DSP) (*((volatile UWORD16 *)(DSP_CPU_LOAD_MCU_W_TDMA_FN))) = (API)l1s.actual_time.fn_mod42432; + #endif #endif // NOT_SIMULATION } @@ -1511,8 +1466,9 @@ /*-------------------------------------------------------*/ void l1dtpu_serv_rx_nb(UWORD16 radio_freq, WORD8 agc, UWORD8 lna_off, UWORD32 synchro_serv,UWORD32 new_offset,BOOL change_offset, - UWORD8 adc_active, UWORD8 csf_filter_choice + UWORD8 adc_active #if(RF_FAM == 61) + , UWORD8 csf_filter_choice , UWORD8 if_ctl #endif #if (NEW_SNR_THRESHOLD == 1) @@ -1580,7 +1536,11 @@ ); #endif /* RF_FAM == 61*/ #else /* L1_MADC_ON == 1 */ + #if (RF_FAM == 61) l1dmacro_rx_cont (FALSE, radio_freq,csf_filter_choice); + #else + l1dmacro_rx_cont (FALSE, radio_freq); + #endif #endif //TBD Danny New MAcro for Cont Tx reqd, to use only External Trigger else @@ -1594,7 +1554,11 @@ ); // RX window for NB. #endif /* RF_FAM == 61*/ #else /* L1_MADC_ON == 1*/ - l1dmacro_rx_nb (radio_freq, csf_filter_choice); // RX window for NB. + #if (RF_FAM == 61) + l1dmacro_rx_nb (radio_freq, csf_filter_choice); // RX window for NB. + #else + l1dmacro_rx_nb (radio_freq); // RX window for NB. + #endif #endif #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3)) @@ -1713,8 +1677,10 @@ ) { UWORD32 offset_neigh; +#if (RF_FAM == 61) // By default we choose the hardware filter for neighbour Normal Bursts UWORD8 csf_filter_choice = L1_SAIC_HARDWARE_FILTER; +#endif #if TESTMODE if (!l1_config.agc_enable) @@ -1750,7 +1716,11 @@ ) ; // RX window for NB. #endif /* RF_FAM == 61*/ #else /* L1_MADC_ON == 1*/ - l1dmacro_rx_nb (radio_freq, csf_filter_choice); // RX window for NB. + #if (RF_FAM == 61) + l1dmacro_rx_nb (radio_freq, csf_filter_choice); // RX window for NB. + #else + l1dmacro_rx_nb (radio_freq); // RX window for NB. + #endif #endif // Restore offset with serving value.