diff options
Diffstat (limited to 'firmware/target/arm/as3525/sd-as3525v2.c')
-rw-r--r-- | firmware/target/arm/as3525/sd-as3525v2.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index 765eb17f0e..9d5b19c08d 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -639,28 +639,22 @@ static int sd_transfer_sectors(unsigned long start, int count, void* buf, bool w const int cmd = write ? SD_WRITE_MULTIPLE_BLOCK : SD_READ_MULTIPLE_BLOCK; - (*(volatile unsigned long *) (SD_BASE+0x00)) |= 2; - while(( *(volatile unsigned long *) (SD_BASE+0x00)) & 2) ; - //(*(volatile unsigned long *) (SD_BASE+0x1c)) = 512; - (*(volatile unsigned long *) (SD_BASE+0x20)) = transfer * 512; + (*(volatile unsigned long *) (SD_BASE+0x00)) |= 2; + while(( *(volatile unsigned long *) (SD_BASE+0x00)) & 2) ; - (*(volatile unsigned long *) (SD_BASE+0x00)) |= 2; - while(( *(volatile unsigned long *) (SD_BASE+0x00)) & 2) ; + //(*(volatile unsigned long *) (SD_BASE+0x1c)) = 512; + (*(volatile unsigned long *) (SD_BASE+0x20)) = transfer * 512; - (*(volatile unsigned long *) (SD_BASE+0x4c)) &= ~0x7fff0fff; + (*(volatile unsigned long *) (SD_BASE+0x00)) |= 2; + while(( *(volatile unsigned long *) (SD_BASE+0x00)) & 2) ; + + (*(volatile unsigned long *) (SD_BASE+0x4c)) &= ~0x7fff0fff; - if(0) - { (*(volatile unsigned long *) (SD_BASE+0x00)) |= 0x20; MCI_MASK = 0xBE8C; (*(volatile unsigned long *) (SD_BASE+0x4c)) |= 0x503f0080; - } - else - { - MCI_MASK = 0xBEB8; - (*(volatile unsigned long *) (SD_BASE+0x4c)) |= 0x3f0030; - } + if(card_info.ocr & (1<<30) ) /* SDHC */ ret = send_cmd(cmd, start, MCI_NO_RESP, NULL); |