diff options
author | Mike Nawrocki | 2017-11-06 17:10:39 +0100 |
---|---|---|
committer | Paolo Bonzini | 2017-11-06 17:15:14 +0100 |
commit | e5a11847c485b3d360e3f4c967eba9c4455e2f7d (patch) | |
tree | 41a993986e55fc628f178951f5422239b45b91e2 /hw/char/serial.c | |
parent | Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ... (diff) | |
download | qemu-e5a11847c485b3d360e3f4c967eba9c4455e2f7d.tar.gz qemu-e5a11847c485b3d360e3f4c967eba9c4455e2f7d.tar.xz qemu-e5a11847c485b3d360e3f4c967eba9c4455e2f7d.zip |
Enable 8-byte wide MMIO for 16550 serial devices
Some drivers for the PPMC7400 PowerPC evaluation board accesses the
serial registers through the floating point unit (stfd/ldfd), which is
an 8-byte wide access. This patch enables that behavior.
Signed-off-by: Mike Nawrocki <michael.nawrocki@gtri.gatech.edu>
Message-Id: <20171106161039.32596-1-michael.nawrocki@gtri.gatech.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/char/serial.c')
-rw-r--r-- | hw/char/serial.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/char/serial.c b/hw/char/serial.c index 376bd2f240..eb72191ee7 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -1005,7 +1005,7 @@ static void serial_mm_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { SerialState *s = opaque; - value &= ~0u >> (32 - (size * 8)); + value &= 255; serial_ioport_write(s, addr >> s->it_shift, value, 1); } @@ -1014,16 +1014,22 @@ static const MemoryRegionOps serial_mm_ops[3] = { .read = serial_mm_read, .write = serial_mm_write, .endianness = DEVICE_NATIVE_ENDIAN, + .valid.max_access_size = 8, + .impl.max_access_size = 8, }, [DEVICE_LITTLE_ENDIAN] = { .read = serial_mm_read, .write = serial_mm_write, .endianness = DEVICE_LITTLE_ENDIAN, + .valid.max_access_size = 8, + .impl.max_access_size = 8, }, [DEVICE_BIG_ENDIAN] = { .read = serial_mm_read, .write = serial_mm_write, .endianness = DEVICE_BIG_ENDIAN, + .valid.max_access_size = 8, + .impl.max_access_size = 8, }, }; |