AnsweredAssumed Answered

SD card problems

Question asked by peterkampmann on Nov 21, 2011
Latest reply on Nov 24, 2011 by Aaronwu

Hi everybody,

 

I am currently stuck with getting my sd card running on a custom board.

I tried the current 2010R1-RC and 2010R1-RC4 release of the uclinux Distribution from the website.

The sd card seems to respond fine (cards i tried: Sandisk 1 GB and Sandisk 4GB):

 

dmesg | grep spi
bfin-spi bfin-spi.1: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
mmc_spi spi1.0: ASSUMING 3.2-3.4 V slot power
mmc_spi spi1.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
mmc_spi spi1.0: mmc_spi: power up (21)
mmc_spi spi1.0: mmc_spi: power on (21)
mmc_spi spi1.0: can't change chip-select polarity
mmc_spi spi1.0: mmc_spi:  clock to 400000 Hz, 0
mmc_spi spi1.0:   mmc_spi: CMD52, resp R2/R5
mmc_spi spi1.0:   mmc_spi: CMD52, resp R2/R5
mmc_spi spi1.0:   mmc_spi: CMD0, resp R1
mmc_spi spi1.0:   mmc_spi: CMD8, resp R3/R4/R7
mmc_spi spi1.0:   mmc_spi: CMD5, resp R3/R4/R7
mmc_spi spi1.0:   mmc_spi: CMD5, resp R3/R4/R7
mmc_spi spi1.0:   mmc_spi: CMD5, resp R3/R4/R7
mmc_spi spi1.0:   mmc_spi: CMD5, resp R3/R4/R7
mmc_spi spi1.0:   mmc_spi: CMD55, resp R1
mmc_spi spi1.0:   mmc_spi: CMD55, resp R1
mmc_spi spi1.0:   mmc_spi: CMD55, resp R1
mmc_spi spi1.0:   mmc_spi: CMD55, resp R1
mmc_spi spi1.0:   mmc_spi: CMD1, resp R1
mmc_spi spi1.0: mmc_spi: power off (0)0

 

But does power off at the end and thus seems not to be mountable. My configuration in the board file looks like this:

 

#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
#define MMC_SPI_CARD_DETECT_INT IRQ_PF10

 

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, "mmc-spi-detect", data);
//    return 0;
}

 

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 = 5000000,     /* max spi clock (SCK) speed in HZ */
        .bus_num = 1,
        .chip_select = GPIO_PF10,
         .irq = IRQ_PF10,
        .platform_data = &bfin_mmc_spi_pdata,
        .controller_data = &mmc_spi_chip_info,
        .mode = SPI_MODE_3,
    }
#endif
};

 

I've also attached the complete bootlog to this post, if this might help.

 

Is there something I misconfigured that can be seen from that? Any help is welcome :-)

 

Peter

Attachments

Outcomes