forked from len0rd/rockbox
sd-as3525.c: disable widebus again, it causes read corruptions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27495 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b221d6d4d4
commit
08c600ca07
1 changed files with 8 additions and 4 deletions
|
@ -52,7 +52,7 @@
|
||||||
#include "disk.h"
|
#include "disk.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define VERIFY_WRITE 1
|
//#define VERIFY_WRITE 1
|
||||||
|
|
||||||
/* command flags */
|
/* command flags */
|
||||||
#define MCI_NO_RESP (0<<0)
|
#define MCI_NO_RESP (0<<0)
|
||||||
|
@ -382,6 +382,7 @@ static int sd_init_card(const int drive)
|
||||||
if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_RESP, &response))
|
if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_RESP, &response))
|
||||||
return -10;
|
return -10;
|
||||||
|
|
||||||
|
#if 0 /* FIXME : it seems that reading fails on some models */
|
||||||
/* Switch to to 4 bit widebus mode */
|
/* Switch to to 4 bit widebus mode */
|
||||||
if(sd_wait_for_tran_state(drive) < 0)
|
if(sd_wait_for_tran_state(drive) < 0)
|
||||||
return -11;
|
return -11;
|
||||||
|
@ -393,6 +394,7 @@ static int sd_init_card(const int drive)
|
||||||
return -13;
|
return -13;
|
||||||
/* Now that card is widebus make controller aware */
|
/* Now that card is widebus make controller aware */
|
||||||
MCI_CLOCK(drive) |= MCI_CLOCK_WIDEBUS;
|
MCI_CLOCK(drive) |= MCI_CLOCK_WIDEBUS;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* enable bank switching
|
* enable bank switching
|
||||||
|
@ -913,8 +915,11 @@ int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
|
||||||
ret = sd_transfer_sectors(IF_MD2(drive,) start, count, (void*)buf, true);
|
ret = sd_transfer_sectors(IF_MD2(drive,) start, count, (void*)buf, true);
|
||||||
|
|
||||||
#ifdef VERIFY_WRITE
|
#ifdef VERIFY_WRITE
|
||||||
if (ret) /* write failed, no point in verifying */
|
if (ret) {
|
||||||
goto write_error;
|
/* write failed, no point in verifying */
|
||||||
|
mutex_unlock(&sd_mtx);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
count = saved_count;
|
count = saved_count;
|
||||||
buf = saved_buf;
|
buf = saved_buf;
|
||||||
|
@ -937,7 +942,6 @@ int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
write_error:
|
|
||||||
mutex_unlock(&sd_mtx);
|
mutex_unlock(&sd_mtx);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue