Skip to contentSkip to conversation

Au1200 MMC/SD problem

DISCUSSION Wolfgang Ocker 2 participants 5 messages May 2, 2006 – May 5, 2006 MIPS

lore
Share & tools
lore
#0 lore raw

Hello,

I'm trying to get a SD card to work on an Db1200 board. I'm using kernel 2.6.16.11 (+ the patch from Jordan Crouse):

http://www.linux-mips.org/archives/linux-mips/2005-12/msg00006.html

The card gets recognized and issues its relative address. Then command 9 (send csd) times out.

MMC: req done (37): 0: 00000120 00000000 00000000 00000000
MMC: starting cmd 29 arg 00018000 flags 00000061
MMC: req done (29): 0: 80ff8000 00000000 00000000 00000000
MMC: starting cmd0 2 arg 00000000 flags 00000067
MMC: req done (02): 0: 01504153 30313642 414a8be0 08004a00
MMC: starting cmd 03 arg 00000000 flags 00000065
MMC: req done (03): 0: e008004a 00000000 00000000 00000000
MMC: starting cmd 02 arg 00000000 flags 00000067
MMC: req done (02): 1: 00000000 00000000 00000000 00000000
MMC: req done (02): 1: 00000000 00000000 00000000 00000000
MMC: req done (02): 1: 00000000 00000000 00000000 00000000
MMC: req done (02): 1: 00000000 00000000 00000000 00000000 au1xx(0): DEBUG: set_ios (power=2, clock=450000Hz, vdd=15, mode=2)
MMC: starting cmd 09 arg e0080000 flags 00000007
MMC: req done (09): 1: 00000000 00000000 00000000 00000000
MMC: req done (09): 1: 00000000 00000000 00000000 00000000
MMC: req done (09): 1: 00000000 00000000 00000000 00000000
MMC: req done (09): 1: 00000000 00000000 00000000 00000000

I'm new to MMC/SD and I have no idea whether this is a problem with the hardware, the software or the SD card (I tried two different SD cards. Both work on my laptop with Linux 2.6.16 and a Winbond W83L51xD).

Any hints are highly appreciated.

Thanks,
Wolfgang

#1 lore raw
Quoted 4 lines · Wolfgang Ocker

Hello,

I'm trying to get a SD card to work on an Db1200 board. I'm using kernel 2.6.16.11 (+ the patch from Jordan Crouse):

Thats not an encouraging sign.

Quoted 6 lines

au1xx(0): DEBUG: set_ios (power=2, clock=450000Hz, vdd=15, mode=2)
MMC: starting cmd 09 arg e0080000 flags 00000007
MMC: req done (09): 1: 00000000 00000000 00000000 00000000
MMC: req done (09): 1: 00000000 00000000 00000000 00000000
MMC: req done (09): 1: 00000000 00000000 00000000 00000000
MMC: req done (09): 1: 00000000 00000000 00000000 00000000

Ok - so the reasons for cmd->error to be MMC_ERR_TIMEOUT are:

* invalid return from dma_map_sg in au1xmmc_prepare_data
* general error from the DBDMA engine
* one of SD_STATUS_RAT sent when the IRQ fires

So to narrow it down - check the return value of au1xmmc_prepare_data
in au1xmmc_request. Then, see if RAT is ever set in au1xmmc_irq. This
will help narrow down the problem.

Also, the usual general questions:
What SD card are you using? How big is it? Is it a v1.01 or a v1.1 card?

Jordan

#2 lore raw
Quoted 7 lines · Jordan Crouse
Quoted 1 line · Wolfgang Ocker

[ timeout during cmd 9 ]

Ok - so the reasons for cmd->error to be MMC_ERR_TIMEOUT are:
* invalid return from dma_map_sg in au1xmmc_prepare_data
* general error from the DBDMA engine
* one of SD_STATUS_RAT sent when the IRQ fires

The last one. In au1xmmc_irq() the status register is read with the SD_STATUS_RAT bit set.

Quoted 3 lines

So to narrow it down - check the return value of au1xmmc_prepare_data
in au1xmmc_request. Then, see if RAT is ever set in au1xmmc_irq. This
will help narrow down the problem.

au1xmmc_prepare_data doesn't return any error.

Quoted 2 lines

Also, the usual general questions:
What SD card are you using? How big is it? Is it a v1.01 or a v1.1 card?

1. Canon, 16 MB, got this one with a Canon camera.
2. Labeled by Hama, 1 GB, but I don't know the real manufacturer.

I can operate the cards on my Linux-Laptop. Is there a way to determine the manufacturer and version directly from the card?

Thanks,
Wolfgang

#3 lore raw
Quoted 2 lines

The last one. In au1xmmc_irq() the status register is read with the SD_STATUS_RAT bit set.

Ok - so the card is timing out. That could be a series of problems, some of which could be hardware, some of which could be software. Since you are using a db1200, I'll rule out hardware for the moment, unless you have a modified board.

Do MMC cards work? Try one - that will give us another data point.

Jordan

Signature · 4 lines
Jordan Crouse
Senior Linux Engineer
AMD - Personal Connectivity Solutions Group
<www.amd.com/embeddedprocessors>
#4 lore raw
Quoted 7 lines · Jordan Crouse
Quoted 2 lines

The last one. In au1xmmc_irq() the status register is read with the SD_STATUS_RAT bit set.

Ok - so the card is timing out. That could be a series of problems, some of which could be hardware, some of which could be software. Since you are using a db1200, I'll rule out hardware for the moment, unless you have a modified board.

Today I tested a third SD card from SanDisk, 128MB, same problem and log output (time out in command 9).

Quoted 1 line

Do MMC cards work? Try one - that will give us another data point.

Today I received a SanDisk 64 MB MMC card, it doesn't work either. Here the log output:

au1xx(0): DEBUG: set_ios (power=0, clock=0Hz, vdd=0, mode=1)
au1xxx-mmc: MMC Controller 0 set up at B0600000 (mode=dma) au1xx(0): DEBUG: set_ios (power=1, clock=0Hz, vdd=23, mode=1) au1xx(0): DEBUG: set_ios (power=2, clock=450000Hz, vdd=23, mode=1) au1xx(0): DEBUG: set_ios (power=2, clock=450000Hz, vdd=23, mode=1)
MMC: starting cmd 00 arg 00000000 flags 00000040
MMC: req done (00): 0: 00000000 00000000 00000000 00000000 au1xx(0): DEBUG: set_ios (power=2, clock=450000Hz, vdd=23, mode=1)
MMC: starting cmd 37 arg 00000000 flags 00000015 au1xx(0): DEBUG: au1xmmc_irq(), SD_STATUS_RAT set
MMC: req done (37): 1: 00000000 00000000 00000000 00000000
MMC: starting cmd 37 arg 00000000 flags 00000015 au1xx(0): DEBUG: au1xmmc_irq(), SD_STATUS_RAT set
MMC: req done (37): 1: 00000000 00000000 00000000 00000000
MMC: starting cmd 37 arg 00000000 flags 00000015 au1xx(0): DEBUG: au1xmmc_irq(), SD_STATUS_RAT set
MMC: req done (37): 1: 00000000 00000000 00000000 00000000
MMC: starting cmd 37 arg 00000000 flags 00000015 au1xx(0): DEBUG: au1xmmc_irq(), SD_STATUS_RAT set
MMC: req done (37): 1: 00000000 00000000 00000000 00000000
MMC: mmc_setup(), send_app_op_cond, ocr = 1000fc00, err = 1
MMC: mmc_setup(), no SD card found (1)
MMC: starting cmd 01 arg 00000000 flags 00000061 au1xx(0): DEBUG: au1xmmc_irq(), SD_STATUS_RAT set
MMC: req done (01): 1: 00000000 00000000 00000000 00000000
MMC: mmc_rescan(): no card found!
au1xx(0): DEBUG: set_ios (power=0, clock=0Hz, vdd=0, mode=1)

Thanks,
Wolfgang