2009-01-28 05:04:31     mmc_spi not working

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

2009-01-28 05:04:31     mmc_spi not working

Mark Urup (DENMARK)

Message: 68461   

 

I've been trying to get a mmc/sd card up and running on our platform (a custom bf537 board).

 

Depending on what cards i'm trying with, I get either:

 

error -84 whilst initialising SD card, error -110 whilst initialising SD card or error -110 whilst initialising MMC card.

 

As I've understood it, -84 means that the card does not respond byte-aligned.

 

Going through the dmesg output below, I see that -110 is a read error, generated at mmc_spi_readblock(...) in mmc_spi.c, unfortunately thats where my understanding stops.

 

dmesg gives me:

 

mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0

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

mmc0: clock 0Hz busmode 0 powermode 0 cs 0 Vdd 0 width 0 timing 0

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

mmc0: clock 0Hz busmode 2 powermode 1 cs 1 Vdd 21 width 0 timing 0

mmc_spi spi0.4: mmc_spi: power up (21)

mmc0: clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 0 timing 0

mmc_spi spi0.4: mmc_spi: power on (21)

mmc_spi spi0.4: requested mode not fully supported

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

mmc_spi spi0.4: mmc_spi:  clock to 400000 Hz, 0

mmc0: starting CMD0 arg 00000000 flags 000000c0

mmc_spi spi0.4:   mmc_spi: CMD0, resp R1

mmc0: req done (CMD0): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD8 arg 000001aa flags 000002f5

mmc_spi spi0.4:   mmc_spi: CMD8, resp R3/R4/R7

mmc0: req done (CMD8): 0: 00000001 000001aa 00000000 00000000

mmc0: starting CMD5 arg 00000000 flags 000002e1

mmc_spi spi0.4:   mmc_spi: CMD5, resp R3/R4/R7

mmc_spi spi0.4:   ... CMD5 response SPI_R3/R4/R: resp 0005 ffffffff

mmc0: req done (CMD5): -22: 00000005 ffffffff 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 00000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD0 arg 00000000 flags 000000c0

mmc_spi spi0.4:   mmc_spi: CMD0, resp R1

mmc0: req done (CMD0): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD58 arg 00000000 flags 00000280

mmc_spi spi0.4:   mmc_spi: CMD58, resp R3/R4/R7

mmc0: req done (CMD58): 0: 00000001 80ff8000 00000000 00000000

mmc0: clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 20 width 0 timing 0

mmc0: starting CMD0 arg 00000000 flags 000000c0

mmc_spi spi0.4:   mmc_spi: CMD0, resp R1

mmc0: req done (CMD0): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD8 arg 000001aa flags 000002f5

mmc_spi spi0.4:   mmc_spi: CMD8, resp R3/R4/R7

mmc0: req done (CMD8): 0: 00000001 000001aa 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000000 00000000 00000000 00000000

mmc0: starting CMD59 arg 00000001 flags 00000080

mmc_spi spi0.4:   mmc_spi: CMD59, resp R1

mmc0: req done (CMD59): 0: 00000000 00000000 00000000 00000000

mmc0: starting CMD10 arg 00000000 flags 000000b5

mmc0:     blksz 16 blocks 1 flags 00000200 tsac 0 ms nsac 64

mmc_spi spi0.4:   mmc_spi: CMD10, resp R1

mmc_spi spi0.4:     mmc_spi: read block, 16 bytes

mmc_spi spi0.4: read error ffffff92 (-110)

mmc_spi spi0.4: read status -110

mmc0: req done (CMD10): 0: 00000000 00000000 00000000 00000000

mmc0:     0 bytes transferred: -110

mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0

mmc_spi spi0.4: mmc_spi: power off (0)

mmc0: error -110 whilst initialising SD card

mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0

 

 

 

The read error is the same for all cards that give the -110 error.

 

The cards i've tested are:

Kingston 1gb (-110), sandisk ultra 2 (-84) and a nokia 32 mb mmc card (-110).

 

 

 

I've also tried with a sandisk sdhc 8gb card, this gives a crc error at cmd10, so I tried loading the mmc_core with use_spi_crc=0, after loading mmc_spi I got error -22.

 

dmesg outpu then gives (the the sdhc card only):

 

mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0

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

mmc0: clock 0Hz busmode 0 powermode 0 cs 0 Vdd 0 width 0 timing 0

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

mmc0: clock 0Hz busmode 2 powermode 1 cs 1 Vdd 21 width 0 timing 0

mmc_spi spi0.4: mmc_spi: power up (21)

mmc0: clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 0 timing 0

mmc_spi spi0.4: mmc_spi: power on (21)

mmc_spi spi0.4: requested mode not fully supported

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

mmc_spi spi0.4: mmc_spi:  clock to 400000 Hz, 0

mmc0: starting CMD0 arg 00000000 flags 000000c0

mmc_spi spi0.4:   mmc_spi: CMD0, resp R1

mmc0: req done (CMD0): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD8 arg 000001aa flags 000002f5

mmc_spi spi0.4:   mmc_spi: CMD8, resp R3/R4/R7

mmc0: req done (CMD8): 0: 00000001 000001aa 00000000 00000000

mmc0: starting CMD5 arg 00000000 flags 000002e1

mmc_spi spi0.4:   mmc_spi: CMD5, resp R3/R4/R7

mmc_spi spi0.4:   ... CMD5 response SPI_R3/R4/R: resp 0005 ffffffff

mmc0: req done (CMD5): -22: 00000005 ffffffff 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 00000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD0 arg 00000000 flags 000000c0

mmc_spi spi0.4:   mmc_spi: CMD0, resp R1

mmc0: req done (CMD0): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD58 arg 00000000 flags 00000280

mmc_spi spi0.4:   mmc_spi: CMD58, resp R3/R4/R7

mmc0: req done (CMD58): 0: 00000001 40ff8000 00000000 00000000

mmc0: clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 20 width 0 timing 0

mmc0: starting CMD0 arg 00000000 flags 000000c0

mmc_spi spi0.4:   mmc_spi: CMD0, resp R1

mmc0: req done (CMD0): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD8 arg 000001aa flags 000002f5

mmc_spi spi0.4:   mmc_spi: CMD8, resp R3/R4/R7

mmc0: req done (CMD8): 0: 00000001 000001aa 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc0: req done (CMD41): 0: 00000000 00000000 00000000 00000000

mmc0: starting CMD59 arg 00000000 flags 00000080

mmc_spi spi0.4:   mmc_spi: CMD59, resp R1

mmc0: req done (CMD59): 0: 00000000 00000000 00000000 00000000

mmc0: starting CMD10 arg 00000000 flags 000000b5

mmc0:     blksz 16 blocks 1 flags 00000200 tsac 0 ms nsac 64

mmc_spi spi0.4:   mmc_spi: CMD10, resp R1

mmc_spi spi0.4:     mmc_spi: read block, 16 bytes

mmc0: req done (CMD10): 0: 00000001 00000000 00000000 00000000

mmc0:     16 bytes transferred: 0

mmc0: starting CMD9 arg 00000000 flags 000000b5

mmc0:     blksz 16 blocks 1 flags 00000200 tsac 0 ms nsac 64

mmc_spi spi0.4:   mmc_spi: CMD9, resp R1

mmc_spi spi0.4:     mmc_spi: read block, 16 bytes

mmc0: req done (CMD9): 0: 00000001 00000000 00000000 00000000

mmc0:     16 bytes transferred: 0

mmc0: unrecognised CSD structure version 2

mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0

mmc_spi spi0.4: mmc_spi: power off (0)

mmc0: error -22 whilst initialising SD card

mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0

 

Is this just a question of using the "right" card, or are there something wrong in the driver or in our HW?

 

I've disabled every other spi device driver in the kernel that I could think of, so they woulden't interfear; I have enabled spi_locking however.

QuoteReplyEditDelete

 

 

2009-01-28 14:28:33     Re: mmc_spi not working

Mike Frysinger (UNITED STATES)

Message: 68491   

 

what version of software are you using ?  spi_mmc is really only stable in current svn trunk ...

QuoteReplyEditDelete

 

 

2009-02-02 07:58:00     Re: mmc_spi not working

Mark Urup (DENMARK)

Message: 68666   

 

uclinux is at svn rev. 7697 and toolchain at rev. 3132

 

I've attached a plot image, taken from our scope (200000x480px).

From the top: clk, chip select, miso and mosi.

The plot is for a sd-card that gives a -110 error.

 

 

I'm clueless here, because as I see it, the communication between card and host looks fine (or am I missing something?)

 

Is it a card issue, is the driver still buggy or is it a hardware error on our end?

 

detailed_plot.png

QuoteReplyEditDelete

 

 

2009-02-02 11:34:31     Re: mmc_spi not working

Mike Frysinger (UNITED STATES)

Message: 68680   

 

the file you posted transferred fine, but i think it's corrupt or not actually a png

QuoteReplyEditDelete

 

 

2009-02-02 22:35:34     Re: mmc_spi not working

Yi Li (CHINA)

Message: 68695   

 

Mark,

 

What is you mmc_spi driver revision? You can check by "svn log mmc_spi.c", mine is r5956. Also the revision of spi driver: spi/spi_bfin5xx.c?

 

You may also enable debug message in spi_bfin5xx.c to see what is happening.

 

-Yi

QuoteReplyEditDelete

 

 

2009-02-03 07:13:15     Re: mmc_spi not working

Mark Urup (DENMARK)

Message: 68721   

 

Hi Yi and Mike,

 

mmc_spi.c is at rev. 5956 and spi_bfin5xx.c is at  rev. 5958

 

 

 

The image i've uploaded is png, but the large size (200000*480px) is apparently more than the png format can handle. It opens correctly in gimp however.

 

The SD card is inserted before modprobing mmc_spi, but after the board has finished booting.

 

Output (with spi_bfin debug enabled):

root:/> modprobe mmc_spi

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

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

mmc_spi spi0.4: requested mode not fully supported

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

root:/> mmc0: error -110 whilst initialising SD card

 

root:/> dmesg

ump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 40000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000000 00000000 00000000 00000000

mmc0: starting CMD59 arg 00000001 flags 00000080

mmc_spi spi0.4:   mmc_spi: CMD59, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd711

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd711

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD59): 0: 00000000 00000000 00000000 00000000

mmc0: starting CMD10 arg 00000000 flags 000000b5

mmc0:     blksz 16 blocks 1 flags 00000200 tsac 0 ms nsac 64

mmc_spi spi0.4:   mmc_spi: CMD10, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 9

bfin-spi bfin-spi.0: tx_buf is 07ddd700, tx_end is 07ddd709

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd709

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 9

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4:     mmc_spi: read block, 16 bytes

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd601

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd701

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd601

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd701

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd601

bfin-spi bfin-spi.0: rx_buf is 07ddd700, rx_end is 07ddd701

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: read error ffffff92 (-110)

mmc_spi spi0.4: read status -110

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD10): 0: 00000000 00000000 00000000 00000000

mmc0:     0 bytes transferred: -110

mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0

mmc_spi spi0.4: mmc_spi: power off (0)

mmc0: error -110 whilst initialising SD card

mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0

 

 

 

As far as I can see, the read error is because the mmc_spi driver expects to get a 0xfe response (start block) for a cmd10, but elseware in the dmsg output I see "mmc_spi spi0.4:   mmc_spi: CMD10, resp R1".

The card responds with a R1 (0x01) to cmd10.

According to the sd specs I've read cmd10 should be responded with a R1.

 

The last data sequence sent to the card is: 0x69,0x40,0x00,0x00,0x00, 0x77

The card responds with 0x01, and then I get the read error.

 

What is the correct behaviour here?

QuoteReplyEditDelete

 

 

2009-02-03 08:24:54     Re: mmc_spi not working

Wolfgang Muees (GERMANY)

Message: 68763   

 

Hmmm.

 

For the SDHC card, you get an "unrecognised CSD structure version 2".

 

So the first 2 bits in the CSD structure are "10". They SHOULD be "01".

 

So this might be an off-by-one-bit error in receiving the CSD.

 

You may want to dump out the received bytes and compare them against the standard.

 

regards

 

Wolfgang

TranslateQuoteReplyEditDelete

 

 

2009-02-04 04:01:40     Re: mmc_spi not working

Yi Li (CHINA)

Message: 68815   

 

The read error is ETIMEDOUT (-110), comes from mmc_spi_readblock() -> mmc_spi_readtoken():  the host expects SPI_TOKEN_SINGLE(0xFE) but it cannot get it. We have tested the latest driver with more than 10 Transend / Sandisk SD/MMC cards, all work well till now. Could you try to find more SD/MMC card and test? I am not sure I can get a 1GB Kingstone SD card you used to have a test on my side.

 

If reading the svn log and previous post on this forum, Wolfgang Muees fixed some bugs in spi_bfin5xx.c, also fixed some issues in mmc_spi.c driver to make many cards work. But it may be possile some cards still cannot work with existing drivers.

 

-Yi

 

 

QuoteReplyEditDelete

 

 

2009-02-04 10:28:20     Re: mmc_spi not working

Mark Urup (DENMARK)

Message: 68853   

 

I'm trying with 7 different sd/mmc cards, most of them give a -84 or a -110 error.

A single card (128mb integrated memory rs-mmc) gives a -5 error.

 

The cards:

 

sandisk microsd 2 gb: error -84/kernel error

sandisk microsdhc 8 gb: error -84/error -22

no-name sd card 64mb: error -84/kernel error

kingston sd card 1 gb: error -110/error -110

blacks sd card 256 mb (this card came with the bf548 ez-kit): error -84/kernel error

 

nokia mmc 32 mb: error -110/error -110

integrated memory rs-mmc 128 mb: error -5

 

 

Each time a the the -84 error, it's a crc error, as shown by dmesg output:

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

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

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

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

mmc0: error -84 whilst initialising SD card

 

root:/> dmesg  -c

0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 00000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 00000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 00000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 00000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 00000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000

mmc0: starting CMD41 arg 00000000 flags 000000e1

mmc_spi spi0.4:   mmc_spi: CMD41, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD41): 0: 00000000 00000000 00000000 00000000

mmc0: starting CMD59 arg 00000001 flags 00000080

mmc_spi spi0.4:   mmc_spi: CMD59, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337571

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337571

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD59): 0: 00000000 00000000 00000000 00000000

mmc0: starting CMD10 arg 00000000 flags 000000b5

mmc0:     blksz 16 blocks 1 flags 00000200 tsac 0 ms nsac 64

mmc_spi spi0.4:   mmc_spi: CMD10, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 9

bfin-spi bfin-spi.0: tx_buf is 00337560, tx_end is 00337569

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337569

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 9

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd000, tx_end is 006bd001

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337561

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4:     mmc_spi: read block, 16 bytes

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd000, tx_end is 006bd001

bfin-spi bfin-spi.0: rx_buf is 00337560, rx_end is 00337561

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 16

bfin-spi bfin-spi.0: tx_buf is 006bd000, tx_end is 006bd010

bfin-spi bfin-spi.0: rx_buf is 006bffc0, rx_end is 006bffd0

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 16

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: still running ...

bfin-spi bfin-spi.0: tx_buf is 006bd000, tx_end is 006bd002

bfin-spi bfin-spi.0: rx_buf is 0033757e, rx_end is 00337580

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 2

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: read - crc error: crc_val=0x0f7f, computed=0x0f7e len=16

mmc_spi spi0.4: read status -84

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD10): 0: 00000001 00000000 00000000 00000000

mmc0:     0 bytes transferred: -84

mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0

mmc_spi spi0.4: mmc_spi: power off (0)

mmc0: error -84 whilst initialising SD card

mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0

root:/>

 

The error is always the same, it's off by exactly 1 in the crc field.

 

If I set use_spi_crc=0, I get this module error on cards previously giving me a -84 error:

 

 

root:/> modprobe mmc_core use_spi_crc=0

root:/> modprobe mmc_spi

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

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

mmc_spi spi0.4: requested mode not fully supported

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

root:/> mmc0: card lacks mandatory switch function, performance might suffer.

------------[ cut here ]------------

WARNING: at drivers/mmc/core/core.c:424 _mmc_set_clock+0x8e/0x90 [mmc_core]()

Modules linked in: mmc_spi crc7 crc_itu_t mmc_core hid_cherry hid_pl hid_microsoft [last unloaded: mmc_core]

Hardware Trace:

   0 Target : <0x000048bc> { _dump_stack + 0x0 }

     Source : <0x0000f640> { _warn_on_slowpath + 0x44 } CALL pcrel

   1 Target : <0x0000f640> { _warn_on_slowpath + 0x44 }

     Source : <0x0002a08a> { _print_modules + 0x7a } RTS

   2 Target : <0x0002a084> { _print_modules + 0x74 }

     Source : <0x0000fcce> { _printk + 0x16 } RTS

   3 Target : <0x0000fcca> { _printk + 0x12 }

     Source : <0x000104ce> { _vprintk + 0x12a } RTS

   4 Target : <0x000104ae> { _vprintk + 0x10a }

     Source : <0x000105ee> { _vprintk + 0x24a } JUMP.S

   5 Target : <0x000105ee> { _vprintk + 0x24a }

     Source : <0x0000fb3e> { _wake_up_klogd + 0x1a } RTS

   6 Target : <0x0000fb3e> { _wake_up_klogd + 0x1a }

     Source : <0x0000fb30> { _wake_up_klogd + 0xc } IF !CC JUMP

   7 Target : <0x0000fb24> { _wake_up_klogd + 0x0 }

     Source : <0x0000ff54> { _release_console_sem + 0x1ac } JUMP.L

   8 Target : <0x0000ff4c> { _release_console_sem + 0x1a4 }

     Source : <0x0000ff40> { _release_console_sem + 0x198 } IF !CC JUMP

   9 Target : <0x0000ff3c> { _release_console_sem + 0x194 }

     Source : <0x0000ff2e> { _release_console_sem + 0x186 } IF !CC JUMP

  10 Target : <0x0000ff28> { _release_console_sem + 0x180 }

     Source : <0x00022b3e> { _up + 0x36 } RTS

  11 Target : <0x00022b38> { _up + 0x30 }

     Source : <0x00022b2a> { _up + 0x22 } IF !CC JUMP

  12 Target : <0x00022b08> { _up + 0x0 }

     Source : <0x0000ff24> { _release_console_sem + 0x17c } CALL pcrel

  13 Target : <0x0000ff10> { _release_console_sem + 0x168 }

     Source : <0x0000fdfa> { _release_console_sem + 0x52 } IF !CC JUMP

  14 Target : <0x0000fdca> { _release_console_sem + 0x22 }

     Source : <0x0000fef2> { _release_console_sem + 0x14a } IF !CC JUMP

  15 Target : <0x0000feec> { _release_console_sem + 0x144 }

     Source : <0x0000fa9a> { __call_console_drivers + 0x7a } RTS

Stack info:

SP: [0x0020dde0] <0x0020dde0> /* kernel dynamic memory */

FP: (0x0020dedc)

Memory from 0x0020dde0 to 0020e000

0020dde0:[0000f640]<0000f644> 0020de00  004b73e0  00000000  004b73e0  000001a8  0020de00

0020de00: 636d6d5f  7465735f  6f6c635f  302b6b63  2f653878  30397830  6d6d5b20  6f635f63

0020de20: 005d6572  00000000  00000000  00000000  00000000  00000000  00000000  00000000

0020de40: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

0020de60: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

0020de80: 0000000a  00000006  00000010  00000000  003d0900  0020df24  0020dea0  0000ffff

0020dea0: 00000000  00000200  00000008  00000000  0020dee8  00000001  0020defc  00000033

0020dec0: 00000000  00000001  00000000  00000000  00000000  000000b5  00000000 (00000000)

0020dee0:<004b0ef2> 00000000  00000000  0020c000  0047e400  006bd13c  006bd000  00000000

0020df00: 0020c000  0020dfac  00000000 <004b36b2> 0047e400 <004b3746> 0047e400  006bd13c

0020df20: 00000000  0047e490  00000000  00000000  00000000  06a688a6  aa60648f  0021c81f

0020df40: f400e986  0020c000 <004b12e4> 0047e400  006bfde0  004b115c  0020df68  00000000

0020df60: 00ff8000  070fc4e0  ffffffff <0001c666> 0047e580  0018eab0  0020c000  00000000

0020df80:<0001cff6> 0020c000  00000000 <0001cfd0> 0020c000  0020c000  006bfde0  006bfde8

0020dfa0: 070fc4e0  00000000  00000000  00000000  07dbb080  0001f714  0020dfb8  0020dfb8

0020dfc0:<0001f340> 0001cf54  00000000  00000000  006bfde0  00000000  00000000  00000000

0020dfe0: 00000000  00000000 <0000144e> 00000000  00000000  00000000  ffffffff  00000006

0020e000: 07dbb980

Return addresses in stack:

    address : <0x0000f640> { _warn_on_slowpath + 0x44 }

    address : <0x0000f644> { _warn_on_slowpath + 0x48 }

   frame  1 : <0x004b0ef2> { :mmc_core:_mmc_set_clock + 0x8e }

    address : <0x004b36b2> { :mmc_core:_mmc_attach_sd + 0x502 }

    address : <0x004b3746> { :mmc_core:_mmc_attach_sd + 0x596 }

    address : <0x004b12e4> { :mmc_core:_mmc_rescan + 0x188 }

    address : <0x0001c666> { _run_workqueue + 0x72 }

    address : <0x0001cff6> { _worker_thread + 0xa2 }

    address : <0x0001cfd0> { _worker_thread + 0x7c }

    address : <0x0001f340> { _kthread + 0x50 }

    address : <0x0000144e> { _kernel_thread_helper + 0x6 }

---[ end trace ca18f08eb493e98e ]---

mmc0: host does not support reading read-only switch. assuming write-enable.

mmc0: new SD card on SPI

 

root:/> dmesg -c

spi.0: tx_buf is 006bd600, tx_end is 006bd610

bfin-spi bfin-spi.0: rx_buf is 006bfd20, rx_end is 006bfd30

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 16

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: still running ...

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd602

bfin-spi bfin-spi.0: rx_buf is 0058a4be, rx_end is 0058a4c0

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 2

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD10): 0: 00000001 00000000 00000000 00000000

mmc0:     16 bytes transferred: 0

mmc0: starting CMD9 arg 00000000 flags 000000b5

mmc0:     blksz 16 blocks 1 flags 00000200 tsac 0 ms nsac 64

mmc_spi spi0.4:   mmc_spi: CMD9, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 9

bfin-spi bfin-spi.0: tx_buf is 0058a4a0, tx_end is 0058a4a9

bfin-spi bfin-spi.0: rx_buf is 0058a4a0, rx_end is 0058a4a9

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 9

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd601

bfin-spi bfin-spi.0: rx_buf is 0058a4a0, rx_end is 0058a4a1

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4:     mmc_spi: read block, 16 bytes

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd601

bfin-spi bfin-spi.0: rx_buf is 0058a4a0, rx_end is 0058a4a1

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd601

bfin-spi bfin-spi.0: rx_buf is 0058a4a0, rx_end is 0058a4a1

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 16

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd610

bfin-spi bfin-spi.0: rx_buf is 006bfd20, rx_end is 006bfd30

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 16

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: still running ...

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd602

bfin-spi bfin-spi.0: rx_buf is 0058a4be, rx_end is 0058a4c0

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 2

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD9): 0: 00000001 00000000 00000000 00000000

mmc0:     16 bytes transferred: 0

mmc0: starting CMD55 arg 00000000 flags 00000095

mmc_spi spi0.4:   mmc_spi: CMD55, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 17

bfin-spi bfin-spi.0: tx_buf is 0058a4a0, tx_end is 0058a4b1

bfin-spi bfin-spi.0: rx_buf is 0058a4a0, rx_end is 0058a4b1

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 17

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD55): 0: 00000000 00000000 00000000 00000000

mmc0: starting CMD51 arg 00000000 flags 000000b5

mmc0:     blksz 8 blocks 1 flags 00000200 tsac 4 ms nsac 0

mmc_spi spi0.4:   mmc_spi: CMD51, resp R1

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 9

bfin-spi bfin-spi.0: tx_buf is 0058a4a0, tx_end is 0058a4a9

bfin-spi bfin-spi.0: rx_buf is 0058a4a0, rx_end is 0058a4a9

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 9

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd601

bfin-spi bfin-spi.0: rx_buf is 0058a4a0, rx_end is 0058a4a1

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4:     mmc_spi: read block, 8 bytes

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd601

bfin-spi bfin-spi.0: rx_buf is 0058a4a0, rx_end is 0058a4a1

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd601

bfin-spi bfin-spi.0: rx_buf is 0058a4a0, rx_end is 0058a4a1

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 1

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd601

bfin-spi bfin-spi.0: rx_buf is 0058a4a0, rx_end is 0058a4a1

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 1

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: adding an msg in transfer()

bfin-spi bfin-spi.0: restoring spi ctl state

bfin-spi bfin-spi.0: got a message to pump, state is set to: baud 165, flag 0x10, ctl 0x1c00

bfin-spi bfin-spi.0: the first transfer len is 8

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd608

bfin-spi bfin-spi.0: rx_buf is 006bd15c, rx_end is 006bd164

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 8

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: still running ...

bfin-spi bfin-spi.0: tx_buf is 006bd600, tx_end is 006bd602

bfin-spi bfin-spi.0: rx_buf is 0058a4be, rx_end is 0058a4c0

bfin-spi bfin-spi.0: transfer: drv_data->write is 000bf228, chip->write is 000bf228, null_wr is 000bf150

bfin-spi bfin-spi.0: now pumping a transfer: width is 0, len is 2

bfin-spi bfin-spi.0: doing IO transfer

bfin-spi bfin-spi.0: IO duplex: cr is 0x5c00

bfin-spi bfin-spi.0: transfer: all done!

mmc_spi spi0.4: setup spi chip mmc_spi, width is 0, dma is 0

mmc_spi spi0.4: ctl_reg is 0x1c00, flag_reg is 0x10

mmc_spi spi0.4: chip select number is 4

mmc0: req done (CMD51): 0: 00000001 00000000 00000000 00000000

mmc0:     8 bytes transferred: 0

mmc0: card lacks mandatory switch function, performance might suffer.

------------[ cut here ]------------

WARNING: at drivers/mmc/core/core.c:424 _mmc_set_clock+0x8e/0x90 [mmc_core]()

Modules linked in: mmc_spi crc7 crc_itu_t mmc_core hid_cherry hid_pl hid_microsoft [last unloaded: mmc_core]

Hardware Trace:

   0 Target : <0x000048bc> { _dump_stack + 0x0 }

     Source : <0x0000f640> { _warn_on_slowpath + 0x44 } CALL pcrel

   1 Target : <0x0000f640> { _warn_on_slowpath + 0x44 }

     Source : <0x0002a08a> { _print_modules + 0x7a } RTS

   2 Target : <0x0002a084> { _print_modules + 0x74 }

     Source : <0x0000fcce> { _printk + 0x16 } RTS

   3 Target : <0x0000fcca> { _printk + 0x12 }

     Source : <0x000104ce> { _vprintk + 0x12a } RTS

   4 Target : <0x000104ae> { _vprintk + 0x10a }

     Source : <0x000105ee> { _vprintk + 0x24a } JUMP.S

   5 Target : <0x000105ee> { _vprintk + 0x24a }

     Source : <0x0000fb3e> { _wake_up_klogd + 0x1a } RTS

   6 Target : <0x0000fb3e> { _wake_up_klogd + 0x1a }

     Source : <0x0000fb30> { _wake_up_klogd + 0xc } IF !CC JUMP

   7 Target : <0x0000fb24> { _wake_up_klogd + 0x0 }

     Source : <0x0000ff54> { _release_console_sem + 0x1ac } JUMP.L

   8 Target : <0x0000ff4c> { _release_console_sem + 0x1a4 }

     Source : <0x0000ff40> { _release_console_sem + 0x198 } IF !CC JUMP

   9 Target : <0x0000ff3c> { _release_console_sem + 0x194 }

     Source : <0x0000ff2e> { _release_console_sem + 0x186 } IF !CC JUMP

  10 Target : <0x0000ff28> { _release_console_sem + 0x180 }

     Source : <0x00022b3e> { _up + 0x36 } RTS

  11 Target : <0x00022b38> { _up + 0x30 }

     Source : <0x00022b2a> { _up + 0x22 } IF !CC JUMP

  12 Target : <0x00022b08> { _up + 0x0 }

     Source : <0x0000ff24> { _release_console_sem + 0x17c } CALL pcrel

  13 Target : <0x0000ff10> { _release_console_sem + 0x168 }

     Source : <0x0000fdfa> { _release_console_sem + 0x52 } IF !CC JUMP

  14 Target : <0x0000fdca> { _release_console_sem + 0x22 }

     Source : <0x0000fef2> { _release_console_sem + 0x14a } IF !CC JUMP

  15 Target : <0x0000feec> { _release_console_sem + 0x144 }

     Source : <0x0000fa9a> { __call_console_drivers + 0x7a } RTS

Stack info:

SP: [0x0020dde0] <0x0020dde0> /* kernel dynamic memory */

FP: (0x0020dedc)

Memory from 0x0020dde0 to 0020e000

0020dde0:[0000f640]<0000f644> 0020de00  004b73e0  00000000  004b73e0  000001a8  0020de00

0020de00: 636d6d5f  7465735f  6f6c635f  302b6b63  2f653878  30397830  6d6d5b20  6f635f63

0020de20: 005d6572  00000000  00000000  00000000  00000000  00000000  00000000  00000000

0020de40: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

0020de60: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

0020de80: 0000000a  00000006  00000010  00000000  003d0900  0020df24  0020dea0  0000ffff

0020dea0: 00000000  00000200  00000008  00000000  0020dee8  00000001  0020defc  00000033

0020dec0: 00000000  00000001  00000000  00000000  00000000  000000b5  00000000 (00000000)

0020dee0:<004b0ef2> 00000000  00000000  0020c000  0047e400  006bd13c  006bd000  00000000

0020df00: 0020c000  0020dfac  00000000 <004b36b2> 0047e400 <004b3746> 0047e400  006bd13c

0020df20: 00000000  0047e490  00000000  00000000  00000000  06a688a6  aa60648f  0021c81f

0020df40: f400e986  0020c000 <004b12e4> 0047e400  006bfde0  004b115c  0020df68  00000000

0020df60: 00ff8000  070fc4e0  ffffffff <0001c666> 0047e580  0018eab0  0020c000  00000000

0020df80:<0001cff6> 0020c000  00000000 <0001cfd0> 0020c000  0020c000  006bfde0  006bfde8

0020dfa0: 070fc4e0  00000000  00000000  00000000  07dbb080  0001f714  0020dfb8  0020dfb8

0020dfc0:<0001f340> 0001cf54  00000000  00000000  006bfde0  00000000  00000000  00000000

0020dfe0: 00000000  00000000 <0000144e> 00000000  00000000  00000000  ffffffff  00000006

0020e000: 07dbb980

Return addresses in stack:

    address : <0x0000f640> { _warn_on_slowpath + 0x44 }

    address : <0x0000f644> { _warn_on_slowpath + 0x48 }

   frame  1 : <0x004b0ef2> { :mmc_core:_mmc_set_clock + 0x8e }

    address : <0x004b36b2> { :mmc_core:_mmc_attach_sd + 0x502 }

    address : <0x004b3746> { :mmc_core:_mmc_attach_sd + 0x596 }

    address : <0x004b12e4> { :mmc_core:_mmc_rescan + 0x188 }

    address : <0x0001c666> { _run_workqueue + 0x72 }

    address : <0x0001cff6> { _worker_thread + 0xa2 }

    address : <0x0001cfd0> { _worker_thread + 0x7c }

    address : <0x0001f340> { _kthread + 0x50 }

    address : <0x0000144e> { _kernel_thread_helper + 0x6 }

---[ end trace ca18f08eb493e98e ]---

mmc0: clock 0Hz busmode 2 powermode 2 cs 1 Vdd 20 width 0 timing 0

mmc0: host does not support reading read-only switch. assuming write-enable.

mmc0: new SD card on SPI

root:/>

 

Are these reading errors simply because of the cards i'm using?

 

I've ordered several new sd/sdhc cards today, so i'll try to test these later.

 

thanks, Mark

QuoteReplyEditDelete

 

 

2009-02-17 05:08:02     Re: mmc_spi not working

Mark Urup (DENMARK)

Message: 69517   

 

I'm back again.

 

There's no good news.

 

At least the cards I've tested are consistent. They alle give -84 as error.

 

The cards:

 

Sandisk extreme 3 sdhc 8gb, takeMS sd 1gb, Transcend sd 2gb, MicroMemory sd 2 gb

 

 

 

I'm borrowing a SPI-bus analyzer, so I'll hopefully soon be able to see the full communication, anything specific I should look for?

QuoteReplyEditDelete

 

 

2009-02-25 05:29:03     Re: mmc_spi not working

Mark Urup (DENMARK)

Message: 69877   

 

I'm still stuck.

 

Can you give me the exact setup you've been working on (gotten it to work with) - and the cards you used?

 

Right now I at the point where I just want to get something up and running, and then change one variable at a time.

QuoteReplyEditDelete

 

 

2009-02-25 05:42:25     Re: mmc_spi not working

Yi Li (CHINA)

Message: 69878   

 

Steps to setup on BF537-STAMP:

 

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

 

I've tested with Sandisk 256MB/512MB SD cards, a Transend 8GB SDHC card.

 

-Yi

QuoteReplyEditDelete

 

 

2009-02-25 08:19:36     Re: mmc_spi not working

Wolfgang Muees (GERMANY)

Message: 69885   

 

Mark,

 

do you have the right definitions in your platform data in your board file?

 

My definitions are:

 

static struct spi_board_info bfin_spi_board_info[] __initdata = {

        {

                .modalias = "mmc_spi",              // Name des device drivers

                .max_speed_hz = 25000000,           // Maximale Clockrate fuer SD cards

                .bus_num = 0,                       // Bus number

                .chip_select = CFG_SPI_CHIPSEL5,    // SPISEL5: PH9: Chip Select fuer SD card

                .platform_data = &auer_sdspi_platform_data, // Platform data

                .controller_data = &auer_sdspi_controller_data, // Controller data

                .mode = SPI_MODE_3,                 // Clock Polaritaet und Phase. Hier MUSS Mode 3

                                                    // verwendet werden (CPHA=1 und CPOL=1), denn bei

                                                    // Mode 0 legt die Schnittstelle zwischen den einzelnen

                                                    // Bytes kurz das ChipSelect inaktiv. Damit geht garnix!

        },

};

 

// Diese Infos sind spezifisch fuer den Blackfin SPI Treiber:

static struct bfin5xx_spi_chip auer_sdspi_controller_data = {

        .enable_dma = 0,

        .bits_per_word = 8,

};

 

 

// Diese Infos sind spezifisch fuer den MMC SPI Treiber:

static struct mmc_spi_platform_data auer_sdspi_platform_data = {

        .init = auer_sdspi_init,

        .exit = auer_sdspi_exit,

        .get_ro = auer_sdspi_get_ro,

};

 

 

Note that you HAVE to use SPI_MODE_3, because 0 is not working (Blackfin SPI uglyness).

 

regards

 

Wolfgang

 

 

TranslateQuoteReplyEditDelete

 

 

2009-02-25 09:01:44     Re: mmc_spi not working

Phil Wilshire (UNITED STATES)

Message: 69889   

 

Just a thought.

 

Have you got some in line resistors (22 ohm) in the spi clock and data lines.

 

I always suggest this to the hardware guys.

 

The blackfin has very fast outputs and you need to watch for transients.

 

The HRM does suggest this.

 

 

 

Regards

 

  Phil Wilshire

 

 

QuoteReplyEditDelete

 

 

2009-02-25 10:11:51     Re: mmc_spi not working

Mark Urup (DENMARK)

Message: 69896   

 

Wolfgang, the only difference I see is that I use spi select 7, and don't use any card detect (we have no available pin on the dsp)

 

My board file looks like this (file is also attached):

 

#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 = 7,

                .platform_data = &bfin_mmc_spi_pdata,

                .controller_data = &mmc_spi_chip_info,

                .mode = SPI_MODE_3,

        },

#endif

 

#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, "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

 

 

 

Phil,

 

yes, we've got 100 ohms on clock, data and chip select lines.

We've copied the stamp sd/mmc extender board setup as closely as possible.

 

I've attached the hardware diagram as well. If you see anything odd, please comment.

 

 

 

Yi,

 

thanks for the setup, I'll try to find our stamp board, and fire it up with the sd extender board.

 

iptshark537.c

Schematic_nt1V3a_27082008-side9.png

QuoteReplyEditDelete

 

 

2009-02-26 04:23:40     Re: mmc_spi not working

Wolfgang Muees (GERMANY)

Message: 69960   

 

Mark,

 

regarding your hardware setup: I would suggest to add a ferrite bead of about 600-1000 Ohms @ 100 MHz, minimum 200mA in the VCC line to the card VCC. This will prevent EMP pulses if you do a hot insert of the SD card and the SD card internal capacitor is loaded.

 

regarding your software problem: can you please post your mmc_spi.c and spi_bfin5xx.c ?

 

regards

 

Wolfgang

TranslateQuoteReplyEditDelete

 

 

2009-02-26 09:34:24     Re: mmc_spi not working

Mark Urup (DENMARK)

Message: 70004   

 

Wolfgang, that would seem like a good idea.

 

I got it to work now; it was a hardware error.

 

After making a test-setup on our bf537-ezkit and seeing it work, I systematically removed components from our own board, untill the driver could load without problems.

 

We had a 10K pull-up resistor on the SPI_SDO line which caused the problem.

 

Thank you all, for all your help. It works now, with all except one card (a 1gb kingston), but I can live with that.

 

Regards

Mark

QuoteReplyEditDelete

 

 

2009-02-26 10:13:53     Re: mmc_spi not working

Wolfgang Muees (GERMANY)

Message: 70008   

 

Mark,

 

good to hear that it is working for you.

 

I can confirm that a 1 GByte Kingston SD card is NOT working because the read data block is not byte aligned. Have not found an easy solution for that....

 

Regarding the 10K pullup resistor: I am using a 10K pullup on SCLK, MISO, MOSI and CS. All to VCC (3V3). And it's working without any problem. So it must be another problem ... maybe some pulldown resistors? Or a forgotten pullup on the other lines?

 

If it starts working if you remove a pullup I suspect that you have a floating problem on some of your SD card lines!

 

regards

 

Wolfgang

TranslateQuoteReplyEditDelete

 

 

2009-03-03 03:22:25     Re: mmc_spi not working

Mark Urup (DENMARK)

Message: 70257   

 

Wolfgang,

 

you're absolutely right, I was to fast to respond (or just to happy to really look at the diagram).

 

We had a pulldown on the clk, and pullup's on all the other spi lines.

 

Should the clk line also be pulled up as you suggest or is it arbitrary?

 

 

 

Regards

Mark

QuoteReplyEditDelete

 

 

2009-03-03 03:28:18     Re: mmc_spi not working

Wolfgang Muees (GERMANY)

Message: 70258   

 

Mark,

 

if you use SPI MODE 3, then the steady state polarity of the CLK line is HIGH, so you should use a pullup here, yes!

 

I would prefer 10K over 100K here for safety reasons.

 

regards

 

Wolfgang

TranslateQuoteReplyEditDelete

 

 

2009-03-03 03:55:28     RE: Re: mmc_spi not working

Michael Hennerich (GERMANY)

Message: 70259    Wolfgang,

 

I recently added a GPIO controlled SPI Slave Select Option to the SPI

Bus driver.

Besides extending the number of supported SPI Slaves - this can also be

used to work around the SPI_MODE_0 Slave Select behavior.

 

docs.blackfin.uclinux.org/doku.php?id=spi

 

-Michael

QuoteReplyEditDelete

 

 

2009-03-03 09:11:56     RE: Re: mmc_spi not working

Wolfgang Muees (GERMANY)

Message: 70288   

 

Michael,

 

thanks for your work. So now we have a choice, and using SPI MODE 0 is better for SD cards because the steady state is LOW, and this is better for hot-plugging.

 

regards

 

Wolfgang

Outcomes