qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] macio/dbdma: use DMA memory access helpers
@ 2016-06-05 22:36 Mark Cave-Ayland
  2016-06-05 22:36 ` [Qemu-devel] [PATCH 1/2] macio: use DMA memory interface for non-block ATAPI transfers Mark Cave-Ayland
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark Cave-Ayland @ 2016-06-05 22:36 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, david

This is just a small patchset to move the macio/dbdma interfaces over from
using cpu_physical_memory_read/write to dma_memory_read/write.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> 

Mark Cave-Ayland (2):
  macio: use DMA memory interface for non-block ATAPI transfers
  dbdma: use DMA memory interface for memory accesses

 hw/ide/macio.c            |    3 ++-
 hw/misc/macio/mac_dbdma.c |   13 +++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 1/2] macio: use DMA memory interface for non-block ATAPI transfers
  2016-06-05 22:36 [Qemu-devel] [PATCH 0/2] macio/dbdma: use DMA memory access helpers Mark Cave-Ayland
@ 2016-06-05 22:36 ` Mark Cave-Ayland
  2016-06-05 22:36 ` [Qemu-devel] [PATCH 2/2] dbdma: use DMA memory interface for memory accesses Mark Cave-Ayland
  2016-06-06  1:25 ` [Qemu-devel] [PATCH 0/2] macio/dbdma: use DMA memory access helpers David Gibson
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Cave-Ayland @ 2016-06-05 22:36 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, david

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/ide/macio.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index e4e567e..ad20e1b 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -92,7 +92,8 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
     if (s->lba == -1) {
         /* Non-block ATAPI transfer - just copy to RAM */
         s->io_buffer_size = MIN(s->io_buffer_size, io->len);
-        cpu_physical_memory_write(io->addr, s->io_buffer, s->io_buffer_size);
+        dma_memory_write(&address_space_memory, io->addr, s->io_buffer,
+                         s->io_buffer_size);
         ide_atapi_cmd_ok(s);
         m->dma_active = false;
         goto done;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 2/2] dbdma: use DMA memory interface for memory accesses
  2016-06-05 22:36 [Qemu-devel] [PATCH 0/2] macio/dbdma: use DMA memory access helpers Mark Cave-Ayland
  2016-06-05 22:36 ` [Qemu-devel] [PATCH 1/2] macio: use DMA memory interface for non-block ATAPI transfers Mark Cave-Ayland
@ 2016-06-05 22:36 ` Mark Cave-Ayland
  2016-06-06  1:25 ` [Qemu-devel] [PATCH 0/2] macio/dbdma: use DMA memory access helpers David Gibson
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Cave-Ayland @ 2016-06-05 22:36 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, david

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/misc/macio/mac_dbdma.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/hw/misc/macio/mac_dbdma.c b/hw/misc/macio/mac_dbdma.c
index 5632743..f116f9c 100644
--- a/hw/misc/macio/mac_dbdma.c
+++ b/hw/misc/macio/mac_dbdma.c
@@ -42,6 +42,7 @@
 #include "hw/ppc/mac_dbdma.h"
 #include "qemu/main-loop.h"
 #include "qemu/log.h"
+#include "sysemu/dma.h"
 
 /* debug DBDMA */
 //#define DEBUG_DBDMA
@@ -81,8 +82,8 @@ static void dbdma_cmdptr_load(DBDMA_channel *ch)
 {
     DBDMA_DPRINTF("dbdma_cmdptr_load 0x%08x\n",
                   ch->regs[DBDMA_CMDPTR_LO]);
-    cpu_physical_memory_read(ch->regs[DBDMA_CMDPTR_LO],
-                             &ch->current, sizeof(dbdma_cmd));
+    dma_memory_read(&address_space_memory, ch->regs[DBDMA_CMDPTR_LO],
+                    &ch->current, sizeof(dbdma_cmd));
 }
 
 static void dbdma_cmdptr_save(DBDMA_channel *ch)
@@ -92,8 +93,8 @@ static void dbdma_cmdptr_save(DBDMA_channel *ch)
     DBDMA_DPRINTF("xfer_status 0x%08x res_count 0x%04x\n",
                   le16_to_cpu(ch->current.xfer_status),
                   le16_to_cpu(ch->current.res_count));
-    cpu_physical_memory_write(ch->regs[DBDMA_CMDPTR_LO],
-                              &ch->current, sizeof(dbdma_cmd));
+    dma_memory_write(&address_space_memory, ch->regs[DBDMA_CMDPTR_LO],
+                     &ch->current, sizeof(dbdma_cmd));
 }
 
 static void kill_channel(DBDMA_channel *ch)
@@ -353,7 +354,7 @@ static void load_word(DBDMA_channel *ch, int key, uint32_t addr,
         return;
     }
 
-    cpu_physical_memory_read(addr, &val, len);
+    dma_memory_read(&address_space_memory, addr, &val, len);
 
     if (len == 2)
         val = (val << 16) | (current->cmd_dep & 0x0000ffff);
@@ -398,7 +399,7 @@ static void store_word(DBDMA_channel *ch, int key, uint32_t addr,
     else if (len == 1)
         val >>= 24;
 
-    cpu_physical_memory_write(addr, &val, len);
+    dma_memory_write(&address_space_memory, addr, &val, len);
 
     if (conditional_wait(ch))
         goto wait;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] macio/dbdma: use DMA memory access helpers
  2016-06-05 22:36 [Qemu-devel] [PATCH 0/2] macio/dbdma: use DMA memory access helpers Mark Cave-Ayland
  2016-06-05 22:36 ` [Qemu-devel] [PATCH 1/2] macio: use DMA memory interface for non-block ATAPI transfers Mark Cave-Ayland
  2016-06-05 22:36 ` [Qemu-devel] [PATCH 2/2] dbdma: use DMA memory interface for memory accesses Mark Cave-Ayland
@ 2016-06-06  1:25 ` David Gibson
  2 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2016-06-06  1:25 UTC (permalink / raw)
  To: Mark Cave-Ayland; +Cc: qemu-devel, qemu-ppc

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

On Sun, Jun 05, 2016 at 11:36:41PM +0100, Mark Cave-Ayland wrote:
> This is just a small patchset to move the macio/dbdma interfaces over from
> using cpu_physical_memory_read/write to dma_memory_read/write.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> 
> 
> Mark Cave-Ayland (2):
>   macio: use DMA memory interface for non-block ATAPI transfers
>   dbdma: use DMA memory interface for memory accesses
> 
>  hw/ide/macio.c            |    3 ++-
>  hw/misc/macio/mac_dbdma.c |   13 +++++++------
>  2 files changed, 9 insertions(+), 7 deletions(-)

Applied to ppc-for-2.7, thanks.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-06  1:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-05 22:36 [Qemu-devel] [PATCH 0/2] macio/dbdma: use DMA memory access helpers Mark Cave-Ayland
2016-06-05 22:36 ` [Qemu-devel] [PATCH 1/2] macio: use DMA memory interface for non-block ATAPI transfers Mark Cave-Ayland
2016-06-05 22:36 ` [Qemu-devel] [PATCH 2/2] dbdma: use DMA memory interface for memory accesses Mark Cave-Ayland
2016-06-06  1:25 ` [Qemu-devel] [PATCH 0/2] macio/dbdma: use DMA memory access helpers David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).