ARM, SDIO over SPI & 88W8686 firmware loading issue

Julien Boibessot julien.boibessot at free.fr
Tue Mar 18 18:01:56 EDT 2008


Hi Arthur,

Mielimonka Arthur a écrit :
> I just wanted to do some similar work (I wanted to connect an ARM7TDMI
> LPC2468 board with the Marvell 8686) when I read your post at this
> mailing list. 
>   
I hope you will have more success than me...
Do you already have Linux working for your platform ?
> Would you explain how you accessed the WLAN adapter? I assume you
> exchanged the if_sdio interface by an if_spi interface and replaced the
> sdio_readb and sido_writesb functions by similar spi_read & _write
> functions?
>
>   
In fact I'm using the Linux SDIO over SPI & Libertas drivers that were 
recently included in 2.6.24 series.
I didn't write any specific code.
> Did you also plan to integrate an interrupt service? If yes, how?
>   
I might be wrong but in Linux SDIO stack they use a poller thread to 
handle "interrupt" requests from SDIO devices.
I didn't plan anything because I still didn't manage to successfully 
download chip's firmware in SPI mode.
> If you don't mind it would be nice if you would send me your code?
>   
It's Linux code so...
 http://lxr.linux.no/linux+v2.6.24.1/drivers/net/wireless/libertas/    
for libertas part
and
 http://lxr.linux.no/linux+v2.6.24.1/drivers/mmc/host/mmc_spi.c   for 
MMC/SDIO over SPI part
Of course it assumes that you have a SPI generic driver for your platform:
 http://lxr.linux.no/linux+v2.6.24.1/drivers/spi/   (mine is imx one)

Then in you platform specific initialisation file (in 
arch/arm/mach-xxx/board.c for ex) you have to declare something like 
that (I only put "big steps" here):

static struct spi_imx_chip libertas_hw = {
        .cs_control             = libertas_cs,
};
...
static struct mmc_spi_platform_data libertas_mmc_pdata = {
        .init           = mmc_slot_init,
        .exit           = mmc_slot_exit,
        .detect_delay   = 700,  /* msecs */
       .ocr_mask       = MMC_VDD_32_33 | MMC_VDD_33_34,
};
...
static struct spi_board_info spi_board_info[] __initdata = {
...
 {
       .modalias = "mmc_spi",
       .bus_num = 1,
       .controller_data = &libertas_hw,
       .chip_select = 0,
       .mode = 0,
       .max_speed_hz = 1000000,
       .platform_data = &libertas_mmc_pdata,
  }
};
...
and register all the stuff to the Linux SPI API:

  spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));

and as soon as you plug your SDCard the chip is detected and Linux SDIO 
layers are started, libertas stack is called, etc...

Let me know if you manage to go further than loading the first stage 
firmware (helper) !!

Regards,
Julien
http://www.armadeus.org




More information about the libertas-dev mailing list