[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 15/33] serial-mm: add endianness property
From: |
Marc-André Lureau |
Subject: |
[PATCH v3 15/33] serial-mm: add endianness property |
Date: |
Wed, 23 Oct 2019 19:31:36 +0200 |
Add a qdev property for endianness, so memory region setup can be done
in realize.
Signed-off-by: Marc-André Lureau <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 c28cfc94fd..2f7667c30c 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -1081,6 +1081,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_prop_set_int32(DEVICE(s), "instance-id", base);
+ qdev_prop_set_uint8(DEVICE(s), "endianness", end);
qdev_init_nofail(DEVICE(s));
qdev_init_nofail(DEVICE(self));
@@ -1102,6 +1103,7 @@ static void serial_mm_instance_init(Object *o)
static Property serial_mm_properties[] = {
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 759c85976d..2d0802a909 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -86,6 +86,7 @@ typedef struct SerialMM {
SerialState serial;
uint8_t regshift;
+ uint8_t endianness;
} SerialMM;
extern const VMStateDescription vmstate_serial;
--
2.23.0.606.g08da6496b6
- [PATCH v3 08/33] serial: add "chardev" property, (continued)
- [PATCH v3 08/33] serial: add "chardev" property, Marc-André Lureau, 2019/10/23
- [PATCH v3 09/33] serial: add "baudbase" property, Marc-André Lureau, 2019/10/23
- [PATCH v3 10/33] serial: add "instance-id" property, Marc-André Lureau, 2019/10/23
- [PATCH v3 11/33] serial: realize the serial device, Marc-André Lureau, 2019/10/23
- [PATCH v3 13/33] serial: start making SerialMM a sysbus device, Marc-André Lureau, 2019/10/23
- [PATCH v3 12/33] serial: replace serial_exit_core() with unrealize, Marc-André Lureau, 2019/10/23
- [PATCH v3 14/33] serial-mm: add "regshift" property, Marc-André Lureau, 2019/10/23
- [PATCH v3 16/33] serial-mm: use sysbus facilities, Marc-André Lureau, 2019/10/23
- [PATCH v3 15/33] serial-mm: add endianness property,
Marc-André Lureau <=
- [PATCH v3 17/33] serial: make SerialIO a sysbus device, Marc-André Lureau, 2019/10/23
- [PATCH v3 18/33] mips: inline serial_init, Marc-André Lureau, 2019/10/23
- [PATCH v3 21/33] lance: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2019/10/23
- Re: [PATCH v3 21/33] lance: replace PROP_PTR with PROP_LINK, Philippe Mathieu-Daudé, 2019/10/23
- Re: [PATCH v3 21/33] lance: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2019/10/24
- Re: [PATCH v3 21/33] lance: replace PROP_PTR with PROP_LINK, Philippe Mathieu-Daudé, 2019/10/24
- Re: [PATCH v3 21/33] lance: replace PROP_PTR with PROP_LINK, Peter Maydell, 2019/10/24
- Re: [PATCH v3 21/33] lance: replace PROP_PTR with PROP_LINK, Eduardo Habkost, 2019/10/24
- Re: [PATCH v3 21/33] lance: replace PROP_PTR with PROP_LINK, Peter Maydell, 2019/10/25
- Re: [PATCH v3 21/33] lance: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2019/10/24