The number of blocks is defined in the lower bits [15:0]. TODO: This needs to be more precise on the spec version.
Signed-off-by: Cédric Le Goater <c...@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 c4c9e9ee7999..7f07d0e99d15 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1282,7 +1282,7 @@ static sd_rsp_type_t sd_cmd_SET_BLOCK_COUNT(SDState *sd, SDRequest req) return sd_invalid_state_for_cmd(sd, req); } - sd->multi_blk_cnt = req.arg; + sd->multi_blk_cnt = req.arg & 0xFFFF; return sd_r1; } -- 2.41.0