From: Sai Pavan Boddu Date: Thu, 8 Feb 2018 16:48:00 +0000 (-0300) Subject: sdhci: Fix 64-bit ADMA2 X-Git-Tag: v2.12.0-rc0~93^2~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=04654b5a8c8ed5c2fcd77da0c555c936141ee125;p=thirdparty%2Fqemu.git sdhci: Fix 64-bit ADMA2 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 [AF: Re-write commit message] Reviewed-by: Alistair Francis Message-Id: <20180208164818.7961-13-f4bug@amsat.org> --- diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 1b3791c420d..a6322f20f4f 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -667,8 +667,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; }