[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 14/37] serial-mm: add endianness property
From: |
Marc-André Lureau |
Subject: |
[PATCH v4 14/37] serial-mm: add endianness property |
Date: |
Wed, 20 Nov 2019 19:24: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>
---
hw/char/serial.c | 2 ++
include/hw/char/serial.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 225f09f30f..1c16fed4d1 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -1080,6 +1080,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(s));
qdev_init_nofail(DEVICE(smm));
@@ -1106,6 +1107,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;
--
2.24.0
- Re: [PATCH v4 10/37] serial: realize the serial device, (continued)
- [PATCH v4 11/37] serial: replace serial_exit_core() with unrealize, Marc-André Lureau, 2019/11/20
- [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Marc-André Lureau, 2019/11/20
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Peter Maydell, 2019/11/21
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Marc-André Lureau, 2019/11/21
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Peter Maydell, 2019/11/21
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Marc-André Lureau, 2019/11/21
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Peter Maydell, 2019/11/22
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Marc-André Lureau, 2019/11/22
[PATCH v4 13/37] serial-mm: add "regshift" property, Marc-André Lureau, 2019/11/20
[PATCH v4 14/37] serial-mm: add endianness property,
Marc-André Lureau <=
[PATCH v4 15/37] serial-mm: use sysbus facilities, Marc-André Lureau, 2019/11/20
[PATCH v4 16/37] serial: make SerialIO a sysbus device, Marc-André Lureau, 2019/11/20
[PATCH v4 17/37] mips: inline serial_init(), Marc-André Lureau, 2019/11/20
Re: [PATCH v4 17/37] mips: inline serial_init(), Aleksandar Markovic, 2019/11/27