summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tms320dm320')
-rw-r--r--firmware/target/arm/tms320dm320/sdmmc-dm320.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/firmware/target/arm/tms320dm320/sdmmc-dm320.c b/firmware/target/arm/tms320dm320/sdmmc-dm320.c
index f479b54a91..fdc3e041a0 100644
--- a/firmware/target/arm/tms320dm320/sdmmc-dm320.c
+++ b/firmware/target/arm/tms320dm320/sdmmc-dm320.c
@@ -71,6 +71,7 @@
71#define BLOCKS_PER_BANK 0x7A7800 71#define BLOCKS_PER_BANK 0x7A7800
72 72
73/* command flags for send_cmd */ 73/* command flags for send_cmd */
74#define SDHC_RESP_FMT_MASK 0x0600
74#define SDHC_RESP_FMT_NONE 0x0000 75#define SDHC_RESP_FMT_NONE 0x0000
75#define SDHC_RESP_FMT_1 0x0200 76#define SDHC_RESP_FMT_1 0x0200
76#define SDHC_RESP_FMT_2 0x0400 77#define SDHC_RESP_FMT_2 0x0400
@@ -306,16 +307,23 @@ static int sd_command(int cmd, unsigned long arg,
306 { 307 {
307 /* discard response */ 308 /* discard response */
308 } 309 }
309 else if ((cmdat & SDHC_RESP_FMT_1) || (cmdat & SDHC_RESP_FMT_3)) 310 else
310 {
311 response[0] = (IO_MMC_RESPONSE7 << 16) | IO_MMC_RESPONSE6;
312 }
313 else if (cmdat & SDHC_RESP_FMT_2)
314 { 311 {
315 response[0] = (IO_MMC_RESPONSE7 << 16) | IO_MMC_RESPONSE6; 312 switch (cmdat & SDHC_RESP_FMT_MASK)
316 response[1] = (IO_MMC_RESPONSE5 << 16) | IO_MMC_RESPONSE4; 313 {
317 response[2] = (IO_MMC_RESPONSE3 << 16) | IO_MMC_RESPONSE2; 314 case SDHC_RESP_FMT_1:
318 response[3] = (IO_MMC_RESPONSE1 << 16) | IO_MMC_RESPONSE0; 315 case SDHC_RESP_FMT_3:
316 response[0] = (IO_MMC_RESPONSE7 << 16) | IO_MMC_RESPONSE6;
317 break;
318 case SDHC_RESP_FMT_2:
319 response[0] = (IO_MMC_RESPONSE7 << 16) | IO_MMC_RESPONSE6;
320 response[1] = (IO_MMC_RESPONSE5 << 16) | IO_MMC_RESPONSE4;
321 response[2] = (IO_MMC_RESPONSE3 << 16) | IO_MMC_RESPONSE2;
322 response[3] = (IO_MMC_RESPONSE1 << 16) | IO_MMC_RESPONSE0;
323 break;
324 default:
325 break;
326 }
319 } 327 }
320 328
321 return 0; 329 return 0;