1.模块驱动加载调整
This commit is contained in:
parent
807289b22f
commit
7fe09d9b75
|
@ -32,6 +32,10 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static char driver_path_prefix[64] = "/etc/lib/modules/4.19.91";
|
static char driver_path_prefix[64] = "/etc/lib/modules/4.19.91";
|
||||||
|
//GobiNet:rndis_host.ko,drv_gobi_net.ko
|
||||||
|
//ECM:usbnet.ko,rndis_host.ko,cdc_ether.ko
|
||||||
|
//ACM:
|
||||||
|
//QMI:qmi_wwan.ko,cdc-wdm.ko,rndis_host.ko,
|
||||||
static char* usb_host_drivers[] = {
|
static char* usb_host_drivers[] = {
|
||||||
"kernel/drivers/usb/common/usb-common.ko",
|
"kernel/drivers/usb/common/usb-common.ko",
|
||||||
"kernel/drivers/usb/core/usbcore.ko",
|
"kernel/drivers/usb/core/usbcore.ko",
|
||||||
|
@ -39,13 +43,13 @@ static char* usb_host_drivers[] = {
|
||||||
"kernel/drivers/net/mii.ko",
|
"kernel/drivers/net/mii.ko",
|
||||||
"kernel/drivers/net/usb/usbnet.ko",
|
"kernel/drivers/net/usb/usbnet.ko",
|
||||||
"extra/net/GobiNet/drv_gobi_net.ko",
|
"extra/net/GobiNet/drv_gobi_net.ko",
|
||||||
"kernel/drivers/net/usb/cdc_ether.ko",
|
// "kernel/drivers/net/usb/cdc_ether.ko",
|
||||||
"kernel/drivers/net/usb/rndis_host.ko",
|
// "kernel/drivers/net/usb/rndis_host.ko",
|
||||||
"kernel/drivers/usb/serial/usbserial.ko",
|
"kernel/drivers/usb/serial/usbserial.ko",
|
||||||
"kernel/drivers/usb/serial/usb_wwan.ko",
|
"kernel/drivers/usb/serial/usb_wwan.ko",
|
||||||
"kernel/drivers/usb/serial/option.ko",
|
"kernel/drivers/usb/serial/option.ko",
|
||||||
"kernel/drivers/usb/class/cdc-wdm.ko",
|
// "kernel/drivers/usb/class/cdc-wdm.ko",
|
||||||
"kernel/drivers/net/usb/qmi_wwan.ko",
|
// "kernel/drivers/net/usb/qmi_wwan.ko",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -126,6 +130,7 @@ static BOOL System_InsmodUsb(BOOL isHost)
|
||||||
char* driver_path = NULL;
|
char* driver_path = NULL;
|
||||||
UINT8 cnt = 0;
|
UINT8 cnt = 0;
|
||||||
char cmd[256] = {'\0'};
|
char cmd[256] = {'\0'};
|
||||||
|
vos_perf_list_mark(__func__, __LINE__, 0);
|
||||||
|
|
||||||
if(isHost){
|
if(isHost){
|
||||||
|
|
||||||
|
@ -136,6 +141,9 @@ static BOOL System_InsmodUsb(BOOL isHost)
|
||||||
is_usb_host_driver_inserted = TRUE;
|
is_usb_host_driver_inserted = TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
// #if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
// sf_usb_mux_s(1);
|
||||||
|
// #endif
|
||||||
usb_drivers = usb_host_drivers;
|
usb_drivers = usb_host_drivers;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -145,6 +153,9 @@ static BOOL System_InsmodUsb(BOOL isHost)
|
||||||
memset(driver_path_prefix, '\0', sizeof(driver_path_prefix));
|
memset(driver_path_prefix, '\0', sizeof(driver_path_prefix));
|
||||||
snprintf(driver_path_prefix, sizeof(driver_path_prefix), "/lib/modules/4.19.91");
|
snprintf(driver_path_prefix, sizeof(driver_path_prefix), "/lib/modules/4.19.91");
|
||||||
usb_drivers = usb_dev_drivers;
|
usb_drivers = usb_dev_drivers;
|
||||||
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
sf_usb_mux_s(0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
while(usb_drivers[cnt++])
|
while(usb_drivers[cnt++])
|
||||||
|
@ -161,25 +172,27 @@ static BOOL System_InsmodUsb(BOOL isHost)
|
||||||
memset(cmd, '\0', sizeof(cmd));
|
memset(cmd, '\0', sizeof(cmd));
|
||||||
snprintf(cmd, sizeof(cmd), "insmod %s/%s", driver_path_prefix, driver_path);
|
snprintf(cmd, sizeof(cmd), "insmod %s/%s", driver_path_prefix, driver_path);
|
||||||
//DBG_DUMP("%s\n", cmd);
|
//DBG_DUMP("%s\n", cmd);
|
||||||
printf("[%s:%d] %s\n", __FUNCTION__, __LINE__, cmd);
|
// printf("[%s:%d] %s\n", __FUNCTION__, __LINE__, cmd);
|
||||||
system(cmd);
|
system(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// system("mdev -s");
|
||||||
if(isHost == FALSE){
|
if(isHost == FALSE){
|
||||||
#if HUNTING_CAMERA_MCU == ENABLE
|
// #if HUNTING_CAMERA_MCU == ENABLE
|
||||||
//sf_set_msdc_clk();
|
// //sf_set_msdc_clk();
|
||||||
sf_usb_mux_s(0);
|
// sf_usb_mux_s(0);
|
||||||
vos_util_delay_ms(200);
|
// vos_util_delay_ms(200);
|
||||||
#endif
|
// #endif
|
||||||
|
vos_perf_list_mark(__func__, __LINE__, 0);
|
||||||
|
|
||||||
is_usb_dev_driver_inserted = TRUE;
|
is_usb_dev_driver_inserted = TRUE;
|
||||||
return System_WaitUsbDev();
|
return System_WaitUsbDev();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
#if HUNTING_CAMERA_MCU == ENABLE
|
// #if HUNTING_CAMERA_MCU == ENABLE
|
||||||
sf_usb_mux_s(1);
|
// sf_usb_mux_s(1);
|
||||||
#endif
|
// #endif
|
||||||
|
vos_perf_list_mark(__func__, __LINE__, 0);
|
||||||
|
|
||||||
is_usb_host_driver_inserted = TRUE;
|
is_usb_host_driver_inserted = TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -290,7 +303,10 @@ void System_OnUsbInit(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//force check USB connect type
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
sf_usb_insmod_start();
|
||||||
|
#else
|
||||||
|
// force check USB connect type
|
||||||
if (GxUSB_GetIsUSBPlug()) {
|
if (GxUSB_GetIsUSBPlug()) {
|
||||||
|
|
||||||
#if (HW_S530 == ENABLE) && (HUNTING_CAMERA_MCU == ENABLE)
|
#if (HW_S530 == ENABLE) && (HUNTING_CAMERA_MCU == ENABLE)
|
||||||
|
@ -302,8 +318,10 @@ void System_OnUsbInit(void)
|
||||||
GxUSB_SetChargerType(FALSE);
|
GxUSB_SetChargerType(FALSE);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
//System_InsmodUsb(TRUE); /* insmod usb host ko */
|
// System_InsmodUsb(TRUE); /* insmod usb host ko */
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TM_BOOT_END("usb", "init");
|
TM_BOOT_END("usb", "init");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,5 +546,26 @@ BOOL USB_GetIsMsdcNvt(void)
|
||||||
#endif
|
#endif
|
||||||
//#NT#2016/06/03#Niven Cho -end
|
//#NT#2016/06/03#Niven Cho -end
|
||||||
}
|
}
|
||||||
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
void* sf_usb_insmod_thread(void *arg)
|
||||||
|
{
|
||||||
|
//force check USB connect type
|
||||||
|
if (GxUSB_GetIsUSBPlug()) {
|
||||||
|
|
||||||
|
#if (HW_S530 == ENABLE) && (HUNTING_CAMERA_MCU == ENABLE)
|
||||||
|
sf_sys_status_led_set(SF_LED_SYS_STATE_USB_IN);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
System_InsmodUsb(FALSE); /* insmod usb dev ko */
|
||||||
|
GxUSB_UpdateConnectType();
|
||||||
|
GxUSB_SetChargerType(FALSE);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
System_InsmodUsb(TRUE); /* insmod usb host ko */
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user