Patchwork [04/15] dbdma: Make little endian

login
register
mail settings
Submitter Alexander Graf
Date Nov. 25, 2010, 7:35 a.m.
Message ID <1290670555-12575-5-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/73013/
State New
Headers show

Comments

Alexander Graf - Nov. 25, 2010, 7:35 a.m.
The device is only used on big endian systems, but always byte swaps. That's
a very good indicator that it's actually a little endian device ;-).

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/mac_dbdma.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

Patch

diff --git a/hw/mac_dbdma.c b/hw/mac_dbdma.c
index f449a59..5680fa9 100644
--- a/hw/mac_dbdma.c
+++ b/hw/mac_dbdma.c
@@ -707,8 +707,6 @@  static void dbdma_writel (void *opaque,
     DBDMA_DPRINTF("channel 0x%x reg 0x%x\n",
                   (uint32_t)addr >> DBDMA_CHANNEL_SHIFT, reg);
 
-    value = bswap32(value);
-
     /* cmdptr cannot be modified if channel is RUN or ACTIVE */
 
     if (reg == DBDMA_CMDPTR_LO &&
@@ -788,7 +786,6 @@  static uint32_t dbdma_readl (void *opaque, target_phys_addr_t addr)
         break;
     }
 
-    value = bswap32(value);
     return value;
 }
 
@@ -845,7 +842,7 @@  void* DBDMA_init (int *dbdma_mem_index)
     s = qemu_mallocz(sizeof(DBDMA_channel) * DBDMA_CHANNELS);
 
     *dbdma_mem_index = cpu_register_io_memory(dbdma_read, dbdma_write, s,
-                                              DEVICE_NATIVE_ENDIAN);
+                                              DEVICE_LITTLE_ENDIAN);
     register_savevm(NULL, "dbdma", -1, 1, dbdma_save, dbdma_load, s);
     qemu_register_reset(dbdma_reset, s);