summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 */