diff mbox series

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

Message ID 20220318132824.1134400-13-clg@kaod.org
State New
Headers show
Series hw/sd: Rework models for eMMC support | expand

Commit Message

Cédric Le Goater March 18, 2022, 1:28 p.m. UTC
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 mbox series

Patch

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: