diff options
authorH. Peter Anvin <hpa@zytor.com>2008-12-30 14:15:12 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-12-30 14:15:12 -0800
commit060c89ac28498ca76b2308970d06273c6caa1c73 (patch)
parenta87396fa93ed600ad92da08e8a4da12690694e3e (diff)
sddrom: "don't re-issue HCS bit" was a misreading of specabc80-de1-12
The spec states: SD_SEND_OP_COND (ACMD41) is used to start initialization and to check if the card has completed initialization. It is mandatory to issue CMD8 prior to the first ACMD41. Receiving of CMD8 expands the CMD58 and ACMD41 function; HCS (High Capacity Support) in the argument of ACMD41 and CCS (Card Capacity Status) in the response of CMD58. HCS is ignored by the card, which didn’t accept CMD8. Standard Capacity SD Memory Card ignores HCS. The “in idle state” bit in the R1 response of ACMD41 is used by the card to inform the host if initialization of ACMD41 is completed. Setting this bit to “1” indicates that the card is still initializing. Setting this bit to “0” indicates completion of initialization. The host repeatedly issues ACMD41 until this bit is set to “0”. The card checks the HCS bit in the OCR only at the first ACMD41. While repeating ACMD41, the host shall not issue another command except CMD0. I misread that to mean that it was supposed to set HCS <- 0 before re-issuing ACMD41, which is unnecessary. Also, add a unique LED error code (E8) to ACMD41 error.
1 files changed, 1 insertions, 1 deletions
diff --git a/data/sddrom.asm b/data/sddrom.asm
index 8720e4e..0db9040 100644
--- a/data/sddrom.asm
+++ b/data/sddrom.asm
@@ -585,8 +585,8 @@ sd_init_acmd41_loop:
and a
jr z,sd_probe_ocr
dec a
- ld d,0 ; Do not repeat SDHC bit, per spec
jr z,sd_init_acmd41_loop
+ ld c,LED_8
jr sd_carderr