[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 05/14] dbdma: fix load_word/store_word value endianness
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 05/14] dbdma: fix load_word/store_word value endianness |
Date: |
Mon, 18 Jul 2016 14:38:41 +1000 |
From: Mark Cave-Ayland <address@hidden>
The values to read/write to/from physical memory are copied directly to the
physical address with no endian swapping required.
Also add some extra information to debugging output while we are here.
Signed-off-by: Mark Cave-Ayland <address@hidden>
Acked-by: Benjamin Herrenschmidt <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/misc/macio/mac_dbdma.c | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
diff --git a/hw/misc/macio/mac_dbdma.c b/hw/misc/macio/mac_dbdma.c
index c4ee381..c5dd0ac 100644
--- a/hw/misc/macio/mac_dbdma.c
+++ b/hw/misc/macio/mac_dbdma.c
@@ -350,9 +350,8 @@ static void load_word(DBDMA_channel *ch, int key, uint32_t
addr,
uint16_t len)
{
dbdma_cmd *current = &ch->current;
- uint32_t val;
- DBDMA_DPRINTFCH(ch, "load_word\n");
+ DBDMA_DPRINTFCH(ch, "load_word %d bytes, addr=%08x\n", len, addr);
/* only implements KEY_SYSTEM */
@@ -362,14 +361,7 @@ static void load_word(DBDMA_channel *ch, int key, uint32_t
addr,
return;
}
- dma_memory_read(&address_space_memory, addr, &val, len);
-
- if (len == 2)
- val = (val << 16) | (current->cmd_dep & 0x0000ffff);
- else if (len == 1)
- val = (val << 24) | (current->cmd_dep & 0x00ffffff);
-
- current->cmd_dep = val;
+ dma_memory_read(&address_space_memory, addr, ¤t->cmd_dep, len);
if (conditional_wait(ch))
goto wait;
@@ -389,9 +381,9 @@ static void store_word(DBDMA_channel *ch, int key, uint32_t
addr,
uint16_t len)
{
dbdma_cmd *current = &ch->current;
- uint32_t val;
- DBDMA_DPRINTFCH(ch, "store_word\n");
+ DBDMA_DPRINTFCH(ch, "store_word %d bytes, addr=%08x pa=%x\n",
+ len, addr, le32_to_cpu(current->cmd_dep));
/* only implements KEY_SYSTEM */
@@ -401,13 +393,7 @@ static void store_word(DBDMA_channel *ch, int key,
uint32_t addr,
return;
}
- val = current->cmd_dep;
- if (len == 2)
- val >>= 16;
- else if (len == 1)
- val >>= 24;
-
- dma_memory_write(&address_space_memory, addr, &val, len);
+ dma_memory_write(&address_space_memory, addr, ¤t->cmd_dep, len);
if (conditional_wait(ch))
goto wait;
--
2.7.4
- [Qemu-ppc] [PULL 00/14] ppc-for-2.7 queue 20160718, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 02/14] dbdma: always define DBDMA_DPRINTF and enable debug with DEBUG_DBDMA, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 01/14] spapr: fix core unplug crash, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 14/14] ppc: Yet another fix for the huge page support detection mechanism, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 03/14] dbdma: add per-channel debugging enabled via DEBUG_DBDMA_CHANMASK, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 05/14] dbdma: fix load_word/store_word value endianness,
David Gibson <=
- [Qemu-ppc] [PULL 10/14] spapr: Ensure CPU cores are added contiguously and removed in LIFO order, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 07/14] dbdma: reset io->processing flag for unassigned DBDMA channel rw accesses, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 13/14] target-ppc: fix left shift overflow in hpte_page_shift, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 06/14] dbdma: set FLUSH bit upon reception of flush command for unassigned DBDMA channels, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 08/14] ppc: Fix support for odd MSR combinations, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 04/14] dbdma: fix endian of DBDMA_CMDPTR_LO during branch, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 12/14] ppc/mmu-hash64: Remove duplicated #include statement, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 09/14] vfio/spapr: Remove stale ioctl() call, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 11/14] ppc: abort if compat property contains an unknown value, David Gibson, 2016/07/18
- Re: [Qemu-ppc] [PULL 00/14] ppc-for-2.7 queue 20160718, Peter Maydell, 2016/07/18