diff options
Diffstat (limited to 'firmware/drivers/ata_mmc.c')
-rw-r--r-- | firmware/drivers/ata_mmc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index 1dc330c538..0fe89c5be8 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c | |||
@@ -425,25 +425,25 @@ static int initialize_card(int card_no) | |||
425 | if (rc) | 425 | if (rc) |
426 | return rc * 10 - 5; | 426 | return rc * 10 - 5; |
427 | 427 | ||
428 | blk_exp = card_extract_bits(card->csd, 44, 4); | 428 | blk_exp = card_extract_bits(card->csd, 83, 4); |
429 | if (blk_exp < 9) /* block size < 512 bytes not supported */ | 429 | if (blk_exp < 9) /* block size < 512 bytes not supported */ |
430 | return -6; | 430 | return -6; |
431 | 431 | ||
432 | card->numblocks = (card_extract_bits(card->csd, 54, 12) + 1) | 432 | card->numblocks = (card_extract_bits(card->csd, 73, 12) + 1) |
433 | << (card_extract_bits(card->csd, 78, 3) + 2 + blk_exp - 9); | 433 | << (card_extract_bits(card->csd, 49, 3) + 2 + blk_exp - 9); |
434 | card->blocksize = BLOCK_SIZE; | 434 | card->blocksize = BLOCK_SIZE; |
435 | 435 | ||
436 | /* max transmission speed, clock divider */ | 436 | /* max transmission speed, clock divider */ |
437 | ts_exp = card_extract_bits(card->csd, 29, 3); | 437 | ts_exp = card_extract_bits(card->csd, 98, 3); |
438 | ts_exp = (ts_exp > 3) ? 3 : ts_exp; | 438 | ts_exp = (ts_exp > 3) ? 3 : ts_exp; |
439 | card->speed = mantissa[card_extract_bits(card->csd, 25, 4)] | 439 | card->speed = mantissa[card_extract_bits(card->csd, 102, 4)] |
440 | * exponent[ts_exp + 4]; | 440 | * exponent[ts_exp + 4]; |
441 | card->bitrate_register = (FREQ/4-1) / card->speed; | 441 | card->bitrate_register = (FREQ/4-1) / card->speed; |
442 | 442 | ||
443 | /* NSAC, TAAC, read timeout */ | 443 | /* NSAC, TAAC, read timeout */ |
444 | card->nsac = 100 * card_extract_bits(card->csd, 16, 8); | 444 | card->nsac = 100 * card_extract_bits(card->csd, 111, 8); |
445 | card->taac = mantissa[card_extract_bits(card->csd, 9, 4)]; | 445 | card->taac = mantissa[card_extract_bits(card->csd, 118, 4)]; |
446 | taac_exp = card_extract_bits(card->csd, 13, 3); | 446 | taac_exp = card_extract_bits(card->csd, 114, 3); |
447 | card->read_timeout = ((FREQ/4) / (card->bitrate_register + 1) | 447 | card->read_timeout = ((FREQ/4) / (card->bitrate_register + 1) |
448 | * card->taac / exponent[9 - taac_exp] | 448 | * card->taac / exponent[9 - taac_exp] |
449 | + (10 * card->nsac)); | 449 | + (10 * card->nsac)); |
@@ -451,7 +451,7 @@ static int initialize_card(int card_no) | |||
451 | card->taac = card->taac * exponent[taac_exp] / 10; | 451 | card->taac = card->taac * exponent[taac_exp] / 10; |
452 | 452 | ||
453 | /* r2w_factor, write timeout */ | 453 | /* r2w_factor, write timeout */ |
454 | card->r2w_factor = BIT_N(card_extract_bits(card->csd, 99, 3)); | 454 | card->r2w_factor = BIT_N(card_extract_bits(card->csd, 28, 3)); |
455 | card->write_timeout = card->read_timeout * card->r2w_factor; | 455 | card->write_timeout = card->read_timeout * card->r2w_factor; |
456 | 456 | ||
457 | if (card->r2w_factor > 32) /* Such cards often need extra read delay */ | 457 | if (card->r2w_factor > 32) /* Such cards often need extra read delay */ |