qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 12/17] hw/sd: Fix SET_BLOCK_COUNT command argument


From: Cédric Le Goater
Subject: [RFC PATCH 12/17] hw/sd: Fix SET_BLOCK_COUNT command argument
Date: Fri, 18 Mar 2022 14:28:19 +0100

The number of blocks is defined in the lower bits [15:0].

WIP. This needs to be more precise on the spec version.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/sd/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 5d7f04adf5a4..517699c5fc98 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1406,7 +1406,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, 
SDRequest req)
         }
         switch (sd->state) {
         case sd_transfer_state:
-            sd->multi_blk_cnt = req.arg;
+            sd->multi_blk_cnt = req.arg & 0xFFFF;
             return sd_r1;
 
         default:
-- 
2.34.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]