Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: RE: Wi-Fi: BlueGiga WF111 SDIO Driver for AM335x Problem

$
0
0

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


Viewing all articles
Browse latest Browse all 25965

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>