2010-06-16 02:23:33     Problem with mmc_spi

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

2010-06-16 02:23:33     Problem with mmc_spi

Markus Rankl (GERMANY)

Message: 90334   

 

Hi,

 

we have a custom Board based on BF548-EZKIT design. Recently we updated to uClinux 2009R1.1. Since that time the microSD card doesn't work anymore. It uses mmc_spi with chip select 3.

 

our boardfile:

--------------------------

/* SPI controller data */

static struct bfin5xx_spi_master bf54x_spi_master_info0 = {

  .num_chipselect = 3,

  .enable_dma = 1,  /* master has the ability to do dma transfer */

  .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},

};

 

static struct spi_board_info bfin_spi_board_info[] __initdata = {

...

#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)

{

  .modalias = "mmc_spi",

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

  .bus_num = 0,

  .chip_select = 3,

  .platform_data = &bfin_mmc_spi_pdata,

  .controller_data = &mmc_spi_chip_info,

  .mode = SPI_MODE_3,

},

#endif

...

};

 

bootprompt:

------------------

bfin-spi bfin-spi.0: cs3 >= max 3

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0,

regs_base@ffc00500, dma channel@4

bfin-spi bfin-spi.1: Blackfin on-chip SPI Controller Driver, Version 1.0,

regs_base@ffc02300, dma channel@5

 

 

spi.c:

--------------------------

/* Chipselects are numbered 0..max; validate. */

if (spi->chip_select >= spi->master->num_chipselect) {   <--- it happens here (3==3)

  dev_err(dev, "cs%d >= max %d\n",

    spi->chip_select,

    spi->master->num_chipselect);

  return -EINVAL;

}

 

With git commit b6fb63a5c0998d2c1da8a43a97cfa973e78d85e6 num_chipselect in the boardfile of the ezkit was reduced from 8 to 3. Now I could set it to 8 again but i don't know if this is right.

 

-Markus

TranslateQuoteReplyEditDelete

 

 

2010-06-16 15:10:44     Re: Problem with mmc_spi

Mike Frysinger (UNITED STATES)

Message: 90341   

 

the issue is that the HRM names SSELs starting with 1, but everything else expects them starting at 0.  so to workaround the issue, you should change the board info from '3' to '4'.

 

i'll open a tracker item to address the larger problem.

QuoteReplyEditDelete

Attachments

    Outcomes