summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorJack Halpin <jack.halpin@gmail.com>2010-03-22 02:30:00 +0000
committerJack Halpin <jack.halpin@gmail.com>2010-03-22 02:30:00 +0000
commit3ee301248d3eb6150f500b86412f3cf7667d17c4 (patch)
tree4e449fbd366fd04b55597b942a268f835a7ae6fc /firmware/target/arm
parent48b8080330cad231de9b02b48b631e02d3cb554a (diff)
sd-as3525v2.c Add macros to distinguish between a CMD error and a DATA error.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25283 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 4e550a96d4..b696908157 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -184,9 +184,20 @@
* & 0x418 = MCI_INT_DTO | MCI_INT_TXDR | MCI_INT_HTO
*/
-#define MCI_ERROR (MCI_INT_RE | MCI_INT_RCRC | MCI_INT_DCRC /*| MCI_INT_RTO*/ \
- | MCI_INT_DRTO | MCI_INT_HTO | MCI_INT_FRUN | MCI_INT_HLE \
- | MCI_INT_SBE | MCI_INT_EBE)
+#define MCI_CMD_ERROR \
+ (MCI_INT_RE | \
+ MCI_INT_RCRC | \
+ MCI_INT_RTO | \
+ MCI_INT_HLE)
+
+#define MCI_DATA_ERROR \
+ ( MCI_INT_DCRC | \
+ MCI_INT_DRTO | \
+ MCI_INT_HTO | \
+ MCI_INT_FRUN | \
+ MCI_INT_HLE | \
+ MCI_INT_SBE | \
+ MCI_INT_EBE)
#define MCI_STATUS SD_REG(0x48)
@@ -340,10 +351,10 @@ void INT_NAND(void)
MCI_RAW_STATUS = status; /* clear status */
- if(status & MCI_ERROR)
+ if(status & MCI_DATA_ERROR)
retry = true;
- if(data_transfer && status & (MCI_INT_DTO|MCI_ERROR))
+ if(data_transfer && status & (MCI_INT_DTO|MCI_DATA_ERROR))
wakeup_signal(&transfer_completion_signal);
MCI_CTRL |= INT_ENABLE;
@@ -782,9 +793,9 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
goto sd_transfer_error;
}
+
+ MCI_MASK = MCI_DATA_ERROR | MCI_INT_DTO;
MCI_CTRL |= DMA_ENABLE;
- MCI_MASK = MCI_INT_CD|MCI_INT_DTO|MCI_INT_DCRC|MCI_INT_DRTO| \
- MCI_INT_HTO|MCI_INT_FRUN|MCI_INT_HLE|MCI_INT_SBE|MCI_INT_EBE;
MCI_FIFOTH &= MCI_FIFOTH_MASK;
MCI_FIFOTH |= 0x503f0080;