[U-Boot] 2010.09-rc1 SD/MMC tested on Atmel AT91SAM9G45EKES - works

William C. Landolina wcl at techatl.com
Sun Sep 12 17:56:12 CEST 2010


> Dear William C. Landolina,
<snip>
>> UB-X1> mmcinfo 
>> mci: setting clock 260416 Hz, block size 512
>> mci: setting clock 260416 Hz, block size 512
>> mci: setting clock 260416 Hz, block size 512
>> gen_atmel_mci: CMDR 00001048 ( 8) ARGR 000001aa (SR: 0c100025) Command Failed
> Seems the card does not understand the CMD8 (Voltage supplied)

Mmcinfo lists this card as conforming to the SDCard 1.10 specification, but the voltage configuration command wasn't defined until version 2.0.  The SDCard I'm testing with is definitely an old generic card.

The text I found describing CMD8:
 "After the card enters idle state with a CMD0, send a CMD8 with argument of 0x000001AA and correct CRC prior to initialization process. When the CMD8 is rejected with an illigal command error (0x05), the card is SDC V1 or MMC. When the CMD8 is accepted, R7 response (R1(0x01) and trailing 32 bit data) will be returned. The lower 12 bits in the return value 0x1AA means that the card is SDC V2 and it can work at voltage range of 2.7 to 3.6 volts. If not the case, the card must be rejected. And then initiate initialization with ACMD41 with HCS (bit 30). After the initialization completed, read OCR and check CCS (bit 30) in the OCR. When it is set, subsequent data read/write operations that described below are commanded in block address insted of byte address. The block size is always fixed to 512 bytes."

The web page with the CMD8 description came out of Google's cache [http://webcache.googleusercontent.com/search?q=cache:5IE3l8XsBq0J:elm-chan.org/docs/mmc/mmc_e.html+mmc+supplied+voltage&cd=1&hl=en&ct=clnk&gl=us&client=firefox-a].  
There is also a document from Samsung that list CMD8 as a difference between MMC and SDCard 2.0: http://www.samsung.com/global/business/semiconductor/products/flash/downloads/applicationnote/4gb_mmc_application_note_200606.pdf

> mci: setting clock 260416 Hz, block size 512
> mci: setting clock 22222222 Hz, block size 512
> The function that sets clock and blocksize is repeatedly called by the common MMC
> framework, one might want to make that output debug only. Fot the time being, however,
> its good to see that the calculated clock is less than what the card can handle.
> What clocks does you system use? Xtal/PLL/PBI?

The Atmel 9G45 evaluation board uses a 12MHz crystal and internal PLLs.  CPU clock is 400MHz.  I'm using the stock 9G45EKES configuration and haven't looked at what other frequencies the other system clocks are running.

The "setting clock" message is a straight up printf() in drivers/mmc/gen_atmel_mci.c rather than a debug() message.  This seems to be the only printf that isn't conditioned on DEBUG so it is probably an oversight that should be corrected.

I am working on a 9G45 product that will be released early next year and I expect to post board support patches for that with MMC support, but before that I don't plan to post my hacks to Atmel's evaluation board BSP - I'll freely share my code as-is with anyone who wants to make patches for the Atmel distribution, but my main goal is to learn what I need to know to make a clean BSP for my product.

Thanks,
Bill.


More information about the U-Boot mailing list