diff options
author | Wolfgang Muees <wolfgang.mues@auerswald.de> | 2009-04-07 09:48:16 -0400 |
---|---|---|
committer | Pierre Ossman <pierre@ossman.eu> | 2009-04-08 14:37:53 -0400 |
commit | 9d9f25c036dd584db175552a7d162403d3ab54b3 (patch) | |
tree | 42aa05d8091832eb28ee2237e775e8b738af11d4 /drivers/mmc/core | |
parent | 00adadc12196c7b3e8923729e728162267e98ff7 (diff) |
mmc_spi: do not check CID and CSD blocks with CRC16
Some cards are not able to calculate a valid CRC16 value
for CID and CSD reads (CRC for 512 byte data blocks is OK).
By moving the CRC enable after the read of CID and CSD, these
cards can be used. This patch was tested with a faulty 8 GByte
takeMS Class 6 SDHC card. This patch was suggested by
Pierre Ossman.
Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/sd.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 26fc098d77cd..cd81c395e164 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c | |||
@@ -363,15 +363,6 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, | |||
363 | goto err; | 363 | goto err; |
364 | 364 | ||
365 | /* | 365 | /* |
366 | * For SPI, enable CRC as appropriate. | ||
367 | */ | ||
368 | if (mmc_host_is_spi(host)) { | ||
369 | err = mmc_spi_set_crc(host, use_spi_crc); | ||
370 | if (err) | ||
371 | goto err; | ||
372 | } | ||
373 | |||
374 | /* | ||
375 | * Fetch CID from card. | 366 | * Fetch CID from card. |
376 | */ | 367 | */ |
377 | if (mmc_host_is_spi(host)) | 368 | if (mmc_host_is_spi(host)) |
@@ -458,6 +449,18 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, | |||
458 | } | 449 | } |
459 | 450 | ||
460 | /* | 451 | /* |
452 | * For SPI, enable CRC as appropriate. | ||
453 | * This CRC enable is located AFTER the reading of the | ||
454 | * card registers because some SDHC cards are not able | ||
455 | * to provide valid CRCs for non-512-byte blocks. | ||
456 | */ | ||
457 | if (mmc_host_is_spi(host)) { | ||
458 | err = mmc_spi_set_crc(host, use_spi_crc); | ||
459 | if (err) | ||
460 | goto free_card; | ||
461 | } | ||
462 | |||
463 | /* | ||
461 | * Attempt to change to high-speed (if supported) | 464 | * Attempt to change to high-speed (if supported) |
462 | */ | 465 | */ |
463 | err = mmc_switch_hs(card); | 466 | err = mmc_switch_hs(card); |