qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/6] hw/dma/rc4030: Use DMA address space to do DMA accesses


From: Philippe Mathieu-Daudé
Subject: [PATCH 2/6] hw/dma/rc4030: Use DMA address space to do DMA accesses
Date: Sun, 31 May 2020 19:54:21 +0200

The DMA device should not use the CPU address space
to do its operation, but its own address space.
Replace cpu_physical_memory_write() by dma_memory_read()
since we already have the DMA address space available.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/dma/rc4030.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c
index eefbabd758..c39fe2bb69 100644
--- a/hw/dma/rc4030.c
+++ b/hw/dma/rc4030.c
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "sysemu/dma.h"
 #include "hw/irq.h"
 #include "hw/mips/mips.h"
 #include "hw/sysbus.h"
@@ -301,7 +302,7 @@ static void rc4030_write(void *opaque, hwaddr addr, 
uint64_t data,
         if (s->cache_ltag == 0x80000001 && s->cache_bmask == 0xf0f0f0f) {
             hwaddr dest = s->cache_ptag & ~0x1;
             dest += (s->cache_maint & 0x3) << 3;
-            cpu_physical_memory_write(dest, &val, 4);
+            dma_memory_read(&s->dma_as, dest, &val, 4);
         }
         break;
     /* Remote Speed Registers */
-- 
2.21.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]