dbdma: fix endian of DBDMA_CMDPTR_LO during branch
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sun, 10 Jul 2016 18:08:55 +0000 (19:08 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 18 Jul 2016 00:40:27 +0000 (10:40 +1000)
The current DBDMA command is stored in little-endian format, so make sure
we convert it to match our CPU when updating the DBDMA_CMDPTR_LO register.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/misc/macio/mac_dbdma.c

index e692312..c4ee381 100644 (file)
@@ -213,7 +213,7 @@ static void branch(DBDMA_channel *ch)
 {
     dbdma_cmd *current = &ch->current;
 
-    ch->regs[DBDMA_CMDPTR_LO] = current->cmd_dep;
+    ch->regs[DBDMA_CMDPTR_LO] = le32_to_cpu(current->cmd_dep);
     ch->regs[DBDMA_STATUS] |= BT;
     dbdma_cmdptr_load(ch);
 }