int BL_MSDC_Init(void) { // enable GPIO for MSDC #if defined(MT6235) || defined(MT6235B) DRV_SetBits(0x80021800, 0x5540); DRV_SetBits(0x80021900, 0x55); #elif defined(MT6236) DRV_SetBits(0x801D0610, 0x3); // MCOINS: b'11 DRV_SetBits(0x801D0200, 0xFD00); // GPIO8 PU SEL (b'8) #elif defined(MT6253) DRV_SetBits(0x80020210, 0x5554); #elif defined(MT6252) // // Patch the offset and arguments. The macro only can read/write 16bit data. // //DRV_ClearBits(0x800201D0, 0xFFFF0000); //DRV_SetBits(0x800201D0, 0x11110000); DRV_ClearBits(0x800201D2, 0xFFFF); DRV_SetBits(0x800201D2, 0x1111); #elif defined(MT6268) DRV_ClearBits(0x84021A00, 0xFF00); DRV_SetBits(0x84021A00, 0x5500); #elif defined(MT6276_S01) DRV_ClearBits(0x810A2200, 0x7FC0); DRV_SetBits(0x810A2200, 0x1240); DRV_ClearBits(0x810A2300, 0x0FFF); DRV_SetBits(0x810A2300, 0x0249); #elif defined(MT6276_S00) #error Not support MT6276 E1! #elif defined(MT6251_S01) DRV_ClearBits(0x80020200, 0x0FFF); DRV_SetBits(0x80020200, 0x0111); #elif defined(MT6251_S00) #error Not support MT6251 E1! #elif defined(MT6255) DRV_ClearBits(0x801D0750, 0x00F0); #elif defined(MT6250) DRV_ClearBits(0xA0020c32, 0xFF00); DRV_SetBits(0xA0020c32, 0x1100); // CLK and DAT0 DRV_ClearBits(0xA0020c40, 0x000F); DRV_SetBits(0xA0020c40, 0x0001); // CMD #endif DclSD_Initialize(); //MSDC_Initialize(); return 0; }
DRV_STATUS_CODE DRV_SD_Init(void) { #if (defined(__UBL__) || defined(__FUE__)) && defined(MT6256_S00) // enable GPIO for MSDC DRV_WriteReg16(0x701D0610, 0x1110); DRV_WriteReg16(0x701D0620, 0x0111); // enable GPT3 DRV_WriteReg32(0x7007001C, 1); #endif #if !defined(DCL_MSDC_INTERFACE) MSDC_Initialize(); #else DclSD_Initialize(); #endif//!defined(DCL_MSDC_INTERFACE) return DRV_SUCCESS; }
/* * 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(); }