2009-11-04 03:59:04     MMC error using uclinux 2009R1?

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

2009-11-04 03:59:04     MMC error using uclinux 2009R1?

Tony Liu (CHINA)

Message: 82051   

 

CPU: BF531 V0.5

 

OS: uclinux-2009R1

 

Boot info:

 

mmc_spi spi0.3: ASSUMING 3.2-3.4 V slot power

 

mmc_spi spi0.3: SD/MMC host mmc0, no DMA, no WP, no poweroff

 

Freeing unused kernel memory: 5068k freed

 

mmc_spi spi0.3: requested mode not fully supported

 

mmc_spi spi0.3: can't change chip-select polarity

 

dma_alloc_init: dma_page @ 0x00187000 - 1024 pages at 0x01c00000

 

mmc0: error -110 whilst initialising SD card

 

Source code:linux-2.6.x\arch\blackfin\mach-bf533\boards\ezkit.c

 

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

 

#define MMC_SPI_CARD_DETECT_INT IRQ_PF5

 

static int bfin_mmc_spi_init(struct device *dev, irqreturn_t (*detect_int)(int, void *), void *data)

 

{

 

return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,

 

"mmc-spi-detect", data);

 

}

 

static void bfin_mmc_spi_exit(struct device *dev, void *data)

 

{

 

free_irq(MMC_SPI_CARD_DETECT_INT, data);

 

}

 

static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {

 

.init = bfin_mmc_spi_init,

 

.exit = bfin_mmc_spi_exit,

 

.detect_delay = 100, /* msecs */

 

};

 

static struct bfin5xx_spi_chip  mmc_spi_chip_info = {

 

.enable_dma = 0,

 

.bits_per_word = 8,

 

};

 

#endif

 

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

 

...........................

 

}

 

root:/> cat /proc/gpio

 

GPIO_0:         scl             GPIO INPUT

 

GPIO_1:         sda             GPIO INPUT

 

GPIO_3:         mmc_spi                 Peripheral

 

GPIO_5:         gpio-irq38              GPIO INPUT

 

root:/> cat /proc/devices

 

Character devices:

 

  1 mem

 

  5 /dev/tty

 

  5 /dev/console

 

  5 /dev/ptmx

 

10 misc

 

128 ptm

 

136 pts

 

204 ttyBF

 

254 rtc

 

Block devices:

 

  1 ramdisk

 

259 blkext

 

179 mmc

 

Insert the SD card again & again, system report:

 

root:/> mmc_spi spi0.3: requested mode not fully supported

 

mmc_spi spi0.3: can't change chip-select polarity

 

mmc_spi spi0.3: requested mode not fully supported

 

mmc_spi spi0.3: can't change chip-select polarity

 

mmc0: error -110 whilst initialising SD card

 

mmc_spi spi0.3: requested mode not fully supported

 

mmc_spi spi0.3: can't change chip-select polarity

 

mmc_spi spi0.3: requested mode not fully supported

 

mmc_spi spi0.3: can't change chip-select polarity

 

mmc0: error -84 whilst initialising SD card

 

 

 

Why & How to do?

 

Thanks!

QuoteReplyEditDelete

 

 

2009-11-04 10:53:01     Re: MMC error using uclinux 2009R1?

Ian Jeffray (UNITED KINGDOM)

Message: 82058   

 

Hi Tony,

 

I've also had a lot of trouble with the new MMC driver.   Basically I can't get it to work at all unless the SD card is in the slot at bootup.  If it's ever removed, it never works again until a powercycle.   I got all the same errors as you too... but I noticed that not all of Wolfgang Muees's patches have been applied... I added the last one myself, which did seem to help things.... check this thread carefully, especially message ID 72042:

 

https://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=ForumMessageBrowse&thread_id=31066&action=ForumBrowse&forum_id=39

 

I'm also only getting mediocre performance out of the SD interface, even with an insane £80 SanDisk Extreme SDHC 16GB card... only about 1MB/sec.

QuoteReplyEditDelete

 

 

2009-11-04 22:19:16     Re: MMC error using uclinux 2009R1?

Yi Li (CHINA)

Message: 82067   

 

Tony,

 

In many case, the intialization error is caused by missing pull-up resistors  - "In order to operate the SD/MMC Cards in SPI Mode 3 it is recommended to have 10kOhm Pull-Up Resistors to VDD on Blackfin SPI_SSELx, SPI_SCK, SPI_MISO and SPI_MOSI. "

 

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

 

Ian,

 

Wolfgang's posted his patch to LKML, get reviewed and accepted by mainline kernel (2009R1 uses the same mmc spi driver as mainline kernel) - So if you think there are missing patch that may solve your problem, may you can dissuss that on LKML?

 

 

For the performance -  I think 1MB/sec seems to be reasonable due to the SPI clock frequency.

 

-Yi

Attachments

    Outcomes