i.MX8MP can't load AP6275 wifi driver on Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX8MP can't load AP6275 wifi driver on Linux

3,499 Views
lanchanning
Contributor II

dts add

bcmdhd_wlan_0: bcmdhd_wlan@0 {
compatible = "android,bcmdhd_wlan";
gpio_wl_reg_on = <&gpio2 10 GPIO_ACTIVE_HIGH>;
gpio_wl_host_wake = <&gpio2 9 GPIO_ACTIVE_HIGH>;
bcmdhd_fw = "/lib/firmware/bcm/1FD_BCM89359/fw_bcm43752a2_ag.bin";
bcmdhd_nv = "/lib/firmware/bcm/1FD_BCM89359/bcmdhd.cal";
};

An error occurred
Can't seem to start WIFI module

failed to power up DHD generic adapter, max retry reached**

 

 

root@imx8mpevk:/lib/modules/5.10.9/kernel/drivers/net/wireless/bcmdhd# insmod bcmdhd.ko
[ 375.146968] [dhd] _dhd_module_init: in Dongle Host Driver, version 101.10.361.14 (wlan=r892223-20211202-6)
[ 375.146968] drivers/net/wireless/bcmdhd compiled on Jan 25 2022 at 02:51:46
[ 375.146968]
[ 375.165098] [dhd] ======== dhd_wlan_init_plat_data ========
[ 375.170695] [dhd] ======== Get GPIO from DTS(android,bcmdhd_wlan) ========
[ 375.177837]
[ 375.177837] dhd_wlan_init_gpio:WL_REG_ON 42
[ 375.177841]
[ 375.177841] dhd_wlan_init_gpio:HOST_WAKE 41
[ 375.183743] [dhd] dhd_wlan_init_gpio: WL_HOST_WAKE=41, oob_irq=128, oob_irq_flags=0x4
[ 375.197505] [dhd] dhd_wlan_init_gpio: WL_REG_ON=42
[ 375.202313] [dhd] dhd_wifi_platform_load: Enter
[ 375.206858] [dhd] Power-up adapter 'DHD generic adapter'
[ 375.212271] [dhd] wifi_platform_set_power = 1, delay: 200 msec
[ 375.218150] [dhd] ======== PULL WL_REG_ON(42) HIGH! ========
[ 375.223854]
[ 375.223854] dhd_wlan_set_power:WL_REG_ON 42
[ 375.533050] [dhd] wifi_platform_bus_enumerate device present 1
[ 375.544761] [dhd] ======== Card detection to detect SDIO card! ========
[ 377.565051] [dhd] failed to power up DHD generic adapter, 0 retry left
[ 377.588023] [dhd] wifi_platform_set_power = 0, delay: 0 msec
[ 377.593733] [dhd] ======== PULL WL_REG_ON(42) LOW! ========
[ 377.599350] [dhd] wifi_platform_bus_enumerate device present 0
[ 377.605213] [dhd] ======== Card detection to remove SDIO card! ========
[ 377.611933] [dhd] failed to power up DHD generic adapter, max retry reached**
[ 377.619115] [dhd] unregister wifi platform drivers
[ 377.623992] [dhd] wifi_platform_bus_enumerate device present 0
[ 377.629845] [dhd] ======== Card detection to remove SDIO card! ========
[ 377.636473] [dhd] ======== dhd_wlan_deinit_plat_data ========
[ 377.642232] [dhd] dhd_wlan_deinit_gpio: gpio_free(WL_REG_ON 42)
[ 377.648171] [dhd] dhd_wlan_deinit_gpio: gpio_free(WL_HOST_WAKE 41)
[ 377.654415] [dhd] _dhd_module_init: Failed to load the driver, try cnt 0
[ 377.661228] [dhd] _dhd_module_init: Failed to load driver max retry reached**
[ 377.668425] [dhd] _dhd_module_init: Exit err=-19
insmod: ERROR: could not insert module bcmdhd.ko: No such device
root@imx8mpevk:/lib/modules/5.10.9/kernel/drivers/net/wireless/bcmdhd#

 

 

Is it because I didn't implement the sdhci_force_presence_change() function??


static int dhd_wlan_set_carddetect(int present)
{
int err = 0;

#if !defined(BUS_POWER_RESTORE)
if (present) {
printf("======== Card detection to detect SDIO card! ========\n");
#ifdef CUSTOMER_HW_PLATFORM
err = sdhci_force_presence_change(&sdmmc_channel, 1);
#endif /* CUSTOMER_HW_PLATFORM */
} else {
printf("======== Card detection to remove SDIO card! ========\n");
#ifdef CUSTOMER_HW_PLATFORM
err = sdhci_force_presence_change(&sdmmc_channel, 0);
#endif /* CUSTOMER_HW_PLATFORM */
}
#endif /* BUS_POWER_RESTORE */

return err;
}

 

Is there an example of using the bcmdhd driver for IMX8?

Labels (1)
0 Kudos
6 Replies

1,778 Views
BhavinJoisar
Contributor I

Hello did you find the solution for this? I am getting exactly same error for IMX8MM

0 Kudos

2,844 Views
jay_kaneria
Contributor I

@lanchanning 

Did you find any solution for this issue? I am having the same issue in bring up of AP6212 wifi module.

0 Kudos

3,442 Views
ScottLi
Contributor I

The SDIO card detection should be incorrect.

==========

[ 106.866643] dummy_sdmmc: probe of mmc0:0001:1 failed with error -110
[ 106.873347] dummy_sdmmc: probe of mmc0:0001:2 failed with error -110

==========

0 Kudos

3,486 Views
ScottLi
Contributor I

Hi,

Please confirm/measure the status of the gpio "WL_REG_ON".

0 Kudos

3,480 Views
lanchanning
Contributor II

[ 231.512382] [dhd] wifi_platform_set_power = 1, delay: 200 msec
[ 231.518280] [dhd] ======== PULL WL_REG_ON(42) HIGH! ========      >>>>>  WL_REG_ON is high
[ 231.523970]
[ 231.523970] dhd_wlan_set_power:WL_REG_ON 42
[ 231.834353] [dhd] wifi_platform_bus_enumerate device present 1
[ 231.846053] [dhd] ======== Card detection to detect SDIO card! ========
[ 231.852692] [dhd] detect_change 1 present 1
[ 233.870285] [dhd] failed to power up DHD generic adapter, 0 retry left
[ 233.893256] [dhd] wifi_platform_set_power = 0, delay: 0 msec
[ 233.898964] [dhd] ======== PULL WL_REG_ON(42) LOW! ========  >>>>>  WL_REG_ON is low
[ 233.904583] [dhd] wifi_platform_bus_enumerate device present 0

0 Kudos

3,469 Views
lanchanning
Contributor II

Other errors occurred after adding the patch with reference to this URL

https://www.spinics.net/lists/linux-mmc/msg65249.html

WL_REG_ON  is set high

 

root@imx8mpevk:~# insmod /lib/modules/5.10.9/kernel/drivers/net/wireless/bcmdhd/bcmdhd.ko
[ 106.776622] [dhd] _dhd_module_init: in Dongle Host Driver, version 101.10.361.14 (wlan=r892223-20211202-6)
[ 106.776622] drivers/net/wireless/bcmdhd compiled on Jan 28 2022 at 08:22:53
[ 106.776622]
[ 106.794763] [dhd] ======== dhd_wlan_init_plat_data ========
[ 106.800363] [dhd] ======== wlan_pen ========
[ 106.804660] [dhd] ======== Get GPIO from DTS(android,bcmdhd_wlan) ========
[ 106.811780] [dhd] dhd_wlan_init_gpio: gpio_request(42) for WL_REG_ON failed
[ 106.818782]
[ 106.818782] dhd_wlan_init_gpio:WL_REG_ON -1
[ 106.818785]
[ 106.818785] dhd_wlan_init_gpio:HOST_WAKE 41
[ 106.824647] [dhd] dhd_wlan_init_gpio: WL_HOST_WAKE=41, oob_irq=128, oob_irq_flags=0x4
[ 106.838320] [dhd] dhd_wlan_init_gpio: WL_REG_ON=-1
[ 106.843121] [dhd] dhd_wifi_platform_load: Enter
[ 106.847660] dhd_wifi_platform_load_sdio
[ 106.847664] dhd_wifi_platform_load_sdio num_adapters 1
[ 106.851509] dhd_wifi_platform_load_sdio i 0
[ 106.856656] [dhd] Power-up adapter 'DHD generic adapter'
[ 106.866643] dummy_sdmmc: probe of mmc0:0001:1 failed with error -110
[ 106.873347] dummy_sdmmc: probe of mmc0:0001:2 failed with error -110
[ 106.879764] [dhd] wifi_platform_set_power = 1, delay: 200 msec
[ 106.885635] [dhd] ======== PULL WL_REG_ON(-1) HIGH! ========
[ 107.197714] [dhd] wifi_platform_bus_enumerate device present 1
[ 107.203574] [dhd] ======== Card detection to detect SDIO card! ========
[ 107.210217] [dhd] detect_change 1 present 1
[ 109.245627] [dhd] failed to power up DHD generic adapter, 0 retry left
[ 109.268570] [dhd] wifi_platform_set_power = 0, delay: 0 msec
[ 109.274258] [dhd] ======== PULL WL_REG_ON(-1) LOW! ========
[ 109.279930] [dhd] wifi_platform_bus_enumerate device present 0
[ 109.285807] [dhd] ======== Card detection to remove SDIO card! ========
[ 109.292448] [dhd] detect_change 0 present 0
[ 109.296675] [dhd] failed to power up DHD generic adapter, max retry reached**
[ 109.303849] [dhd] unregister wifi platform drivers
[ 109.308656] [dhd] wifi_platform_bus_enumerate device present 0
[ 109.314517] [dhd] ======== Card detection to remove SDIO card! ========
[ 109.321150] [dhd] detect_change 0 present 0
[ 109.325361] [dhd] ======== dhd_wlan_deinit_plat_data ========
[ 109.331125] [dhd] dhd_wlan_deinit_gpio: gpio_free(WL_HOST_WAKE 41)
[ 109.337343] [dhd] _dhd_module_init: Failed to load the driver, try cnt 0
[ 109.344096] [dhd] Error creating socket.
[ 109.348055] [dhd] _dhd_module_init: Failed to load driver max retry reached**
[ 109.355215] [dhd] _dhd_module_init: Exit err=-19
insmod: ERROR: could not insert module /lib/modules/5.10.9/kernel/drivers/net/wireless/bcmdhd/bcmdhd.ko: No such device
root@imx8mpevk:~#

0 Kudos