[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/37] serial-mm: add endianness property
From: |
Marc-André Lureau |
Subject: |
[PULL 14/37] serial-mm: add endianness property |
Date: |
Tue, 7 Jan 2020 19:04:19 +0400 |
Add a qdev property for endianness, so memory region setup can be done
in realize.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
include/hw/char/serial.h | 1 +
hw/char/serial.c | 2 ++
2 files changed, 3 insertions(+)
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;
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(),
};
--
2.25.0.rc1.20.g2443f3f80d
- [PULL 04/37] chardev: generate an internal id when none given, (continued)
- [PULL 04/37] chardev: generate an internal id when none given, Marc-André Lureau, 2020/01/07
- [PULL 05/37] serial-pci-multi: factor out multi_serial_get_port_count(), Marc-André Lureau, 2020/01/07
- [PULL 06/37] serial: initial qom-ification, Marc-André Lureau, 2020/01/07
- [PULL 07/37] serial: register vmsd with DeviceClass, Marc-André Lureau, 2020/01/07
- [PULL 08/37] serial: add "chardev" property, Marc-André Lureau, 2020/01/07
- [PULL 09/37] serial: add "baudbase" property, Marc-André Lureau, 2020/01/07
- [PULL 10/37] serial: realize the serial device, Marc-André Lureau, 2020/01/07
- [PULL 11/37] serial: replace serial_exit_core() with unrealize, Marc-André Lureau, 2020/01/07
- [PULL 12/37] serial: start making SerialMM a sysbus device, Marc-André Lureau, 2020/01/07
- [PULL 13/37] serial-mm: add "regshift" property, Marc-André Lureau, 2020/01/07
- [PULL 14/37] serial-mm: add endianness property,
Marc-André Lureau <=
- [PULL 15/37] serial-mm: use sysbus facilities, Marc-André Lureau, 2020/01/07
- [PULL 17/37] mips: inline serial_init(), Marc-André Lureau, 2020/01/07
- [PULL 16/37] serial: make SerialIO a sysbus device, Marc-André Lureau, 2020/01/07
- [PULL 18/37] mips: baudbase is 115200 by default, Marc-André Lureau, 2020/01/07
- [PULL 19/37] mips: use sysbus_add_io(), Marc-André Lureau, 2020/01/07
- [PULL 20/37] mips: use sysbus_mmio_get_region() instead of internal fields, Marc-André Lureau, 2020/01/07
- [PULL 21/37] sm501: make SerialMM a child, export chardev property, Marc-André Lureau, 2020/01/07
- [PULL 22/37] vmmouse: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2020/01/07
- [PULL 24/37] etraxfs: remove PROP_PTR usage, Marc-André Lureau, 2020/01/07
- [PULL 23/37] lance: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2020/01/07