summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-07-19 16:08:57 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-07-19 16:08:57 +0000
commit08c600ca07503d6f4f34db9eae2ffbe0230c4fd7 (patch)
tree50498be644d2266c68dd6739621aaa0165f763f1 /firmware/target/arm
parentb221d6d4d4d0ade805d249fdd69a8b8b92769268 (diff)
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
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 35cb997629..d77c7133b6 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -52,7 +52,7 @@
#include "disk.h"
#endif
-#define VERIFY_WRITE 1
+//#define VERIFY_WRITE 1
/* command flags */
#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))
return -10;
+#if 0 /* FIXME : it seems that reading fails on some models */
/* Switch to to 4 bit widebus mode */
if(sd_wait_for_tran_state(drive) < 0)
return -11;
@@ -393,6 +394,7 @@ static int sd_init_card(const int drive)
return -13;
/* Now that card is widebus make controller aware */
MCI_CLOCK(drive) |= MCI_CLOCK_WIDEBUS;
+#endif
/*
* 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);
#ifdef VERIFY_WRITE
- if (ret) /* write failed, no point in verifying */
- goto write_error;
+ if (ret) {
+ /* write failed, no point in verifying */
+ mutex_unlock(&sd_mtx);
+ return ret;
+ }
count = saved_count;
buf = saved_buf;
@@ -937,7 +942,6 @@ int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
}
#endif
-write_error:
mutex_unlock(&sd_mtx);
return ret;