From: Sai Pavan Boddu <saip...@xilinx.com>

The 64-bit ADMA address is not converted to the cpu endianes correctly.
This patch fixes the issue and uses a valid mask for the attribute data.

Signed-off-by: Sai Pavan Boddu <saip...@xilinx.com>
[AF: Re-write commit message]
Reviewed-by: Alistair Francis <alistair.fran...@xilinx.com>
---
 hw/sd/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index a563a7c88d..4c8a321942 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -668,8 +668,8 @@ static void get_adma_description(SDHCIState *s, ADMADescr 
*dscr)
         dscr->length = le16_to_cpu(dscr->length);
         dma_memory_read(s->dma_as, entry_addr + 4,
                         (uint8_t *)(&dscr->addr), 8);
-        dscr->attr = le64_to_cpu(dscr->attr);
-        dscr->attr &= 0xfffffff8;
+        dscr->addr = le64_to_cpu(dscr->addr);
+        dscr->attr &= (uint8_t) ~0xC0;
         dscr->incr = 12;
         break;
     }
-- 
2.16.1


Reply via email to