linux4wilc / driver

DEPRECATED: Updated Linux drivers for the ATWILC1000/ATWILC3000 products are located at https://github.com/linux4microchip/linux/tree/master/drivers/net/wireless/microchip/wilc1000. To simplify development, the legacy Linux4WILC was merged into the Linux4Microchip repo where driver development continues (Please refer latest ATWILC1000/ATWILC 3000 Wi-Fi Link Controller Linux User Guide) Driver code for Microchip ATWILC Wireless Devices (ATWILC1000 & ATWILC3000)
https://www.microchip.com/wwwproducts/en/ATWILC1000
32 stars 19 forks source link

wilc_sdio_cmd52..failed, err(-84) #107

Open hberg539 opened 4 years ago

hberg539 commented 4 years ago

Hello,

i'm having issues including the wilc driver for our WILC 1000 chip over SDIO. The SDIO detection seems to work fine, the driver can be loaded and the device shows up. But when trying to enable the device (ip link set dev wlan0 up), there seems to be a communication issue.

Driver version: 20ab626 (git master branch) CPU: STM32MP1

The device tree:

&sdmmc3 {
        status = "okay";
        pinctrl-names = "default", "opendrain", "sleep";
        pinctrl-0 = <&sdmmc3_pins_mx>;
        pinctrl-1 = <&sdmmc3_opendrain_pins_mx>;
        pinctrl-2 = <&sdmmc3_sleep_pins_mx>;
        non-removable;
        no-sd;
        st,neg-edge;
        bus-width = <4>;
        vmmc-supply = <&v3v3>;
        vqmmc-supply = <&v3v3>;
        max-frequency = <1000000>;

        wilc_sdio0: wilc_sdio@0 {
                compatible = "microchip,wilc1000", "microchip,wilc3000";
                irq-gpios = <&gpioh 7 0>;
                reset-gpios = <&gpioh 6 0>;
                chip_en-gpios = <&gpiob 1 0>;
                status = "okay";
                reg = <0>;
                bus-width = <4>;
        };
};

dmesg log on boot:

[    3.141439] mmc0: new high speed SDIO card at address 0001

Now i load the device driver with modprobe wilc_sdio which seems fine:

[  110.691525] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[  110.723744] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[  110.729148] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[  110.737711] cfg80211: failed to load regulatory.db
[  110.766282] wilc_sdio: module is from the staging directory, the quality is unknown, you have been warned.
[  110.784806] Registering wifi device
[  110.786962] Max scan ids= 10,Max scan IE len= 1000,Signal Type= 1,Interface Modes= 844
[  110.795468] Initializing Locks ...
[  110.816657] wifi_pm : 0
[  110.818643] wilc_sdio mmc0:0001:1: succesfully got gpio_reset
[  110.823556] wilc_sdio mmc0:0001:1: succesfully got gpio_chip_en
[  110.843048] wifi_pm : 1
[  110.844149] wilc_sdio mmc0:0001:1: succesfully got gpio_reset
[  110.859751] wilc_sdio mmc0:0001:1: succesfully got gpio_chip_en
[  110.890856] wilc_sdio mmc0:0001:1: Driver Initializing success

Now i enable the device with ip link set dev wlan0 up:

[  170.706116] wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mac_open]MAC OPEN[07a597ef] wlan0
[  170.712689] WILC POWER UP
[  170.715139] wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_init_host_int]Host[07a597ef][e5193910]
[  170.723518] wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mac_open]*** re-init ***
[  170.730620] wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_wlan_init]Initializing WILC_Wlan
[  170.738344] wilc_sdio mmc0:0001:1: SDIO speed: 1000000
[  170.743829] wilc_sdio mmc0:0001:1: wilc_sdio_cmd52..failed, err(-84)
[  170.749953] wilc_sdio mmc0:0001:1: Fail cmd 52, enable csa...
[  170.755589] wilc_sdio mmc0:0001:1 wlan0: ERR [wilc_wlan_initialize:905] Initializing WILC_Wlan FAILED
[  170.764920] wilc_sdio mmc0:0001:1 wlan0: ERR [wilc_mac_open:1029] Failed to initialize wilc

Trace-Log directly after enabling the device:

<idle>-0     [000] d.h2   235.746466: mmc_request_done: mmc0: end struct mmc_request[da9ef1e4]: cmd_opcode=52 cmd_err=-84 cmd_resp=0x0 0x0 0x0 0x0 cmd_retries=0 stop_opcode=0 stop_err=0 stop_resp=0x0 0x0 0x0 0x0 stop_retries=0 sbc_opcode=0 sbc_err=0 sbc_resp=0x0 0x0 0x0 0x0 sbc_retries=0 bytes_xfered=0 data_err=0 tag=0 can_retune=0 doing_retune=0 retune_now=0 need_retune=0 hold_retune=1 retune_period=0
<idle>-0     [000] dnh2   235.746544: mmc_request_done: mmc0: end struct mmc_request[c01d60f2]: cmd_opcode=52 cmd_err=-84 cmd_resp=0x0 0x0 0x0 0x0 cmd_retries=0 stop_opcode=0 stop_err=0 stop_resp=0x0 0x0 0x0 0x0 stop_retries=0 sbc_opcode=0 sbc_err=0 sbc_resp=0x0 0x0 0x0 0x0 sbc_retries=0 bytes_xfered=0 data_err=0 tag=0 can_retune=0 doing_retune=0 retune_now=0 need_retune=0 hold_retune=1 retune_period=0

The CMD line looks like this directly after enabling the device: grafik It looks like it does some sending, then floats and waits for an response from the wilc module.

Maybe some one has an idea what could be wrong?

I appreciate any help, thank you.

Best regards, Kevin