aboutsummaryrefslogtreecommitdiff
path: root/hw/sd/milkymist-memcard.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2018-06-29 15:11:20 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-06-29 15:11:20 +0100
commitb3141c0625a18d35c45c175a20826271b3241d92 (patch)
tree6699e0bceca9636f4105786d749e1ee329a385f4 /hw/sd/milkymist-memcard.c
parent13606b99515e8c5f81eab7fd88a70fb2ad506cd8 (diff)
sdcard: Use the ldst API
The load/store API will ease further code movement. Per the Physical Layer Simplified Spec. "3.6 Bus Protocol": "In the CMD line the Most Significant Bit (MSB) is transmitted first, the Least Significant Bit (LSB) is the last." Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/sd/milkymist-memcard.c')
-rw-r--r--hw/sd/milkymist-memcard.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c
index fcbccf54ea..df42aa1c54 100644
--- a/hw/sd/milkymist-memcard.c
+++ b/hw/sd/milkymist-memcard.c
@@ -100,8 +100,7 @@ static void memcard_sd_command(MilkymistMemcardState *s)
SDRequest req;
req.cmd = s->command[0] & 0x3f;
- req.arg = (s->command[1] << 24) | (s->command[2] << 16)
- | (s->command[3] << 8) | s->command[4];
+ req.arg = ldl_be_p(s->command + 1);
req.crc = s->command[5];
s->response[0] = req.cmd;