summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-06-01 03:50:52 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-06-01 03:50:52 +0000
commitacb524e51a9bc1a0b8461e046d2770172a6677a7 (patch)
tree7d6dcf304f5dfd22020459e56264fc6dc07bcb60 /firmware
parentc225b170158f2419a3dcff9a119ee9b6d062e207 (diff)
sd-as3525v1: set up bank selection data outside of the loop
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26441 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 19914abd43..1f935a426e 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -604,6 +604,16 @@ static int sd_select_bank(signed char bank)
int ret;
unsigned loops = 0;
+ memset(uncached_buffer, 0, 512);
+ if(bank == -1)
+ { /* enable bank switching */
+ uncached_buffer[0] = 16;
+ uncached_buffer[1] = 1;
+ uncached_buffer[2] = 10;
+ }
+ else
+ uncached_buffer[0] = bank;
+
do {
if(loops++ > PL180_MAX_TRANSFER_ERRORS)
panicf("SD bank %d error : 0x%x", bank,
@@ -623,16 +633,6 @@ static int sd_select_bank(signed char bank)
mci_delay();
- memset(uncached_buffer, 0, 512);
- if(bank == -1)
- { /* enable bank switching */
- uncached_buffer[0] = 16;
- uncached_buffer[1] = 1;
- uncached_buffer[2] = 10;
- }
- else
- uncached_buffer[0] = bank;
-
dma_retain();
/* we don't use the uncached buffer here, because we need the
* physical memory address for DMA transfers */