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.

Wi-Fi: BlueGiga WF111 SDIO Driver for AM335x Problem

Other Parts Discussed in Thread: WL1271

Hello!

In my custom board I have a BlueGiga WF111 chip connected to the MMC2 bus but I'm having a LOT of trouble trying to make its driver recognize the wireless card. So far nothing worked and I can't even get the driver to report that it found the card...

If anyone have ever worked with this driver, could you please help?

I would really like some guidelines on how to configure the struct omap2_hsmmc_info variable inside my board configuration file or anything related to the boot process and how to set the pins ready.

The first configuration I did was based on how the file board-am335xevm.c sets the WiFi for the wl12xx driver. The pins in my design match the ones the EVM uses, so I kept the pin mux configuration on my board file. It also configures a struct omap2_hsmmc_info variable (the on I previously mentioned) and I did the same thing, changing only what was necessary. Right now I don't know if I got this right.

With an oscilloscope, I see no response of any sort in the hardware when I load the driver, so maybe it is not finding the bus due to some configuration I got wrong...

What I'm trying to check is if I have everything right on the Kernel side of things. Their support is trying to help as well, but I need to be sure I'm not missing some simple configuration.

Any help will be greatly appreciated, even if it doesn't involve the WF111 driver directly. 

Thanks! 

DAVI

  • Hi,

    Do you have "WF111" driver support on linux?

    If not, try the following steps,

    make menuconfig ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

    [*] Networking support  --->

    <*>   Bluetooth subsystem support  --->

    Bluetooth device drivers  --->

    <*> HCI SDIO driver

    Can you please share your bootup logs?

    Refer this link,( for downloading linux driver & app note)

    https://www.bluegiga.com/en-US/products/wifi-modules/wf111-wifi-module/documentation/#login-modal

  • Well, I do have the WF111 driver, but it is not woking. I tried the HCI SDIO driver too, but nothing happened either.

    As of now, my main suspicion is that the chip is not being properly powered. There is no message saying that a new SDIO card was detected and I know this does not depend on the it's driver.

    I used an EVM board to help me figure out what could be wrong in my board configuration file. The EVM has a different card, the WL1271, but it uses the same MMC bus (MMC2 in this case) and also uses SDIO. The only difference is the fact that the EVM code calls wl12xx_init() and that function is responsible to set up things for when the wl12xx driver is called, indicating some GPIOs that work as BT_ENABLE, WL_ENABLE, etc...

    In my case, I don't have nothing of the sort and the WF111 driver is an external module. All this made me think that the chip is off, what else would prevent the chip from being detected? So now I'm checking what could be wrong in my hardware design...

    DAVI

  • Hi,

    Have you done proper pinmuxing for MMC2 which is connected to WF111 device.

    Have you checked the hw design between EVM & your custom board for WF111?

    Are you getting any prints from wf111 driver code?

    Could you please attach your bootup log?

  • Here is the pinmux configuration I set:

    static struct pinmux_config wifi_mmc2_pin_mux[] = {
       {"gpmc_a1.mmc2_dat0",   OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
       {"gpmc_a2.mmc2_dat1",   OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
       {"gpmc_a3.mmc2_dat2",   OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
       {"gpmc_ben1.mmc2_dat3", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
       {"gpmc_csn3.mmc2_cmd",  OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
       {"gpmc_clk.mmc2_clk",   OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT_PULLUP},
       {NULL, 0},
    };
    
    static struct pinmux_config wifi_reset_pin_mux[] = {
       {"gpmc_ad11.gpio0_27",  OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT_PULLUP},
       {NULL, 0},
    };

    The EVM and my board uses the same MMC bus to connect the wifi chip to the processor, MMC2. I set the pins just like EVM does, the difference is that I don't have a correspond function to wl12xx_init() in my board configuration file.

    The log is attached. I also called modprobe omap_hsmmc just to show that the mmc_core module is working...

    5265.bootlog.txt

  • Our team found out there is a hardware problem in our design that prevents the WF111 chip to be properly powered up.

    Regardless, there is another thing that concerns me.

    When I connect an oscilloscope to the clock line I never see a signal when the driver is loaded. Seems to me that even if the chip were on I still wouldn't be able to communicate with it...

    Since I already showed the pinmux structure, here is the rest of the MMC configuration I use:

    static struct omap2_hsmmc_info am335x_mmc[] __initdata = {
       {
          .mmc            = 1,
          .caps           = MMC_CAP_4_BIT_DATA,
          .gpio_cd        = GPIO_TO_PIN(2, 26), /* GPIO2.26 */
          .ocr_mask       = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3V3 */
       },
       {
    	   .mmc = 3,
    	   .name = "unifi",
    	   .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
    	   .nonremovable = true,
    	   .gpio_cd = -EINVAL,
    	   .gpio_wp = -EINVAL,
    	   .ocr_mask = MMC_VDD_165_195, /* 1V8 */
       },
       {}      /* Terminator */
    };

    In my desing, MMC0 is connected to a SD card slot, MMC1 communicates with the NAND chip and the MMC2 is the WiFi SDIO bus.

    unifi is the driver's name and the remaining was again based on the configuration the EVM uses in it's board configuration file.

    Would the pinmux (as shown in the post above) and this structure be enough to configure the bus? What am I missing that would prevent a clock signal from being sent?

    DAVI

  • Hi, I'm having the same problem with WF111 connected to AM335x MMC2.

    csr_wifi_5.1.0 WF111 driver is compiled out of Linux tree, then from Linux command line run:

    root@am335x-evm:~# modprobe unifi-sdio
    [   32.788177] Disabling lock debugging due to kernel taint
    [   32.835327] UniFi SDIO Driver: 5.1.0 Jun 23 2014 10:43:46
    [   32.841278] CSR SME with WEXT support
    [   32.845123] Split patch support
    [   32.848937] Kernel 3.2.0
    [   32.852386] UniFi: Using native Linux MMC driver for SDIO.
    root@am335x-evm:~# lsmod
    Module                  Size  Used by
    unifi_sdio            469104  -2 

    MMC2_CLK and MMC2_CMD togle when Linux is booting, but stay stable when loading wf111 driver.

    MMC boot log:

    root@am335x-evm:~# dmesg | grep mmc
    [    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext3 rootwait ip=none
    [    0.117584] DEBUG: ************** mmc2_wf111_init
    [    0.117645] DEBUG: ************** mmc0_init
    [    0.117736]  omap_hsmmc.0: alias fck already exists
    [    0.117919]  omap_hsmmc.2: alias fck already exists
    [    1.498413] mmc0: host does not support reading read-only switch. assuming write-enable.
    [    1.522766] mmc0: new high speed SDHC card at address 1234
    [    1.538635] mmcblk0: mmc0:1234 SA04G 3.63 GiB 
    [    1.547241]  mmcblk0: p1 p2 p3
    [    1.650909] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
    [    5.166168] EXT3-fs (mmcblk0p3): warning: maximal mount count reached, running e2fsck is recommended
    [    5.893280] EXT3-fs (mmcblk0p3): using internal journal
    [    5.898803] EXT3-fs (mmcblk0p3): mounted filesystem with ordered data mode
    [    6.031494] EXT3-fs (mmcblk0p2): warning: maximal mount count reached, running e2fsck is recommended
    [    6.044189] EXT3-fs (mmcblk0p2): using internal journal
    

    WF111 and MMC2 pinmux:

    static struct pinmux_config wf111_pin_mux[] = {
    	{ "gpmc_a0.gpio1_16"		, OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT_PULLUP },
    	{ "uart0_rtsn.gpio1_9"		, OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT_PULLUP },
    	{ NULL, 0 },
    };
    
    static struct pinmux_config mmc2_wf111_pin_mux[] = {
    	{ "gpmc_a1.mmc2_dat0",	OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP },
    	{ "gpmc_a2.mmc2_dat1",	OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP },
    	{ "gpmc_a3.mmc2_dat2",	OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP },
    	{ "gpmc_ben1.mmc2_dat3",OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP },
    	{ "gpmc_csn3.mmc2_cmd",	OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP },
    	{ "gpmc_clk.mmc2_clk",	OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP },
    	{ NULL, 0 },
    };
    static void mmc2_wf111_init(int evm_id, int profile) {
    	pr_info("DEBUG: ************** mmc2_wf111_init\n");
    	setup_pin_mux(mmc2_wf111_pin_mux);
    
    	am335x_mmc[1].mmc = 3;
    	am335x_mmc[1].name = "unifi";
    	am335x_mmc[1].caps = MMC_CAP_4_BIT_DATA;// | MMC_CAP_POWER_OFF_CARD;
    	am335x_mmc[1].nonremovable = true;
    	am335x_mmc[1].pm_caps = MMC_PM_KEEP_POWER;
    	am335x_mmc[1].gpio_cd = -EINVAL;
    	am335x_mmc[1].gpio_wp = -EINVAL;
    	am335x_mmc[1].ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34; /* 3V3 */
    	return;
    }
    static void wf111_init(int evm_id, int profile) {
    	struct device *dev;
    	int ret;
    
    	pr_info("DEBUG: ************** wf111_init\n");
    	setup_pin_mux(wf111_pin_mux);
    
    
    	dev = am335x_mmc[1].dev;
    	if (!dev) {
    		pr_err("wf111 mmc device initialization failed\n");
    		goto out;
    	}
    
    	ret = gpio_request_one(PIN_WLAN_POW_EN,GPIOF_OUT_INIT_HIGH,"wlan_pow_en");
    	pr_info("DEBUG: ************** wlan_pow_en=1\n");
    	if (ret) {
    		pr_err("Error requesting wlan power enable gpio: %d\n", ret);
    		goto out;
    	}
    	ret = gpio_request_one(PIN_COMWL_RST,GPIOF_OUT_INIT_HIGH,"comwl_rst");
    	pr_info("DEBUG: ************** comwl_rst=1\n");
    	if (ret) {
    		pr_err("Error requesting wlan reset gpio: %d\n", ret);
    		goto out;
    	}
    
    	out: return;
    }
    static struct evm_dev_cfg custom_board_dev_cfg[] = {
    ...
    	{mmc2_wf111_init     	,DEV_ON_BASEBOARD,PROFILE_NONE},
    	{mmc0_init              ,DEV_ON_BASEBOARD,PROFILE_NONE},
    	{wf111_init          	,DEV_ON_BASEBOARD,PROFILE_NONE},
    ...
    };

    I have applied the patch proposed by Davi in another thread:

    --- a/arch/arm/mach-omap2/hsmmc.c   2013-06-25 18:37:58.000000000 -0300
    +++ b/arch/arm/mach-omap2/hsmmc.c   2014-05-14 10:37:50.873824028 -0300
    @@ -175,11 +175,12 @@
     {
        u32 reg;
     
    -   if (mmc->slots[0].internal_clock) {
    -       reg = omap_ctrl_readl(control_devconf1_offset);
    +   reg = omap_ctrl_readl(control_devconf1_offset);
    +   if (mmc->slots[0].internal_clock)
            reg |= OMAP2_MMCSDIO2ADPCLKISEL;
    -       omap_ctrl_writel(reg, control_devconf1_offset);
    -   }
    +   else
    +       reg &= ~OMAP2_MMCSDIO2ADPCLKISEL;
    +   omap_ctrl_writel(reg, control_devconf1_offset);
     }
     
     static void hsmmc23_before_set_reg(struct device *dev, int slot,
    @@ -402,6 +404,7 @@
            }
            break;
        case 2:
    +   case 3:
            if (cpu_is_omap3517() || cpu_is_omap3505())
                mmc->slots[0].set_power = am35x_hsmmc2_set_power;
     
    @@ -414,8 +417,7 @@
                c->caps &= ~MMC_CAP_8_BIT_DATA;
                c->caps |= MMC_CAP_4_BIT_DATA;
            }
    -       /* FALLTHROUGH */
    -   case 3:
    +
            if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
                /* off-chip level shifting, or none */
                mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
    --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c    2013-06-25 18:38:23.000000000 -0300
    +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c    2014-05-02 15:01:10.179263437 -0300
    @@ -2049,8 +2049,8 @@
        { }
     };
     
    -static struct omap_hwmod_ocp_if am33xx_l3_main__mmc2 = {
    -   .master     = &am33xx_l3_main_hwmod,
    +static struct omap_hwmod_ocp_if am33xx_l4ls__mmc2 = {
    +   .master     = &am33xx_l4ls_hwmod,
        .slave      = &am33xx_mmc2_hwmod,
        .clk        = "mmc2_ick",
        .addr       = am33xx_mmc2_addr_space,
    @@ -2058,7 +2058,7 @@
     };
     
     static struct omap_hwmod_ocp_if *am33xx_mmc2_slaves[] = {
    -   &am33xx_l3_main__mmc2,
    +   &am33xx_l4ls__mmc2,
     };
     
     static struct omap_mmc_dev_attr am33xx_mmc2_dev_attr = {
    @@ -2067,7 +2067,7 @@
     static struct omap_hwmod am33xx_mmc2_hwmod = {
        .name       = "mmc3",
        .class      = &am33xx_mmc_hwmod_class,
    -   .clkdm_name = "l3s_clkdm",
    +   .clkdm_name = "l4ls_clkdm",
        .mpu_irqs   = am33xx_mmc2_irqs,
        .main_clk   = "mmc2_fck",
        .sdma_reqs  = am33xx_mmc2_edma_reqs,

    Is there anything wrong or missing?

    Thank you in advance

  • I did get it to work and I forgot to mark this post as solved...

    Here is what I did:

    First you need to compile the driver unifi_sdio with the options below:

    ./linux_driver_install mmc wext_ap ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} KDIR=${KDIR}
    fakeroot ./linux_driver_install mmc wext_ap install ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} KDIR=${KDIR} DESTDIR=${DESTDIR}

    linux_driver_install is the script that comes with the driver's source code.

    I never tried to recompile the Kernel after installing the driver, but I don't think it is a good ideia. The dependencies file could be replaced and therefore modprobe wouldn't work for unifi_sdio. In my case I altered the Makefile file so that I always install it after installing the Kernel drivers.

    Then you need to extract the file wf111-userspace-5.1.0-16-linux-armv5-bin_static.tar.gz inside the file system you use on your board. This tarball comes with the source code when you download it from their website.

    Now to the board configuration:

    static struct pinmux_config mmc2_pin_mux[] = {
    {"gpmc_csn3.mmc2_cmd", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
    {"gpmc_clk.mmc2_clk", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
    {"gpmc_ad12.mmc2_dat0", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
    {"gpmc_ad13.mmc2_dat1", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
    {"gpmc_ad14.mmc2_dat2", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
    {"gpmc_ad15.mmc2_dat3", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
    {NULL, 0},
    };
    
    static struct omap2_hsmmc_info am335x_mmc[] __initdata = {
    {
    .mmc = 3,
    .name = "unifi",
    .caps = MMC_CAP_4_BIT_DATA,
    .nonremovable = true,
    .gpio_cd = -EINVAL,
    .gpio_wp = -EINVAL,
    .ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
    },
    {} /* Terminator */
    };
    
    static void mmc0_init(void)
    {
    setup_pin_mux(mmc0_pin_mux);
    omap2_hsmmc_init(am335x_mmc);
    }
    
    static void wifi_init(void)
    {
    setup_pin_mux(mmc2_pin_mux);
    }

    (I got rid of the EVM stuff in my board config file)

    I also toggle the reset pin before the next step.

    With all that, it's important to note that unifi_sdio needs mmc_core to be functional, so the driver you must load is in fact omap_hsmmc. In my board, it automatically loads unifi_sdio when it detects the chip on the bus.

    From this point on, the interface wlan0 is available, but the driver DOES NOT WORK WITH NL80211 (iw commands, for example). It supports only the old WEXT, so you will need to cross compile iwlist, iwconfig and the others in order to use the interface.

    For wpa_supplicant, you can change the configuration file used by its Makefile to completelly ignore nl80211 as you won't be needing it anyway. It's a good practice if you don't want to infotm -DWEXT everytime you run the command...

    One last thing, if you could help me out, could you try to check the throughput speed with iperf? I'm getting a very low throughput measure, something below 1MBits/s. After making the driver work, would you please test it and post the output here? Thanks a lot!

    DAVI

  • Another thing, I boot the board from the NAND, therefore I can configure omap_hsmmc as a module.

    I noticed that the clock signal is only sent the moment I load the driver. The initialization check every bus you previously configured for anything attached, but so far I haven't solved how to do this once the driver is up and running...

    Actually, I haven't had time to look it up. As this is not a concern in my project, it got postponed. This would happen if, for example, unifi_sdio failed to issue the command that starts the bus...

    DAVI

  • Thank you very much Davi, WF111 still does not work in my board.

    Which Makefile did you altere and how?. How do you install de unifi_sdio driver?.

    I have applied a patch to csr driver in order to enable a third sdio (because my board uses MMC2), did you apply this patch?, it can be downloaded from Bluegiga knowledge base. Moreover I have made a link: /lib/firmware/unifi-sdio-2.

    My board boots from sd-card, so I suppose omap_hsmmc can't be configured as a module, does it mean that omap_hsmmc cannot load unifi_sdio module because unifi_sdio is a module?. Should the unifi driver be compiled as in-tree driver?, how?.

    Regards

  • So, I've added three lines to the Makefile that compiles both the Kernel and U-Boot. I actually call a script, which I'm also pasting here. SDK_PATH_NATIVE is the same variable you see in the environment-setup file, inside linux-devkit.

    Makefile:

    linux:
    	@echo =================================
    	@echo     Building the Linux Kernel
    	@echo =================================
    	$(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) tisdk_$(PLATFORM)_defconfig
    	$(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) uImage
    	$(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules
    	@sh ./wifi_module.sh $(ARCH) $(SDK_PATH_NATIVE)/usr/bin/$(TOOLCHAIN_PREFIX) $(LINUXKERNEL_INSTALL_DIR) $(DESTDIR) build
    
    linux_install:
    	@echo ===================================
    	@echo     Installing the Linux Kernel
    	@echo ===================================
    	install -d $(DESTDIR)/boot
    	install $(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/uImage $(DESTDIR)/boot
    	install $(LINUXKERNEL_INSTALL_DIR)/vmlinux $(DESTDIR)/boot
    	install $(LINUXKERNEL_INSTALL_DIR)/System.map $(DESTDIR)/boot
    	$(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) INSTALL_MOD_PATH=$(DESTDIR) modules_install
    	@sh ./wifi_module.sh $(ARCH) $(SDK_PATH_NATIVE)/usr/bin/$(TOOLCHAIN_PREFIX) $(LINUXKERNEL_INSTALL_DIR) $(DESTDIR) install
    
    linux_clean:
    	@echo =================================
    	@echo     Cleaning the Linux Kernel
    	@echo =================================
    	$(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) mrproper
    	@sh ./wifi_module.sh $(ARCH) $(SDK_PATH_NATIVE)/usr/bin/$(TOOLCHAIN_PREFIX) $(LINUXKERNEL_INSTALL_DIR) $(DESTDIR) clean

    Script wifi_module.sh

    #!/bin/sh
    
    ARCH=$1
    CROSS_COMPILE=$2
    KDIR=$3
    DESTDIR=$4
    OPTION=$5
    
    cd <your_local_path>/csr_wifi_5.1.0
    
    chmod +x linux_driver_install oska/linux/build oska/scripts/lndir sdioemb/linux/build sdioemb/scripts/lndir csr/os_linux/driver/build
    
    case "${OPTION}" in
    	build)
    		./linux_driver_install mmc wext_ap ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} KDIR=${KDIR}
    		EXIT_STA=$?
    		;;
    	install)
    		fakeroot ./linux_driver_install mmc wext_ap install ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} KDIR=${KDIR} DESTDIR=${DESTDIR}
    		EXIT_STA=$?
    		;;
    	clean)
    		./linux_driver_install mmc wext_ap clean ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} KDIR=${KDIR}
    		EXIT_STA=$?
    		;;
    	*)
    		exit 1
    		;;
    esac
    
    cd - > /dev/null
    
    exit ${EXIT_STA}

    One thing, I think I had to change the script linux_driver_install so that I could call it with the clean parameter. Maybe you should comment the lines that calls it, in case it doesn't work.

    I also use MMC2, it worked without any patches. The only thing that changes is already taken care of inside the tarball with the files you must extract inside your file system. The folder /lib/firmware/unifi-sdio-0 is pointed by the symbolic links /lib/firmware/unifi-sdio-1 and /lib/firmware/unifi-sdio-2.

    Well, I didn't mention it before because this one usually goes without saying, but you always need to copy the /lib/modules folder from your $(DESTDIR) to the filesystem you use. When you run make linux_install the Makefile copies the new uImage file to $(DESTDIR) and also creates $(DESTDIR)/lib so you can copy it using cp -a.

    Now, if everything is as I mentioned and the driver still doesn't works, you should check what omap_hsmmc is doing when it boots the board and why unifi_sdio fails to initiate the communication when it is called. As I said, I noticed that I can only make it work when I load omap_hsmmc because it's initialization is the one that poll the buses for devices. Then, when a new SDIO card is found, omap_hsmmc automatically loads unifi_sdio. Loading unifi_sdio in my board doesn't work because mmc_core wouldn't be configured without omap_hsmmc. The problem I have is the fact I don't know how to poll the bus once omap_hsmmc is already loaded and this one got postponed. I suggest you use a scope to check when you see a clock signal in your SDIO_CLK line.

    Hope it helps.

    DAVI

  • Thank you very much Davi,

    I've tried iperf but I get some errors.

    On Linux PC:

    $ iperf -s
    ------------------------------------------------------------
    Server listening on TCP port 5001
    TCP window size: 85.3 KByte (default)
    ------------------------------------------------------------
    [  4] local 192.168.58.74 port 5001 connected with 192.168.58.234 port 55411
    

    On AM335x board:

    # iperf -c 192.168.58.74
    ------------------------------------------------------------
    Client connecting to 192.168.58.74, TCP port 5001
    TCP window size: 20.2 KByte (default)
    ------------------------------------------------------------
    [  3] local 192.168.58.234 port 55411 connected with 192.168.58.74 port 5001
    [ 1959.886444] unifi1: Block read failed after 3 retries
    [ 1959.891754] unifi1: Failed to read ToHost signal
    [ 1959.897033] unifi1: Error occured reading to-host signals
    [ 1959.902954] unifi1: unifi_bh: state=0 A, clock=50000kHz, interrupt=0 host=0, power_save=disabled
    [ 1959.927459] unifi1: handle_bh_error: fatal error is reported to the SME.
    [ 1959.935028] unifi1: SME client close (unifi1)
    [ 1959.940704] unifi1: Attempt to set mode to TORPID when lower power mode is disabled
    [ 1959.949981] unifi1: Message for the SME dropped, SME has gone away
    [ 1960.025939] unifi1: Initialising UniFi, attempt 1
    [ 1960.031677] unifi1: Chip ID 0x07  Function 1  Block Size 64  Name UniFi-4(UF60xx)
    [ 1960.086639] unifi1: Chip Version 0x3A22
    [ 1960.090667] unifi1: Calling CsrSdioHardReset
    [ 1960.095153] unifi1: Falling back to software hard reset
    [ 1960.101043] unifi1: Chip ID 0x07  Function 1  Block Size 64  Name UniFi-4(UF60xx)
    [ 1960.138061] unifi1: Mini-coredump capture at t=568968226
    [ 1962.186553] unifi1: Timeout waiting for loader to ack transfer
    [ 1962.193023] unifi1: Failed to write loader load image command
    [ 1962.199645] unifi1: Failed to establish communication with UniFi
    [ 1962.205963] unifi1: Failed to start host protocol.
    [ 1962.211181] unifi1: Failed to initialise UniFi chip.
    [ 1962.216491] unifi1: Initialising UniFi, attempt 2
    [ 1962.221893] unifi1: Chip ID 0x07  Function 1  Block Size 64  Name UniFi-4(UF60xx)
    [ 1962.276733] unifi1: Chip Version 0x3A22
    [ 1962.280975] unifi1: Calling CsrSdioHardReset
    [ 1962.285461] unifi1: Falling back to software hard reset
    [ 1962.291229] unifi1: Chip ID 0x07  Function 1  Block Size 64  Name UniFi-4(UF60xx)
    

    My board has a hardware issue, SDIO max frequency is 2MHz, so I modified omap_hsmmc driver to set 2MHz max frequency. Maybe this is causing these errors, I'll try again @50MHz SDIO bus speed.

    Best regards

  • Hi Ford,

    I'm getting a similar issue. When installing the module I get the following:

    <3>[ 88.903961] unifi2: waiting for MAILBOX1 to be non-zero...
    <3>[ 88.910003] unifi2: MAILBOX1 ready (0x0100) in 0 millisecs
    <3>[ 88.915985] unifi2: MAILBOX1 value=0x0100
    <4>[ 88.920684] unifi: <= card_wait_for_firmware_to_start
    <3>[ 88.925994] unifi2: *** addr 0x100063E
    <3>[ 88.930969] unifi2: Looking for *** finger print
    <3>[ 88.935913] unifi2: setting dmem page=0x0, addr=0x431F
    <3>[ 88.942749] unifi2: found *** id 03.2200012e
    <3>[ 88.947845] unifi2: setting pmem page=0x2000, addr=0x2097
    <3>[ 88.955352] unifi2: found *** id 04.22000132
    <3>[ 88.961700] unifi2: found *** id 14.22012eaa
    <3>[ 88.966674] unifi2: found *** id 15.200007d0
    <3>[ 88.971527] unifi2: found *** id 16.10000012
    <3>[ 88.978454] unifi2: found *** id 17.20000012
    <3>[ 88.983886] unifi2: found *** id 19.00000000
    <3>[ 88.990112] unifi2: found *** id 18.0100060e
    <3>[ 88.994903] unifi2: Loader cmd 0x10 -> 0x01000614
    <3>[ 89.014007] unifi2: id=7, ver=0x3a22, fw_build=1089, fw_hip=0x0, block_size=64
    <4>[ 89.021575] unifi: => unifi_fw_read_start
    <3>[ 89.025756] unifi2: Attempt reload of sta f/w
    <4>[ 89.071136] unifi: <= unifi_fw_read_start
    <4>[ 89.075439] unifi: => unifi_dl_patch
    <6>[ 89.079193] unifi2: unifi_dl_patch d69edf48 0100060e
    <3>[ 89.085113] unifi2: Patch download: boot loader version 0x0000
    <3>[ 89.091583] unifi2: Patch download: 0 Downloading for 2048 from offset 820
    <3>[ 89.099945] unifi2: Loader cmd 0x2 -> 0x01000614
    <3>[ 89.104919] unifi2: Error reported by loader: 0x80
    <3>[ 89.109924] unifi2: Failed to copy block of 2048 bytes to UniFi
    <3>[ 89.116119] unifi2: Patch failed after 0 bytes
    <3>[ 89.120788] unifi2: Failed to patch image
    <4>[ 89.124969] unifi: <= unifi_dl_patch 65535
    <4>[ 89.129241] unifi: => unifi_fw_read_stop
    <3>[ 89.133331] unifi2: Release f/w buffer e4a17000, 428

    It repeats several time and then stops

    <3>[ 89.759399] unifi2: cleanup_unifi_sdio: uf_free_netdevice
    <4>[ 89.766296] unifi: => uf_free_netdevice
    <3>[ 89.770324] unifi2: uf_free_netdevice
    <3>[ 89.774902] unifi2: uf_free_netdevice: netdev 0 d69ec000
    <4>[ 89.780456] unifi: <= uf_free_netdevice
    <3>[ 89.784484] unifi: cleanup_unifi_sdio: DONE.
    <4>[ 89.788940] unifi: <= cleanup_unifi_sdio
    <4>[ 89.793060] unifi: <= uf_glue_sdio_remove

    Any thing similar to what you had?

    ps i'm on Android. 

  • Hi Rafael

    I saw WF111 SDIO clock uses various frequencies, usually it runs slowly but sometimes it sets a higher frequency. My board worked fine @2MHz but it had SDIO errors when using higher frequency. Maybe your board has the same issues?. I modified omap_hsmmc driver to limit max frequency and it seems to work fine.

    Now I have a new hardware and WF111 runs OK @50MHz in AP mode, but I'm having problems with STA mode:

    root@am335x-evm:~# iwconfig wlan0 essid 'My Wi-Fi' key myweppassword
    [ 475.597290] unifi1: unifi_siwessid: Join failed, status -5
    Error for wireless request "Set ESSID" (8B1A) :
    SET failed on device wlan0 ; Input/output error.
    

    Note: I'm using driver version 5.2.2

    Regards

  • Hi Ford, I'm glad I could help!

    So, about the iperf test, could you give it another shot? My test just adds another parameter to the one you did:

    On Linux PC: iperf -s

    On AM335x board: iperf -c <IP> -w 2000

    When I do this I get a throughput of ~75 Kbits/sec, but my clock signal is stuck @1Mhz... I'm working with their support to figure this one out.

    Anyway, Bluegiga says this about the clock signal:

    "50 MHz is the absolute maximum, though 30 MHz is the highest recommended value to use under normal circumstances."

    Oh, and I also had some trouble with wpa_supplicant, but not with iwconfig. Regardless, none of the errors reported were relevant. In order to "fix" them I had to change the wpa_supplicant's source code so that wpa_driver_wext_disconnect() always sets its mode to IW_MODE_INFRA and I also commented the part that sets a random SSID. These were the only two modifications I made (both in the disconnect function).

    Even if you see the error massages wpa_supplicant prints, udhcpc -i wlan0 always gets an IP from the host (DHCP must be enabled).

    I'm using UniFi SDIO Driver: 5.1.0, wireless_tools 2.9 and wpa_supplicant 2.1. Both works when cross complied.

    Regards,

    DAVI

  • I just compiled and tested the new version of the driver (5.2.2-r1) and everything worked here. Even the throughput measure increased from ~75 Kbits/sec to 1.1 Mbits/sec.

    I would recommend using the same versions of wireless_tools in order to solve the problem...

    DAVI