summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-06-22 09:02:56 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-06-22 09:02:56 +0000
commit5a44e43870d6f172aebb9d659cec5427d587f587 (patch)
treeb9252e7a22db90249ed7c138b07196009db1e54a
parentac9287bdb5b94d575b5130ccdc2fe25c45ca395e (diff)
downloadrockbox-5a44e43870d6f172aebb9d659cec5427d587f587.zip
rockbox-5a44e43870d6f172aebb9d659cec5427d587f587.tar.gz
rockbox-5a44e43870d6f172aebb9d659cec5427d587f587.tar.bz2
rockbox-5a44e43870d6f172aebb9d659cec5427d587f587.tar.xz
revert r26953 + r26954
test_disk says everything is alright but playback is buggy, especially when playing lossless files git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27044 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c28
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c31
-rw-r--r--firmware/target/arm/as3525/system-target.h6
3 files changed, 12 insertions, 53 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 7f4bcf1..9e55c16 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -669,7 +669,6 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
#endif
int ret = 0;
unsigned loops = 0;
- bool aligned = !((uintptr_t)buf & (CACHEALIGN_SIZE - 1));
mutex_lock(&sd_mtx);
sd_enable(true);
@@ -701,14 +700,6 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
dma_retain();
- if(aligned)
- {
- if(write)
- clean_dcache_range(buf, count * SECTOR_SIZE);
- else
- dump_dcache_range(buf, count * SECTOR_SIZE);
- }
-
while(count)
{
/* 128 * 512 = 2^16, and doesn't fit in the 16 bits of DATA_LENGTH
@@ -749,19 +740,12 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
if(!(card_info[drive].ocr & (1<<30))) /* not SDHC */
bank_start *= SD_BLOCK_SIZE;
- if(aligned)
- {
- dma_buf = AS3525_PHYSICAL_ADDR(buf);
- }
- else
- {
- dma_buf = aligned_buffer;
- if(transfer > UNALIGNED_NUM_SECTORS)
- transfer = UNALIGNED_NUM_SECTORS;
+ dma_buf = aligned_buffer;
+ if(transfer > UNALIGNED_NUM_SECTORS)
+ transfer = UNALIGNED_NUM_SECTORS;
- if(write)
- memcpy(uncached_buffer, buf, transfer * SD_BLOCK_SIZE);
- }
+ if(write)
+ memcpy(uncached_buffer, buf, transfer * SD_BLOCK_SIZE);
ret = sd_wait_for_tran_state(drive);
if (ret < 0)
@@ -820,7 +804,7 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
if(!transfer_error[drive])
{
- if(!write && !aligned)
+ if(!write)
memcpy(buf, uncached_buffer, transfer * SD_BLOCK_SIZE);
buf += transfer * SD_BLOCK_SIZE;
start += transfer;
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 238cd7a..386b76e 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -789,8 +789,6 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
#ifndef HAVE_MULTIDRIVE
const int drive = 0;
#endif
- bool aligned = !((uintptr_t)buf & (CACHEALIGN_SIZE - 1));
-
mutex_lock(&sd_mtx);
#ifndef BOOTLOADER
@@ -830,34 +828,17 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
last_disk_activity = current_tick;
dma_retain();
- if(aligned)
- {
- if(write)
- clean_dcache_range(buf, count * SECTOR_SIZE);
- else
- dump_dcache_range(buf, count * SECTOR_SIZE);
- }
-
const int cmd = write ? SD_WRITE_MULTIPLE_BLOCK : SD_READ_MULTIPLE_BLOCK;
do
{
- void *dma_buf;
+ void *dma_buf = aligned_buffer;
unsigned int transfer = count;
+ if(transfer > UNALIGNED_NUM_SECTORS)
+ transfer = UNALIGNED_NUM_SECTORS;
- if(aligned)
- {
- dma_buf = AS3525_PHYSICAL_ADDR(buf);
- }
- else
- {
- dma_buf = aligned_buffer;
- if(transfer > UNALIGNED_NUM_SECTORS)
- transfer = UNALIGNED_NUM_SECTORS;
-
- if(write)
- memcpy(uncached_buffer, buf, transfer * SD_BLOCK_SIZE);
- }
+ if(write)
+ memcpy(uncached_buffer, buf, transfer * SD_BLOCK_SIZE);
/* Interrupt handler might set this to true during transfer */
retry = false;
@@ -912,7 +893,7 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
if(!retry)
{
- if(!write && !aligned)
+ if(!write)
memcpy(buf, uncached_buffer, transfer * SD_BLOCK_SIZE);
buf += transfer * SD_BLOCK_SIZE;
start += transfer;
diff --git a/firmware/target/arm/as3525/system-target.h b/firmware/target/arm/as3525/system-target.h
index b3b9001..f7dc1ac 100644
--- a/firmware/target/arm/as3525/system-target.h
+++ b/firmware/target/arm/as3525/system-target.h
@@ -27,8 +27,6 @@
#include "clock-target.h" /* CPUFREQ_* are defined here */
-#define STORAGE_WANTS_ALIGN
-
/* We can use a interrupt-based mechanism on the fuzev2 */
#define INCREASED_SCROLLWHEEL_POLLING \
(defined(HAVE_SCROLLWHEEL) && (CONFIG_CPU == AS3525))
@@ -41,10 +39,6 @@
#endif
#define AS3525_UNCACHED_ADDR(a) ((typeof(a)) ((uintptr_t)(a) + 0x10000000))
-#define AS3525_PHYSICAL_ADDR(a) \
- ((typeof(a)) ((((uintptr_t)(a)) & (MEM*0x100000)) \
- ? (((uintptr_t)(a)) - IRAM_ORIG) \
- : ((uintptr_t)(a))))
#ifdef SANSA_C200V2
/* 0: Backlight on A5, 1: Backlight on A7 */