This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

configure WiFi module at init

Other Parts Discussed in Thread: AM3358

I am trying to configure a WiFi module at init  time. In the initialization, I am configuring some pins and would also possibly like to configure the pwm that generated a wakeup clock at bootup ( the WiFi module is on mmc0, and an eMMC flash is on mmc1). The SOC is an AM3358 device

What I currently see from the dmesg entries is that it appears that the mc0 configuration is failing at init time. Please see the below excerpt

mmc_sdio_init_card mmc_send_io_op_cond -> err
         mmc_sdio_init_card err : -110
         ===== mmc_attach_sdio mmc_sdio_init_card -> err ==========
mmc0: error -110 whilst initialising SDIO card  ---> This is the initialization of the WiFi module

In the WiFi module init routine I am currently asserting the reset pin and also enabling power to a regulator. An additional step that I may need to do is to automatically enable the pwm that generates a needed clock ( this pwm can be configured from userspace, but by then the init routine has run.

An additional complication is that I cannot seem to figure out how to get the mmc_rescan_try_freq() method to run once the bootup process is complete. An alternate path that I was thinking of is to :

1) Build the driver as a module

2) write  script to initialize all the required gpios and pwm and then once this is done, insmod the module.

However when I do this, the mmc framework does not appear to recognize that the WiFi modue device has been added to the mmc/sdio bus ( I never see mmc_rescan is run and the device is not detected by the mmc framework )

The above situation leads to the following questions

1) Is there a way to force the mmc_rescan functionality to be run from userspace. Is there a particular entry that I could place in my mmc dts entry that would indicate to the drivers that this mmc device needs to be scanned for on a periodic basis.

2) I think (??) if I could get thru the mmc_sdio_init_card() method, this would allow the hsmmc_probe method to run etc, etc. I am not sure what the best way is to approach/solve this particular issue. 

Another approach I was thinking of taking is to see if there is a way to completely configure the dts entry of the associated pwm device so that (hopefully ??) this clock signal would be configured correctly by the the time the WiFi module init routine is run ( again, I am not sure if this is the right way to go, but ...)

I can attach the dmesg log file if this would be helpful. Any input would be appreciated

Thanks

Victor

  • Hi,

    Please provide more information. What Linux version are you using? What is the WLAN chip? If possible post the log file.

  • Hi, 

      I worked some more on this. Some specifics of the build environment etc are below 

    1) The kernel version I am using is 3.14.4. The build infrastructure is based on yocto poky 1.6.22

    2) The WiFi module I am interfacing with is the WD8897 module by Marvell. The driver functionality is found in drivers/net/wireless/mwifiex directory

    Currently what  I am seeing is that if i build the driver into the kernel, the card is detected. However, when the driver gets to where it is trying to download the firmware image, this step fails. I found another ti post referring to this same issue. The apparent issue is that the rfs is not yet mounted and so filp_open cannot find the requested file. However, if I try to build the mwifiex driver as a kernel module, the rescan_frequency method does not appear to get called and the card is never recognized by the mmc/sdio subsystem ( I never see the mwifiex probe method get called, so the card never gets registered etc , etc ) 

    So, I think that a possible solution would be to force the mmc/sdio subsystem to initiate a scan. But, I am not sure how to accomplish this. Maybe another solution would be mount the rfs early on in the boot process. but again I am not sure how to accomplish this. 

    Any guidance/help would be appreciated 

    Thanks 

    Victor 

  • Hi Victor,

    Do you have ti,non-removable; in your mmc dts node? Try removing it, this way kernel should assume it is always present, for more details check drivers/mmc/core/host.c.

    Best Regards,
    Yordan