2010-06-15 11:41:27     WiFi over GSPI Request

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-06-15 11:41:27     WiFi over GSPI Request

David Kasper (UNITED STATES)

Message: 90325   

 

I was wondering if it would be possible to add a tutorial supporting WiFi over GSPI (preferably using the Marvell 8686 and the BF-548 EZKIT)?  In the past I successfully demonstrated WiFi over SDIO using the tutorial but couldn't make it work via GSPI.  Do you think this is a minor task considering only the physical interface is different?

 

Thanks,

 

David Kasper

QuoteReplyEditDelete

 

 

2010-06-15 12:51:38     Re: WiFi over GSPI Request

Robin Getz (UNITED STATES)

Message: 90326   

 

David:

 

Do you mean GSPI as SDIO, or GSPI as SPI?

 

Its a different firmware in the marvel chipset.

 

-Robin

QuoteReplyEditDelete

 

 

2010-06-16 11:40:22     Re: WiFi over GSPI Request

David Kasper (UNITED STATES)

Message: 90339   

 

Robin,

 

I wish to demonstrate WiFi over GSPI (I am using a Wi2Wi module with the Marvel 8686). In the past I received some tips from Audrey (see below) but I was probably missing a simple step.  Hope this helps.

 

Thanks,

 

David Kasper

 

>>>>

 

Hi Dave.  I'm assuming that you wish the demonstrate the GSPI (rather than SDIO) variant of the WiFi module.  If that's the case then,

 

On Tue, Oct 13, 2009 at 3:53 PM, Javier Cardona <javier@cozybit.com> wrote:

> ---------- Forwarded message ----------

> From: Stephen Karlsgodt <karlsgodt@flatrock-audio.com>

> Date: Thu, Oct 8, 2009 at 9:48 AM

> Subject: Wi2Wi Driver questions

> To: javier@cozybit.com, David <david_kasper@cox.net>

> 1) Do I use libertas firmware files sd8686.bin and sd8686_helper.bin

> or different files?

 

You will need to use the GSPI firmware files (the file names you mention are for SDIO).  Please see:   wireless.kernel.org/en/users/Drivers/libertas ("gspi" under the "device firmware" section) for instructions on where to get these files (the linux-firmware tree) and what to rename them to in order for the driver to find them.

 

> 3) Can I load Marvell firmware from user space per the Blackfin

> uClinux WiFi procedure:

>   docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:wifi

> _o

> ver_sdio

 

The procedure is similar with the exception of selecting the Libertas GSPI driver in place of the SDIO driver and relying on the kernel hotplug to find and load the firmware.  However you'll first want to configure your kernel to include the libertas_spi platform device for your board and configure it accordingly (that is, choose the correct the IRQ and chip select pin as per your wiring).  Please note that the Blackfin SPI controller's chip select pins are not suitable for this WiFi device because they do not support multiple transactions: you will need to use a GPIO pin as a chip select, this is supported by the Blackfin SPI controller driver and is configured in your platform code.  The wiki page I mentioned has some additional notes about what's required in your board config under the "using the GSPI device" section.

 

Your blackfin rootfs should be configured to support the kernel's hotplug features for firmware loading.  This typically means that you have the following in /etc/rc:

 

if [ -e /bin/mdev ] ; then

    echo -n /bin/hotplug > /proc/sys/kernel/hotplug

    echo -n /bin/hotplug > /sys/kernel/uevent_helper

    /bin/mdev -s 2> /dev/null

fi

 

I've attached a same /etc/rc script that contains these lines.  Also you need to have a hotplug script (see attached).  If you don't already have /sbin/hotplug on your rootfs, copy the hotplug script to /sbin/hotplug on your rootfs and run 'chmod 0755 /sbin/hotplug' so that its executable.  If you already have a hotplug script, integrate the attached one as needed.

 

> 4) Should I use a different tutorial/procedure for demonstrating the

> module?

 

Once everything is compiled and deployed, simply boot up and then run:

 

# modprobe libertas_spi

 

If successful, you can then proceed to use the device.  For example, if the device comes up as wlan0, try: # ifconfig wlan0 up # iwlist wlan0 scan # iwconfig wlan0 essid mynetwork ...and so on.

 

> ============================================================

>

>

> I've included him on this email. Could you please help us out with

> these questions he has?

>

> Thank you!

>

> --

>

> Stephen Karlsgodt

>

> President & CEO

> Flatrock Audio, Inc.

>

> karlsgodt@flatrock-audio.com

> Phone: 310-408-0273

> Fax: 562-361-4018

>

>

>

> --

> Javier Cardona

> cozybit Inc.

>   www.cozybit.com

>

QuoteReplyEditDelete

 

 

2010-06-16 14:39:47     Re: WiFi over GSPI Request

Mike Frysinger (UNITED STATES)

Message: 90340   

 

that doesnt really answer the question of "what is 'GSPI' ?"  the answer seems to be "SPI + some pins for IRQs via GPIOs".

 

the tutorial isnt really any different from the SDIO version.  pick a SPI master instead of a SDIO master, and pick a SPI firmware instead of a SDIO firmware.

QuoteReplyEditDelete

 

 

2010-06-16 16:49:11     Re: WiFi over GSPI Request

Ian Jeffray (UNITED KINGDOM)

Message: 90347   

 

A note of warning.  Whilst GSPI is simple to set up (see example section for board file below), the current trunk libertas driver is broken - it is incredibly unreliable.  Revert the last major change, and all is well.   Specifically, the change to the internal buffering has been removed, which broke it.  I have mailed both John Linville and Andrey Yurovsky directly about this but had no response.   The commit I suggest you revert is this:   pu.mine.nu/4aP5mJJD4c  "libertas: remove internal buffers from GSPI driver" by Andrey.

 

My working libertas configuration.  Adjust GPIOs to taste:

 

#if defined(CONFIG_LIBERTAS_SPI) || defined(CONFIG_LIBERTAS_SPI_MODULE)

static struct bfin5xx_spi_chip libertas_spi_chip_info = {

      .enable_dma = 0,

      .bits_per_word = 16,

};

 

static int spi_libertas_setup(struct spi_device *spi)

{

      gpio_request(GPIO_PH14, "libertas_reset");

      gpio_direction_output(GPIO_PH14,0);

      udelay(1);

      gpio_set_value(GPIO_PH14,1);

      return 0;

}

 

static int spi_libertas_teardown(struct spi_device *spi)

{

      gpio_free(GPIO_PH14);

      return 0;

}

 

static struct libertas_spi_platform_data libertas_spi_data = {

      .use_dummy_writes = 0,

      .setup = spi_libertas_setup,

      .teardown = spi_libertas_teardown,

};

#endif

 

#if defined(CONFIG_LIBERTAS_SPI) || defined(CONFIG_LIBERTAS_SPI_MODULE)

      {

        .modalias = "libertas_spi",

        .max_speed_hz = 33000000,     /* max spi clock (SCK) speed in HZ */

        .bus_num = 0,

        .chip_select = GPIO_PF13 + MAX_CTRL_CS,

        .irq = IRQ_PH15,

        .platform_data = &libertas_spi_data,

        .controller_data = &libertas_spi_chip_info,

        .mode = SPI_MODE_3,

    },

#endif

 

QuoteReplyEditDelete

 

 

2010-06-17 10:40:31     Re: WiFi over GSPI Request

David Kasper (UNITED STATES)

Message: 90377   

 

Robin,

 

The same DMA channel shared with the NAND FLASH controller (NFC) and SDIO creates a resource conflict.  Therefore my thought was to interface WiFi via GSPI because I also need  NFC functionality.  Let me know if I have missed something.  Assuming I have the latest broken code then what is the syntax to revert a commit ("libertas: remove internal buffers from GSPI driver" per Ian's remark above)?

 

Mike,

 

Just in case I wasn't clear the definition of GSPI from   wireless.kernel.org/en/users/Drivers/libertas is noted below:

 

GSPI devices are intended to be used in embedded systems. They require an IRQ line (driven by the WiFi device) and that the SPI host controller is able to keep the Chip Select signal asserted through multiple bus accesses.

 

Thanks,

 

David Kasper

QuoteReplyEditDelete

 

 

2010-06-17 12:01:26     Re: WiFi over GSPI Request

Robin Getz (UNITED STATES)

Message: 90379   

 

Ian:

 

You might get better luck on things like this on the libertas-dev at lists.infradead.org mailing list.

 

-Robin

Attachments

    Outcomes