wifi: change usb wifi fw load [1/1]
authorRongjun Chen <rongjun.chen@amlogic.com>
Thu, 20 Dec 2018 08:21:30 +0000 (16:21 +0800)
committerRongjun Chen <rongjun.chen@amlogic.com>
Fri, 21 Dec 2018 05:12:57 +0000 (13:12 +0800)
PD#SWPL-3082

Problem:
dumpsys usb fail with ap62x8

Solution:
change the usb fw load

Verify:
verify by r311

Change-Id: I36785ea060ec0e4abcc9e19fc58796188760b906
Signed-off-by: Rongjun Chen <rongjun.chen@amlogic.com>
bcmdhd.1.579.77.41.1.cn/Makefile
bcmdhd.1.579.77.41.1.cn/dbus.c
bcmdhd.1.579.77.41.1.cn/dhd_gpio.c
bcmdhd.100.10.315.x/Makefile
bcmdhd.100.10.315.x/dbus.c
bcmdhd.100.10.315.x/dhd_gpio.c

index 5669d5cc665174be13ccb75c8cf1e1c354479302..352b9adc9e4004f30ea039131aa7284e50e6021c 100644 (file)
@@ -77,7 +77,7 @@ ifneq ($(CONFIG_BCMDHD_USB),)
 DHDCFLAGS += -DUSBOS_TX_THREAD -DBCMDBUS -DBCMTRXV2 -DDBUS_USB_LOOPBACK   \
        -DBDC
 DHDCFLAGS += -DBCM_REQUEST_FW -DEXTERNAL_FW_PATH
-#DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS))
+DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS))
 ifneq ($(CONFIG_BCMDHD_CUSB),)
        DHDCFLAGS += -DBCMUSBDEV_COMPOSITE
        DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS))
index 7c77bbe51f0231ef21e333ded51c076a47cdb98c..beeecd7cac71358a0b544aeef488d28c8827144f 100644 (file)
@@ -644,10 +644,10 @@ dbus_get_fw_nvram(dhd_bus_t *dhd_bus, char *pfw_path, char *pnv_path)
                bcmerror = DBUS_ERR_NVRAM;
                goto err;
        }
-       if (nv_image)
+       if (nv_image) {
                dhd_os_close_image(nv_image);
-
-       nv_image = NULL;
+               nv_image = NULL;
+       }
 
        /* For Get first block of fw to calculate total_len */
        file_exists = ((pfw_path != NULL) && (pfw_path[0] != '\0'));
index d2b53b18008b23b0a677852840a835b5383e5426..a120bd3742985a2c79e2cad053196aacecfae896 100644 (file)
@@ -30,6 +30,7 @@ static int gpio_wl_host_wake = -1; // WL_HOST_WAKE is output pin of WLAN module
 extern int wifi_irq_trigger_level(void);
 extern u8 *wifi_get_mac(void);
 #endif
+extern void set_usb_bt_power(int is_power);
 extern  void sdio_reinit(void);
 extern void extern_wifi_set_enable(int is_on);
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
@@ -56,12 +57,20 @@ dhd_wlan_set_power(int on
                        }
                }
 #ifdef CUSTOMER_HW_AMLOGIC
+#ifdef BCMSDIO
                extern_wifi_set_enable(0);
                mdelay(200);
                extern_wifi_set_enable(1);
                mdelay(200);
 //             sdio_reinit();
 #endif
+#ifdef BCMDBUS
+               set_usb_bt_power(0);
+               mdelay(200);
+               set_usb_bt_power(1);
+               mdelay(200);
+#endif
+#endif
 #if defined(BUS_POWER_RESTORE)
 #if defined(BCMSDIO)
                if (adapter->sdio_func && adapter->sdio_func->card && adapter->sdio_func->card->host) {
@@ -112,8 +121,14 @@ dhd_wlan_set_power(int on
                        }
                }
 #ifdef CUSTOMER_HW_AMLOGIC
+#ifdef BCMSDIO
                extern_wifi_set_enable(0);
                mdelay(200);
+#endif
+#ifdef BCMDBUS
+               set_usb_bt_power(0);
+               mdelay(200);
+#endif
 #endif
        }
 
index f0839b05d30c5d036192b2d297cdef4bd1292c4b..3c964b1cb2b6e8fbbb97dfb0c99b35e2aec7fcbc 100644 (file)
@@ -74,7 +74,7 @@ ifneq ($(CONFIG_BCMDHD_USB),)
 DHDCFLAGS += -DUSBOS_TX_THREAD -DBCMDBUS -DBCMTRXV2 -DDBUS_USB_LOOPBACK   \
        -DBDC
 DHDCFLAGS += -DBCM_REQUEST_FW -DEXTERNAL_FW_PATH
-#DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS))
+DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS))
 ifneq ($(CONFIG_BCMDHD_CUSB),)
        DHDCFLAGS += -DBCMUSBDEV_COMPOSITE
        DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS))
index 39feab343bd509652cb0450aecb87dad2f78e419..4777a5bf7f91aac38cf3b9560daff64a2fdb2c66 100644 (file)
@@ -644,8 +644,10 @@ dbus_get_fw_nvram(dhd_bus_t *dhd_bus, char *pfw_path, char *pnv_path)
                bcmerror = DBUS_ERR_NVRAM;
                goto err;
        }
-       if (nv_image)
+       if (nv_image) {
                dhd_os_close_image1(dhd_bus->dhd, nv_image);
+               nv_image = NULL;
+       }
 
        /* For Get first block of fw to calculate total_len */
        file_exists = ((pfw_path != NULL) && (pfw_path[0] != '\0'));
index 54d02d41cabd09e833106eab1c01059b42726b1c..3bd8c59adbba74de8ece85fdb88156c9dad06d08 100644 (file)
@@ -31,6 +31,7 @@ extern int wifi_irq_trigger_level(void);
 extern u8 *wifi_get_mac(void);
 #endif
 extern  void sdio_reinit(void);
+extern void set_usb_bt_power(int is_power);
 extern void extern_wifi_set_enable(int is_on);
 extern void pci_remove_reinit(unsigned int vid, unsigned int pid, int delBus);
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
@@ -64,6 +65,12 @@ dhd_wlan_set_power(int on
                mdelay(200);
 //             sdio_reinit();
 #endif
+#ifdef BCMDBUS
+               set_usb_bt_power(0);
+               mdelay(200);
+               set_usb_bt_power(1);
+               mdelay(200);
+#endif
 #endif
 #if defined(BUS_POWER_RESTORE)
 #if defined(BCMSDIO)
@@ -115,8 +122,14 @@ dhd_wlan_set_power(int on
                        }
                }
 #ifdef CUSTOMER_HW_AMLOGIC
-//             extern_wifi_set_enable(0);
-//             mdelay(200);
+#ifdef BCMSIDO
+               extern_wifi_set_enable(0);
+               mdelay(200);
+#endif
+#ifdef BCMDBUS
+               set_usb_bt_power(0);
+               mdelay(200);
+#endif
 #endif
        }