1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c
index 802a649..f248fed 100644
--- a/firmware/target/arm/as3525/ata_sd_as3525.c
+++ b/firmware/target/arm/as3525/ata_sd_as3525.c
@@ -244,7 +244,7 @@ static int sd_init_card(const int drive)
 {
     unsigned long response;
     long init_timeout;
-    bool sdhc;
+    bool sdv2 = false;
     unsigned long temp_reg[4];
     int i;

@@ -253,10 +253,9 @@ static int sd_init_card(const int drive)

     mci_delay();

-    sdhc = false;
     if(send_cmd(drive, SD_SEND_IF_COND, 0x1AA, MCI_RESP|MCI_ARG, &response))
         if((response & 0xFFF) == 0x1AA)
-            sdhc = true;
+            sdv2 = true;

     /* timeout for initialization is 1sec, from SD Specification 2.00 */
     init_timeout = current_tick + HZ;
@@ -274,7 +273,7 @@ static int sd_init_card(const int drive)
         }

         /* acmd41 */
-        if(!send_cmd(drive, SD_APP_OP_COND, (sdhc ? 0x40FF8000 : (1<<23)),
+        if(!send_cmd(drive, SD_APP_OP_COND, 0x00FF8000 | (sdv2 ? (1<<30) : 0),
                         MCI_RESP|MCI_ARG, &card_info[drive].ocr))
         {
             return -4;