ATWILC3000 SDIO driver on i.MX6ul not being probed?

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

ATWILC3000 SDIO driver on i.MX6ul not being probed?

1,875 Views
patrick_schneid
Contributor I

Hey guys,

I have a problem which is bugging me for the whole week now and I'm trying to sweeten my weekend with some productive comments here on the forum, so any help is appreciated!

In short I am trying (as many tried before) to get an ATWILC3000 WiFi/BLE module from Microchip/Atmel to work with my i.MX6ul board with Kernel version linux-imx 4.1.15 and Yocto as building environment.

I followed the Linux porting guide from Microchip to integrate the ATWILC3000 sdio driver into my kernel, which is probably working, because the kernel module "wilc_sdio.ko" is successfully created and deployed.

So now my problem is when I am about to modprobe it NOTHING happens, literally NOTHING at all. Lsmod shows the module loaded but apart from that no messages whatsoever.

As far as I am understanding kernel driver development this probably means that linux is not recognizing the kernel module as "needed" for anything in the device tree, thus not even the probe function in the driver is called and nothing happens.

So why is that?

Here some more informations on the topic.

1. Boot output for dmesg | grep mmc

[ 1.849718] sdhci-esdhc-imx 2194000.usdhc: No vmmc regulator found
[ 1.858126] sdhci-esdhc-imx 2194000.usdhc: No vqmmc regulator found
[ 1.913336] mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
I would also expect something similar to what is happening on mmc0 (which has a normal card connected)

[ 2.044423] mmc0: new high speed SDHC card at address e624

But no "card" is detected on mmc1, perhaps this is also the root problem; but what exactly can one see here? What exactly means that the controller is found, but not a card? Is my wiring ok then, because the controller is able to communicate? Or could it still be a hardware problem?

2. Loading the module

Thats all that happens, not much to work with:

root@evalboard:~# modprobe wilc_sdio
root@evalboard:~# lsmod
Module Size Used by
wilc_sdio 200566 0
root@evalboard:~#

3. Device tree

To be honest I am not sure if my devicetree changes are correct as I never used the usdhc interface for something different as a sdcard. Firstly do I need vmmc and vqmmc regulators and how would I configure them?


regulators {

   ...

   reg_wlan_en: regulator@7 {
      compatible = "regulator-fixed";
      reg = <7>;
      regulator-name = "wlan_en";
      regulator-min-microvolt = <3300000>;
      regulator-max-microvolt = <3300000>;

      /* this is the enable pin for the wifi module,

         I tried using it for vmmc and vqmmc or setting it

         as GPIO and doing it myself before loading the kernel driver */
      gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>;
      startup-delay-us = <70000>; 
      enable-active-high;
      status = "okay";
   };
};

&usdhc2 {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_usdhc2_wlan &pinctrl_wlan>;
   /*vmmc-supply = <&reg_wlan_en>;
   vqmmc-supply = <&reg_wlan_en>;*/
   bus-width = <4>;
   non-removable;
   status = "okay";

   #address-cells = <1>;
   #size-cells = <0>;

   /* i copied the @2 from another wifi example, what exactly does it mean? */
   wilc_sdio@2{
      compatible = "atmel,wilc_sdio";
      gpio_reset = <&gpio4 25 GPIO_ACTIVE_HIGH>;
      gpio_chip_en = <&gpio5 9 GPIO_ACTIVE_HIGH>;
      gpio_irq = <&gpio1 21 GPIO_ACTIVE_LOW>;

      interrupt-parent = <&gpio1>;
      interrupts = <21 IRQ_TYPE_EDGE_RISING>;
      status = "okay";
   };
   slot@2 {
      reg = <2>;
      bus-width = <4>;
   };
};

Labels (3)
0 Kudos
4 Replies

1,453 Views
igorpadykov
NXP Employee
NXP Employee

Hi Patrick 

one can ask vendor of that chip to provide driver and firmware for L4.1.15 kernel

version. Example of similar driver and dts example can be found in

Chapter 46 Wi-Fi BCM4339 Driver Linux Manual included in documentation:

https://www.nxp.com/webapp/Download?colCode=L4.1.15_2.1.0_LINUX_DOCS&Parent_nodeId=13376994810717061... 

Debugging of probe() functioncan be performed using AN4553 Using Open Source

Debugging Tools for Linux on i.MX Processors
https://www.nxp.com/docs/en/application-note/AN4553.pdf

and checking with oscilloscope usdhc lines.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,453 Views
patrick_schneid
Contributor I

Thank you for your answer Igor,

I will definetly try to debug my problem, but I don't think it will help me yet. I think my problem is that the probe function is never called ever and I need to figure out why that is (not) happening. Don't you agree out of the infos I gave? Or do you think the probe is called but crashes?

And coming back to some of my basic questions which might help me understand my problem better:

1. Boot output for dmesg | grep mmc

[ 1.849718] sdhci-esdhc-imx 2194000.usdhc: No vmmc regulator found
[ 1.858126] sdhci-esdhc-imx 2194000.usdhc: No vqmmc regulator found
[ 1.913336] mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
I would also expect something similar to what is happening on mmc0 (which has a normal card connected)

[ 2.044423] mmc0: new high speed SDHC card at address e624

But no "card" is detected on mmc1, perhaps this is also the root problem; but what exactly can one see here? What exactly means that the controller is found, but not a card?

And does look my device tree "ok"?

Cheers!

0 Kudos

1,453 Views
igorpadykov
NXP Employee
NXP Employee

this may depend how you configured driver, as module or built statically in kernel:

linux - What is the difference between kernel drivers and kernel modules? - Unix & Linux Stack Excha... 

Best regards
igor

0 Kudos

1,453 Views
patrick_schneid
Contributor I

Well I already tried both with the same result, so what can I conclude from that?

The log output is the same (nothing) whether I am running it as module or built in.

Cheers!

0 Kudos