void multiple_sim_test() { kal_uint32 testIndex = 0; sim_MT6302_init(); init_all_cb2(); while(1){ switch( (testIndex % SIM_TEST_FUNCTION_NUMBER_MAX)){ case 0: sim_test_function_sim3(); break; case 1: sim_test_reset_phone(SIM_ICC_APPLICATION_PHONE1); break; case 2: sim_test_reset_phone(SIM_ICC_APPLICATION_PHONE2); break; case 3: sim_test_phone_selectGSM(SIM_ICC_APPLICATION_PHONE1); break; case 4: sim_test_phone_selectGSM(SIM_ICC_APPLICATION_PHONE1); break; default: ASSERT(0); } testIndex ++; kal_sleep_task(20); } }
/* * FUNCTION * Drv_Init_Phase2 * * DESCRIPTION * This function is the NFB phase2 (Secondary ROM) initial function for * all device drivers. * This function is called once to initialize the device driver. * * CALLS * * PARAMETERS * None * * RETURNS * None * * GLOBALS AFFECTED * external_global * * NOTE XXX * All sub functions reference by this function should be placed on * Secondary ROM for NFB projects. */ void Drv_Init_Phase2(void) { DCL_HANDLE uart_handle; #ifdef __USB_COM_PORT_ENABLE__ DCL_CTRL_DATA_T data; #endif /*__USB_COM_PORT_ENABLE__*/ #ifndef DRV_RTC_NOT_EXIST DCL_HANDLE rtc_handler; #endif /*DRV_RTC_NOT_EXIST*/ #if defined(IC_BURNIN_TEST) || defined(DRV_MISC_GPT1_AS_OS_TICK) /*AB: Enable GPT1 for OS tick in the burn-in test load*/ extern void GPT_init(kal_uint8 timerNum, void (*GPT_Callback)(void)); extern void GPT_ResetTimer(kal_uint8 timerNum,kal_uint16 countValue,kal_bool autoReload); extern void GPT_Start(kal_uint8 timerNum); GPT_init(1, INT_Timer_Interrupt); GPT_ResetTimer(1, 4, KAL_TRUE); GPT_Start(1); #endif //IC_BURNIN_TEST //#ifdef __SWDBG_SUPPORT__ // UART_Register(uart_port_swdbg, UART_TYPE, (UartDriver_strcut *)&swdbgdrv); //#endif /* __SWDBG_SUPPORT__ */ #ifdef __USB_COM_PORT_ENABLE__ print_bootup_trace_enter(SST_INIT_DRV2_USB2UART); uart_handle = DclSerialPort_Open(uart_port_usb, 0); DclSerialPort_RegisterCallback(uart_handle, &USB2Uart_Drv_Handler); #if defined(__USB_MULTIPLE_COMPORT_SUPPORT__) uart_handle = DclSerialPort_Open(uart_port_usb2, 0); DclSerialPort_RegisterCallback(uart_handle, &USB2Uart_Drv_Handler); #if defined (__USB_MODEM_CARD_SUPPORT__) uart_handle = DclSerialPort_Open(uart_port_usb3, 0); DclSerialPort_RegisterCallback(uart_handle, &USB2Uart_Drv_Handler); #endif #endif DclSerialPort_Control(uart_handle,SIO_CMD_INIT,&data);// Initialization print_bootup_trace_exit(SST_INIT_DRV2_USB2UART); #endif /*__USB_COM_PORT_ENABLE__*/ //#if defined(__IRDA_SUPPORT__) && !defined(__MEUT__) && !defined(__MEIT__) /*TY adds this 2004/10/27*/ /* Register UART API */ // UART_Register(uart_port_irda, IRDA_TYPE, &ircomm_uart_api); //#endif #if defined(__BTMTK__) && (defined(__BT_SPP_PROFILE__) || defined(__BT_HFG_PROFILE__)) { kal_uint16 i; for(i = (kal_uint16)start_of_virtual_port; i < (kal_uint16)end_of_virtual_port + 1; i++) { uart_handle = DclSerialPort_Open((DCL_DEV)i, 0); DclSerialPort_RegisterCallback(uart_handle, &SPPA_Uart_Drv_Handler); } } #elif defined __CMUX_SUPPORT__ { kal_uint16 i; for(i = (kal_uint16)start_of_virtual_port; i < (kal_uint16)end_of_virtual_port + 1; i++) { uart_handle = DclSerialPort_Open((DCL_DEV)i, 0); DclSerialPort_RegisterCallback(uart_handle, &CmuxUart_Drv_Handler); } } #endif #ifndef DRV_KBD_NOT_EXIST print_bootup_trace_enter(SST_INIT_DRV2_KBD); DclSKBD_Initialize(); print_bootup_trace_exit(SST_INIT_DRV2_KBD); #endif /*DRV_KBD_NOT_EXIST*/ #ifndef DRV_RTC_NOT_EXIST print_bootup_trace_enter(SST_INIT_DRV2_RTCSW); rtc_handler = DclRTC_Open(DCL_RTC,FLAGS_NONE); DclRTC_Control(rtc_handler, RTC_CMD_INIT_TC_AL_INTR, (DCL_CTRL_DATA_T *)NULL); print_bootup_trace_exit(SST_INIT_DRV2_RTCSW); #endif /*DRV_RTC_NOT_EXIST*/ #ifdef __SIM_DRV_MULTI_DRV_ARCH__ print_bootup_trace_enter(SST_INIT_DRV2_SIM); DclSIM_Initialize(); print_bootup_trace_exit(SST_INIT_DRV2_SIM); #endif #if (defined( DRV_MULTIPLE_SIM) && (!defined(DRV_2_SIM_CONTROLLER))) print_bootup_trace_enter(SST_INIT_DRV2_SIMMT6302); sim_MT6302_init(); print_bootup_trace_exit(SST_INIT_DRV2_SIMMT6302); #endif #if (defined(__MSDC_MS__) || defined(__MSDC_SD_MMC__) || defined (__MSDC_MSPRO__)) print_bootup_trace_enter(SST_INIT_DRV2_MSDC); #if !defined(DCL_MSDC_INTERFACE) MSDC_Initialize(); #else DclSD_Initialize(); #endif//!defined(DCL_MSDC_INTERFACE) print_bootup_trace_exit(SST_INIT_DRV2_MSDC); #if defined(__MSDC2_SD_MMC__) || defined(__MSDC2_SD_SDIO__) print_bootup_trace_enter(SST_INIT_DRV2_MSDC2); #if !defined(DCL_MSDC_INTERFACE) MSDC_Initialize2(); #endif//!defined(DCL_MSDC_INTERFACE) print_bootup_trace_exit(SST_INIT_DRV2_MSDC2); #endif//defined(__MSDC2_SD_MMC__) || defined(__MSDC2_SD_SDIO__) #endif//(defined(__MSDC_MS__) || defined(__MSDC_SD_MMC__) || defined (__MSDC_MSPRO__)) #ifdef IC_MODULE_TEST IC_ModuleTest_Start(); #endif /*IC_MODULE_TEST*/ print_bootup_trace_enter(SST_INIT_DRV2_EINTSWDBNC); EINT_SW_Debounce_Init(); print_bootup_trace_exit(SST_INIT_DRV2_EINTSWDBNC); #ifdef MT6218B/*only 6218B has this */ GCU_Disable_ReverseBit(); #endif #ifdef __SWDBG_SUPPORT__ /* initialize SWDBG */ print_bootup_trace_enter(SST_INIT_DRV2_SWDBG); swdbg_init(); print_bootup_trace_exit(SST_INIT_DRV2_SWDBG); #endif /* __SWDBG_SUPPORT__ */ /* Cipher/Hash engine initialize */ print_bootup_trace_enter(SST_INIT_DRV2_CHE); che_hw_init(); print_bootup_trace_exit(SST_INIT_DRV2_CHE); /* ISP/Camera initialize */ #if defined(ISP_SUPPORT) print_bootup_trace(SST_INIT_DRV2_CIS_ENTER); #if defined(__MM_DCM_SUPPORT__) DCM_Load(DYNAMIC_CODE_COMPRESS_CAMCAL, NULL, NULL); #endif CalInit(); #if defined(__MM_DCM_SUPPORT__) DCM_Unload(DYNAMIC_CODE_COMPRESS_CAMCAL); #endif print_bootup_trace(SST_INIT_DRV2_CIS_EXIT); #endif #ifdef __WIFI_SUPPORT__ print_bootup_trace_enter(SST_INIT_DRV2_WN); wndrv_HWinit(); print_bootup_trace_exit(SST_INIT_DRV2_WN); #endif //#if (defined(_USE_SCCB_V2_DRIVER_)) #if defined(DRV_I2C_25_SERIES) print_bootup_trace_enter(SST_INIT_DRV2_I2C); DclSI2C_Initialize(); print_bootup_trace_exit(SST_INIT_DRV2_I2C); #endif // PXS is init at phase2 because it is external devices // Currently, do NOT think it should be put in phase1 #if defined(__PXS_ENABLE__) && !defined(IC_MODULE_TEST) && !defined(IC_BURNIN_TEST) DclPXS_Initialize(); #endif // #if defined(__PXS_ENABLE__) && !defined(IC_MODULE_TEST) && !defined(IC_BURNIN_TEST) #if defined(__L1_STANDALONE__)&&defined(__CLKG_DEFINE__)&&!defined(IC_BURNIN_TEST) mm_disable_power(MMPWRMGR_LCD); #endif #ifdef CAS_SMD_SUPPORT print_bootup_trace_enter(SST_INIT_DRV2_ICC); DalIccInit(); print_bootup_trace_exit(SST_INIT_DRV2_ICC); #endif #if 0 // Init BTIF_HWInit_VFIFO(); in bluetooth module #if defined(__BTMODULE_MT6236__) /* under construction !*/ /* under construction !*/ /* under construction !*/ #elif defined(__BTMODULE_MT6256__) || defined(__BTMODULE_MT6276__) /* under construction !*/ #endif /* under construction !*/ #endif // 0 #if defined(__HW_PFC_SUPPORT__) print_bootup_trace_enter(SST_INIT_DRV2_PFC); DclPFC_Initialize(); print_bootup_trace_exit(SST_INIT_DRV2_PFC); #endif //#if defined(__HW_PFC_SUPPORT__) #ifdef DRV_HIF_SUPPORT hif_init(); #endif #ifdef DRV_SPI_SUPPORT spi_init(); #endif #if defined(TOUCH_PANEL_SUPPORT) DclSTS_Initialize();//always call --- remove the init function from touch_panel_main() #endif #if defined(MOTION_SENSOR_SUPPORT) print_bootup_trace_enter(SST_INIT_DRV2_MSENS); motion_sensor_init(); print_bootup_trace_exit(SST_INIT_DRV2_MSENS); #endif brt_drv_init(); }