From 432951201714e0eb2d6520cedc5d50a78f56c8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Sat, 19 Jun 2010 05:55:18 +0000 Subject: [PATCH] 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 --- firmware/target/arm/as3525/sd-as3525.c | 2 +- firmware/target/arm/as3525/sd-as3525v2.c | 2 +- firmware/target/arm/as3525/system-target.h | 4 ++++ 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 */