hw/sd/sdcard: Send WRITE_PROT bits MSB first (CMD30)
commite55cbe727b07f1c39f57c1af842ff2fca9bc2d4a
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 14 Jun 2024 13:17:55 +0000 (14 15:17 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 2 Jul 2024 08:08:24 +0000 (2 10:08 +0200)
treea8d60ff653ad495f5313f661dc9993fcd1aa1448
parentc239084f5b2b13e74716071a5e029329a52e643a
hw/sd/sdcard: Send WRITE_PROT bits MSB first (CMD30)

Per sections 3.6.1 (SD Bus Protocol) and 7.3.2 (Responses):

  In the CMD line the Most Significant Bit is transmitted first.

Use the stl_be_p() helper to store the value in big-endian.

Fixes: a1bb27b1e9 ("Initial SD card emulation")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20240628070216.92609-8-philmd@linaro.org>
hw/sd/sd.c