AP6236 WiFi模块调试记录

AP6236 WiFi模块调试记录

Platform: RK3368
OS: Android 6.0
Kernel: 3.10.0

文章目录

  • AP6236 WiFi模块调试记录
    • 内核驱动移植
      • 1. 更新驱动
        • 1.1 修改驱动代码,适配rk平台
      • 2. 修改RK平台代码
      • 3 修改dts文件中的wifi配置,修改wireless-wlan节点里面:
    • Android系统适配
    • 遇到的问题
      • 1. 蓝牙打不开
      • 2. 在系统设置->WLAN中打开WiFi自动关闭
      • 3. sdmmc通信报错
      • 4. 32k晶振不起振
      • 5. Wifi信号差

内核驱动移植

1. 更新驱动

先将供应商给的最新wifi驱动更新到kernel中:drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/

1.1 修改驱动代码,适配rk平台

修改Makefile中的WiFi配置:

diff --git a/Makefile b/Makefile
index 5beada4..fdd9e22 100644
--- a/Makefile
+++ b/Makefile
@@ -2,16 +2,17 @@
 # 1. WL_IFACE_COMB_NUM_CHANNELS must be added if Android version is 4.4 with Kernel version 3.0~3.4,
 #    otherwise please remove it.
 
-#CONFIG_BCMDHD := m
-#CONFIG_BCMDHD_SDIO := y
+CONFIG_BCMDHD := y
+CONFIG_BCMDHD_SDIO := y
 #CONFIG_BCMDHD_PCIE := y
 #CONFIG_BCMDHD_USB := y
 
-#CONFIG_BCMDHD_OOB := y
+CONFIG_BCMDHD_OOB := y
 #CONFIG_BCMDHD_CUSB := y
 CONFIG_BCMDHD_PROPTXSTATUS := y
+#CONFIG_BCMDHD_AG := y
 #CONFIG_DHD_USE_STATIC_BUF := y
-#CONFIG_VTS_SUPPORT := y
+CONFIG_VTS_SUPPORT := y
 
 CONFIG_MACH_PLATFORM := y
 #CONFIG_BCMDHD_DTS := y
@@ -25,7 +26,9 @@ DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER                 \
        -DMULTIPLE_SUPPLICANT -DTSQ_MULTIPLIER -DMFP                          \
        -DWL_EXT_IAPSTA                                                       \
        -DENABLE_INSMOD_NO_FW_LOAD                                            \
-       -Idrivers/net/wireless/bcmdhd -Idrivers/net/wireless/bcmdhd/include
+       -Idrivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd                    \
+       -Idrivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/include
+
 
 DHDOFILES = aiutils.o siutils.o sbutils.o bcmutils.o bcmwifi_channels.o   \
        dhd_linux.o dhd_linux_platdev.o dhd_linux_sched.o dhd_pno.o           \

修改dhd_gpio.c添加WiFi模块电源控制和sdio卡检测:

diff --git a/dhd_gpio.c b/dhd_gpio.c
index 0819d0c..25a44ba 100644
--- a/dhd_gpio.c
+++ b/dhd_gpio.c
@@ -2,6 +2,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef CUSTOMER_HW_PLATFORM
 #include 
@@ -64,6 +65,7 @@ dhd_wlan_set_power(int on
                }
 #endif /* BCMPCIE */
 #endif /* BUS_POWER_RESTORE */
+               rockchip_wifi_power(1);
                /* Lets customer power to get stable */
                mdelay(100);
        } else {
@@ -92,6 +94,7 @@ dhd_wlan_set_power(int on
                                return -EIO;
                        }
                }
+               rockchip_wifi_power(0);
        }
 
        return err;
@@ -116,6 +119,7 @@ static int dhd_wlan_set_carddetect(int present)
 #elif defined(BCMPCIE)
                printf("======== Card detection to detect PCIE card! ========\n");
 #endif
+               rockchip_wifi_set_carddetect(1);
        } else {
 #if defined(BCMSDIO)
                printf("======== Card detection to remove SDIO card! ========\n");
@@ -125,6 +129,7 @@ static int dhd_wlan_set_carddetect(int present)
 #elif defined(BCMPCIE)
                printf("======== Card detection to remove PCIE card! ========\n");
 #endif
+               rockchip_wifi_set_carddetect(0);
        }
 #endif /* BUS_POWER_RESTORE */
 
@@ -157,6 +162,7 @@ static int dhd_wlan_get_mac_addr(unsigned char *buf)
                bcopy(macpad, buf+6, sizeof(macpad));
        }
 #endif /* EXAMPLE_GET_MAC_VER2 */
+       err = rockchip_wifi_mac_addr(buf);
 
        return err;
 }

修改dhd_linux.c添加WiFi驱动模块加载入口和指定WiFi固件路径:

diff --git a/dhd_linux.c b/dhd_linux.c
index 936a6c8..c63333f 100644
--- a/dhd_linux.c
+++ b/dhd_linux.c
@@ -481,7 +481,7 @@ static int is_reboot = 0;
 dhd_pub_t      *g_dhd_pub = NULL;
 #endif /* defined (BT_OVER_SDIO) */
 
-atomic_t exit_in_progress = ATOMIC_INIT(0);
+static atomic_t exit_in_progress = ATOMIC_INIT(0);
 
 typedef struct dhd_if_event {
        struct list_head        list;
@@ -9915,6 +9915,8 @@ int dhd_bus_get_fw_mode(dhd_pub_t *dhdp)
        return dhd_get_fw_mode(dhdp->info);
 }
 
+extern int rkwifi_set_firmware(char *fw, char *nvram);
+
 bool dhd_update_fw_nv_path(dhd_info_t *dhdinfo)
 {
        int fw_len;
@@ -9925,6 +9927,8 @@ bool dhd_update_fw_nv_path(dhd_info_t *dhdinfo)
        const char *nv = NULL;
        const char *clm = NULL;
        const char *conf = NULL;
+       char firmware[100] = {0};
+       char nvram[100] = {0};
 #ifdef DHD_UCODE_DOWNLOAD
        int uc_len;
        const char *uc = NULL;
@@ -9946,11 +9950,16 @@ bool dhd_update_fw_nv_path(dhd_info_t *dhdinfo)
 
        /* set default firmware and nvram path for built-in type driver */
 //     if (!dhd_download_fw_on_driverload) {
+               rkwifi_set_firmware(firmware, nvram);
 #ifdef CONFIG_BCMDHD_FW_PATH
                fw = CONFIG_BCMDHD_FW_PATH;
+#else
+               fw = firmware;
 #endif /* CONFIG_BCMDHD_FW_PATH */
 #ifdef CONFIG_BCMDHD_NVRAM_PATH
                nv = CONFIG_BCMDHD_NVRAM_PATH;
+#else
+               nv = nvram;
 #endif /* CONFIG_BCMDHD_NVRAM_PATH */
 //     }
 
@@ -13276,7 +13285,7 @@ dhd_module_cleanup(void)
        printf("%s: Exit\n", __FUNCTION__);
 }
 
-static void __exit
+static void 
 dhd_module_exit(void)
 {
        atomic_set(&exit_in_progress, 1);
@@ -13285,11 +13294,12 @@ dhd_module_exit(void)
        dhd_destroy_to_notifier_skt();
 }
 
-static int __init
+static int 
 dhd_module_init(void)
 {
        int err;
        int retry = POWERUP_MAX_RETRY;
+       atomic_set(&exit_in_progress, 0);
 
        printf("%s: in %s\n", __FUNCTION__, dhd_version);
 
@@ -13347,7 +13357,46 @@ dhd_reboot_callback(struct notifier_block *this, unsigned long code, void *unuse
        return NOTIFY_DONE;
 }
 
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+static int wifi_init_thread(void *data)
+{
+       dhd_module_init();
+
+       return 0;
+}
+#endif
+
+int rockchip_wifi_init_module_rkwifi(void)
+{
+    printk("=======================================================\n");
+    printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
+    printk("=======================================================\n");
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+       struct task_struct *kthread = kthread_run(wifi_init_thread, NULL, "wifi_init_thread");
+       if (IS_ERR(kthread))
+               pr_err("create wifi_init_thread failed.\n");
+    return 0; 
+#else
+       return dhd_module_init();
+#endif
+}
+
+void rockchip_wifi_exit_module_rkwifi(void)
+{
+    printk("=======================================================\n");
+    printk("== Dis-launching Wi-Fi driver! (Powered by Rockchip) ==\n");
+    printk("=======================================================\n");
+       dhd_module_exit();
+}
 
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rkwifi);
+module_exit(rockchip_wifi_exit_module_rkwifi);
+#else
+EXPORT_SYMBOL(rockchip_wifi_init_module_rkwifi);
+EXPORT_SYMBOL(rockchip_wifi_exit_module_rkwifi);
+#endif
+#if 0
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
 #if defined(CONFIG_DEFERRED_INITCALLS) && !defined(EXYNOS_PCIE_MODULE_PATCH)
 #if defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_SOC_EXYNOS8890) || \
@@ -13370,6 +13419,7 @@ module_init(dhd_module_init);
 
 module_exit(dhd_module_exit);
 
+#endif
 /*
  * OS specific functions required to implement DHD driver in OS independent way
  */

修改dhd_linux_platdev.c,替换中断标志:

diff --git a/dhd_linux_platdev.c b/dhd_linux_platdev.c
index 3c6c171..a71a7d8 100644
--- a/dhd_linux_platdev.c
+++ b/dhd_linux_platdev.c
@@ -172,11 +172,19 @@ void* wifi_platform_get_prealloc_func_ptr(wifi_adapter_info_t *adapter)
 
 int wifi_platform_get_irq_number(wifi_adapter_info_t *adapter, unsigned long *irq_flags_ptr)
 {
+       if (irq_flags_ptr) {
+               *irq_flags_ptr = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE) & IRQF_TRIGGER_MASK;
+       }
+
+       return rockchip_wifi_get_oob_irq();
+
+/*
        if (adapter == NULL)
                return -1;
        if (irq_flags_ptr)
                *irq_flags_ptr = adapter->intr_flags;
        return adapter->irq_num;
+       */
 }
 
 int wifi_platform_set_power(wifi_adapter_info_t *adapter, bool on, unsigned long msec)

2. 修改RK平台代码

添加模块信息:
menuconfig添加AP6236选项,用来适配此wifi模块:

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 10c0979409d..6c14c58909e 100755
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -92,6 +92,10 @@ choice
                bool "AP6234"
                depends on RKWIFI
 
+       config AP6236
+               bool "AP6236"
+               depends on RKWIFI
+
        config AP6330
                bool "AP6330"
                depends on RKWIFI

添加AP6236的固件所在路径:

diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c b/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c
index db94e7e79f6..562e1c91268 100644
--- a/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c
+++ b/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c
@@ -62,6 +62,11 @@ if (chip == WIFI_AP6234) {
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6234.txt");
 }
 
+if (chip == WIFI_AP6236) {
+    sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_bcm43436b0.bin");
+       sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_ap6236.txt");
+}
+
 if (chip == WIFI_AP6441) {
     sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_bcm43341b0_ag.bin");
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6441.txt");

diff --git a/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c b/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c
index 2746daf3ae7..7fb560d08e6 100755
--- a/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c
+++ b/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c
@@ -46,7 +46,12 @@ static ssize_t wifi_chip_read(struct class *cls, struct class_attribute *attr, c
            count = sprintf(_buf, "%s", "AP6234");
            printk("Current WiFi chip is AP6234.\n");
        }
-       
+
+       if(type == WIFI_AP6236) {
+           count = sprintf(_buf, "%s", "AP6236");
+           printk("Current WiFi chip is AP6236.\n");
+       }
+
        if(type == WIFI_AP6330) {
            count = sprintf(_buf, "%s", "AP6330");
            printk("Current WiFi chip is AP6330.\n");

diff --git a/include/linux/rfkill-wlan.h b/include/linux/rfkill-wlan.h
index 071f1b86c0b..4bf29511171 100755
--- a/include/linux/rfkill-wlan.h
+++ b/include/linux/rfkill-wlan.h
@@ -49,6 +49,7 @@ enum {
     WIFI_AP6210,
     WIFI_AP6212,
     WIFI_AP6234,
+    WIFI_AP6236,
     WIFI_AP6330,
     WIFI_AP6335,
     WIFI_AP6354,

diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c
index 411dbfba70e..ba041bd10ee 100755
--- a/net/rfkill/rfkill-wlan.c
+++ b/net/rfkill/rfkill-wlan.c
@@ -88,6 +88,8 @@ static const char wlan_name[] =
     #endif
 #elif defined(CONFIG_AP6330)
                "ap6330"
+#elif defined(CONFIG_AP6236)
+               "ap6236"
 #elif defined(CONFIG_AP6476)
                "ap6476"
 #elif defined(CONFIG_AP6493)
@@ -113,6 +115,8 @@ int get_wifi_chip_type(void)
         type = WIFI_AP6181;
     } else if (strcmp(wifi_chip_type_string, "ap6234") == 0) {
         type = WIFI_AP6234;                            
+    } else if (strcmp(wifi_chip_type_string, "ap6236") == 0) {
+        type = WIFI_AP6236;
     } else if (strcmp(wifi_chip_type_string, "ap6330") == 0) {
         type = WIFI_AP6330;
     } else if (strcmp(wifi_chip_type_string, "ap6335") == 0) {

AP6236的蓝牙需要添加串口RTS控制,否则串口不通:

diff --git a/net/rfkill/rfkill-bt.c b/net/rfkill/rfkill-bt.c
index 3df55f92d07..072cacb0e5f 100755
--- a/net/rfkill/rfkill-bt.c
+++ b/net/rfkill/rfkill-bt.c
@@ -97,6 +97,8 @@ static const char bt_name[] =
     #endif
 #elif defined(CONFIG_AP6330)
                "ap6330"
+#elif defined(CONFIG_AP6236)
+                       "ap6236"
 #elif defined(CONFIG_AP6476)
                "ap6476"
 #elif defined(CONFIG_AP6493)
@@ -266,7 +268,7 @@ static int rfkill_rk_set_power(void *data, bool blocked)
        struct rfkill_rk_data *rfkill = data;
     struct rfkill_rk_gpio *poweron = &rfkill->pdata->poweron_gpio;
     struct rfkill_rk_gpio *reset = &rfkill->pdata->reset_gpio;
-#if defined(CONFIG_AP6210) || defined(CONFIG_AP6335)
+#if defined(CONFIG_AP6210) || defined(CONFIG_AP6335) || defined(CONFIG_AP6236)
     struct rfkill_rk_gpio* rts = &rfkill->pdata->rts_gpio;
     struct pinctrl *pinctrl = rfkill->pdata->pinctrl;
 #endif
@@ -307,7 +309,7 @@ static int rfkill_rk_set_power(void *data, bool blocked)
             msleep(20);
                        gpio_direction_output(reset->io, reset->enable);
         }
-#if defined(CONFIG_AP6210) || defined(CONFIG_AP6335)
+#if defined(CONFIG_AP6210) || defined(CONFIG_AP6335) || defined(CONFIG_AP6236)
         if (pinctrl != NULL && gpio_is_valid(rts->io))
         {
             pinctrl_select_state(pinctrl, rts->gpio_state);

3 修改dts文件中的wifi配置,修改wireless-wlan节点里面:

	wireless-wlan {
		compatible = "wlan-platdata";
				rockchip,grf = <&grf>;

				/* wifi_chip_type - wifi chip define
				 * ap6210, ap6330, ap6335
				 * rtl8188eu, rtl8723bs, rtl8723bu
				 * esp8089
				*/
				wifi_chip_type = "ap6236";

		sdio_vref = <3300>; //1800mv or 3300mv

		//keep_wifi_power_on;

		//power_ctrl_by_pmu;
 		//power_pmu_regulator = "rk818_ldo8_reg";
		//power_pmu_enable_level = <1>; //1->HIGH, 0->LOW

		//vref_ctrl_enable;
		//vref_ctrl_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_HIGH>;
 		//vref_pmu_regulator = "rk818_ldo8_reg";
		//vref_pmu_enable_level = <1>; //1->HIGH, 0->LOW

		WIFI,poweren_gpio = <&gpio3 GPIO_A4 GPIO_ACTIVE_HIGH>;
		WIFI,host_wake_irq = <&gpio3 GPIO_A7 GPIO_ACTIVE_LOW>;
		//WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;

		status = "okay";
	};

	wireless-bluetooth {
		compatible = "bluetooth-platdata";

		//wifi-bt-power-toggle;

		uart_rts_gpios = <&gpio2 GPIO_D3 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default","rts_gpio";
		pinctrl-0 = <&uart0_rts>;
		pinctrl-1 = <&uart0_rts_gpio>;

		//BT,power_gpio = <&gpio3 GPIO_A3 GPIO_ACTIVE_HIGH>;
		BT,reset_gpio = <&gpio3 GPIO_D5 GPIO_ACTIVE_HIGH>; //bt_dis
		BT,wake_gpio = <&gpio3 GPIO_A6 GPIO_ACTIVE_HIGH>;
		BT,wake_host_irq = <&gpio3 GPIO_A2 GPIO_ACTIVE_HIGH>;

		status = "okay";
	};

Android系统适配

将wifi的firmware和nvram加到Android源码目录external/wlan_loader,与前面添加的模块信息中的文件名一致,编译时会自动复制到system/etc/firmware/:

firmware/fw_bcm43436b0.bin b/firmware/fw_bcm43436b0.bin
firmware/fw_bcm43436b0_apsta.bin b/firmware/fw_bcm43436b0_apsta.bin
firmware/nvram_ap6236.txt

遇到的问题

1. 蓝牙打不开

日志:

01-21 11:30:01.591  1122  1172 I bt_bluedroid: enable
01-21 11:30:01.592  1122  1173 D bt_stack_manager: event_start_up_stack is bringing up the stack.
01-21 11:30:01.605  1122  1173 I bt_hci  : start_up
01-21 11:30:01.611  1122  1173 D WifiHW  : check_wifi_chip_type_string: AP6236
01-21 11:30:01.611  1122  1173 D bt_vendor: vendor_open load libbt-vendor.so
01-21 11:30:01.622  1122  1173 I bt_vendor: alloc value 0xf3bf9301
01-21 11:30:01.622  1122  1173 I bt_vendor: init
01-21 11:30:01.622  1122  1173 E bt_userial_vendor: /dev/ttyS0 vnd_userial.port_name=libbt-vendor.so
01-21 11:30:01.622  1122  1173 I bt_vnd_conf: Attempt to load conf from /etc/bluetooth/bt_vendor.conf
01-21 11:30:01.623  1122  1173 I bt_hci  : start_up bluetooth_rtk_h5_flag :0
01-21 11:30:01.623  1122  1173 D bt_vendor: op for 0
01-21 11:30:01.623  1122  1173 D bt_upio : is_emulator_context : 0
01-21 11:30:01.623  1122  1173 D bt_upio : is_rfkill_disabled ? [0]
01-21 11:30:01.623  1122  1173 D bt_upio : is_rfkill_disabled ? [0]
01-21 11:30:01.650  1122  1173 D bt_upio : Delay 500ms for bluetooth power up
01-21 11:30:02.150  1122  1173 D bt_vendor: op for 0
01-21 11:30:02.150  1122  1173 D bt_upio : is_emulator_context : 0
01-21 11:30:02.150  1122  1173 D bt_upio : is_rfkill_disabled ? [0]
01-21 11:30:02.290  1122  1173 D bt_upio : Delay 500ms for bluetooth power up
01-21 11:30:02.790  1122  1173 D bt_vendor: Delay for a while after BT power on
01-21 11:30:02.991  1122  1173 D bt_hci  : start_up starting async portion
01-21 11:30:02.991  1122  1203 I bt_hci  : event_finish_startup
01-21 11:30:02.991  1122  1203 I bt_hci_h4: hal_open
01-21 11:30:02.991  1122  1203 D bt_vendor: op for 3
01-21 11:30:02.991  1122  1203 I bt_userial_vendor: userial vendor open: opening /dev/ttyS0
01-21 11:30:02.992  1122  1203 I bt_userial_vendor: device fd = 52 open
01-21 11:30:02.993  1122  1203 D bt_vendor: op for 1
01-21 11:30:03.000  1122  1203 I bt_hwcfg: bt vendor lib: set UART baud 1500000
01-21 11:30:03.203  1122  1203 D bt_hwcfg: Chipset BCM43430B0
01-21 11:30:03.204  1122  1203 D bt_hwcfg: Target name = [BCM43430B0]
01-21 11:30:03.204  1122  1203 D WifiHW  : check_wifi_chip_type_string: AP6236
01-21 11:30:03.204  1122  1203 I bt_hwcfg: BT module name is: AP6236, p_chip_id_str = BCM43430B0
01-21 11:30:03.204  1122  1203 I bt_hwcfg: Target HCD file name is: BCM43430B0.hcd
01-21 11:30:03.206  1122  1203 D bt_hwcfg: Target name = [BCM43430]
01-21 11:30:03.206  1122  1203 D WifiHW  : check_wifi_chip_type_string: AP6236
01-21 11:30:03.206  1122  1203 I bt_hwcfg: BT module name is: AP6236, p_chip_id_str = BCM43430
01-21 11:30:03.206  1122  1203 I bt_hwcfg: Target HCD file name is: BCM43430.hcd
01-21 11:30:03.207  1122  1203 E bt_hwcfg: vendor lib preload failed to locate firmware patch file
01-21 11:30:03.207  1122  1203 I bt_hwcfg: Setting local bd addr to 22:22:95:1C:00:01
01-21 11:30:03.208  1122  1203 I bt_hwcfg: vendor lib fwcfg completed
01-21 11:30:03.208  1122  1203 I bt_vendor: firmware callback
01-21 11:30:03.208  1122  1203 I bt_hci  : firmware_config_callback

解决办法:
将BCM43430.hcd文件放到vendor/rockchip/common/bluetooth/lib/firmware/目录下面,编译时会自动拷贝到/system/vendor/firmware/目录下面.

2. 在系统设置->WLAN中打开WiFi自动关闭

具体现象:

在系统设置->WLAN中,先连接一个WiFi热点,然后重启板子;进入系统后WiFi已经自动连接上之前保存的SSID,然后关闭WiFi再打开WiFi,出现打开WiFi自动关闭情况.

logcat:

[   73.378836]  [0:WifiStateMachin:  629] wl_android_wifi_on: Success
[   73.418263]  [0:WifiStateMachin:  629] [dhd] CFG80211-ERROR) __wl_update_wiphybands : error reading vhtmode (-23)
[   73.432993]  [0:WifiStateMachin:  629] dhd_open : the lock is released.
[   73.433079]  [0:WifiStateMachin:  629] dhd_open: Exit ret=0
[   73.754200]  [0: wpa_supplicant: 1394] P2P interface registered
[   73.754343]  [0: wpa_supplicant: 1394] wl_cfgp2p_add_p2p_disc_if: wdev: ffffffc02302ec00, wdev->net:           (null)
[   73.766470]  [2:        dhd_dpc: 1389] WLC_E_IF: NO_IF set, event Ignored
[   73.769732]  [1: wpa_supplicant: 1394] P2P interface started
[   73.861211]  [3: wpa_supplicant: 1394] dhd_ioctl_entry module exit in progress
[   73.862132]  [3: wpa_supplicant: 1394] dhd_ioctl_entry module exit in progress
[   73.863011]  [3: wpa_supplicant: 1394] dhd_ioctl_entry module exit in progress
[   73.869035]  [3: wpa_supplicant: 1394] dhd_ioctl_entry module exit in progress

解决办法:

修改WiFi驱动dhd_linux.c,将exit_in_progress初始化放到dhd_module_init中;因为驱动时build-in方式编译进kernel的,所以需要注意atomic的配对使用.

3. sdmmc通信报错

出错日志:

rk_sdmmc: ERROR Cmd response timeout hold times overflow. [mmc0]

解决办法:
修改/system/etc/firmware/config.txt,关闭自动休眠.

dhd_slpauto=0

或者采用轮询方式

dhd_poll=0

4. 32k晶振不起振

查看规格书发现32K晶振1脚需要悬空.

5. Wifi信号差

26M晶振的CL参数需要调整;

你可能感兴趣的:(android,linux,rockchip,ap6236,rk3368,wifi,bcmdhd)