summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hw/char/serial.c2
-rw-r--r--include/hw/char/serial.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/hw/char/serial.c b/hw/char/serial.c
index f11f2cdbf3..1d350a851b 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -1093,6 +1093,7 @@ SerialMM *serial_mm_init(MemoryRegion *address_space,
qdev_prop_set_uint32(DEVICE(s), "baudbase", baudbase);
qdev_prop_set_chr(DEVICE(s), "chardev", chr);
qdev_set_legacy_instance_id(DEVICE(s), base, 2);
+ qdev_prop_set_uint8(DEVICE(self), "endianness", end);
qdev_init_nofail(DEVICE(smm));
@@ -1118,6 +1119,7 @@ static Property serial_mm_properties[] = {
* previous one.
*/
DEFINE_PROP_UINT8("regshift", SerialMM, regshift, 0),
+ DEFINE_PROP_UINT8("endianness", SerialMM, endianness, DEVICE_NATIVE_ENDIAN),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
index eaeda62698..d586924937 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -85,6 +85,7 @@ typedef struct SerialMM {
SerialState serial;
uint8_t regshift;
+ uint8_t endianness;
} SerialMM;
extern const VMStateDescription vmstate_serial;