aboutsummaryrefslogtreecommitdiff
path: root/hw/sd/milkymist-memcard.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/sd/milkymist-memcard.c')
-rw-r--r--hw/sd/milkymist-memcard.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c
index e8d055bb89..12e091a46e 100644
--- a/hw/sd/milkymist-memcard.c
+++ b/hw/sd/milkymist-memcard.c
@@ -181,6 +181,7 @@ static void memcard_write(void *opaque, hwaddr addr, uint64_t value,
unsigned size)
{
MilkymistMemcardState *s = opaque;
+ uint32_t val32;
trace_milkymist_memcard_memory_write(addr, value);
@@ -209,10 +210,8 @@ static void memcard_write(void *opaque, hwaddr addr, uint64_t value,
if (!s->enabled) {
break;
}
- sdbus_write_byte(&s->sdbus, (value >> 24) & 0xff);
- sdbus_write_byte(&s->sdbus, (value >> 16) & 0xff);
- sdbus_write_byte(&s->sdbus, (value >> 8) & 0xff);
- sdbus_write_byte(&s->sdbus, value & 0xff);
+ val32 = cpu_to_be32(value);
+ sdbus_write_data(&s->sdbus, &val32, sizeof(val32));
break;
case R_ENABLE:
s->regs[addr] = value;