summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-06-19 05:55:18 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-06-19 05:55:18 +0000
commit432951201714e0eb2d6520cedc5d50a78f56c8bc (patch)
tree9cce9c645570d30550d9b964516bf4d0240487d6 /firmware/target
parentffc7323ec3599d09bd3452658c154ad6cd857230 (diff)
fix r26953: use physical address for DMA buffer, also for IRAM
AMSv2 and AMSv1 lowmem put the codec buffer in IRAM so we need to adjust the address : AS3525_PHYSICAL_ADDRESS macro will do just that git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26954 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c2
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c2
-rw-r--r--firmware/target/arm/as3525/system-target.h4
3 files changed, 6 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 52bf6932ec..7f4bcf13fc 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -751,7 +751,7 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
if(aligned)
{
- dma_buf = buf;
+ dma_buf = AS3525_PHYSICAL_ADDR(buf);
}
else
{
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index d268bc779c..238cd7a5eb 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -847,7 +847,7 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
if(aligned)
{
- dma_buf = buf;
+ dma_buf = AS3525_PHYSICAL_ADDR(buf);
}
else
{
diff --git a/firmware/target/arm/as3525/system-target.h b/firmware/target/arm/as3525/system-target.h
index 5d11ecb26c..b3b9001a45 100644
--- a/firmware/target/arm/as3525/system-target.h
+++ b/firmware/target/arm/as3525/system-target.h
@@ -41,6 +41,10 @@
#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 */