hw/char/mchp_pfsoc_mmuart: QOM'ify PolarFire MMUART
commit31ca70b5ff7c6ac600211f60e3ab024642fe5abb
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sat, 25 Sep 2021 13:34:07 +0000 (25 15:34 +0200)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 6 Oct 2021 22:41:33 +0000 (7 08:41 +1000)
treef40f3bbdcba88e77cd986aaddd81dffe2a8d9e88
parent24ce762df7d10175db1f91962d4fb1355b2645d2
hw/char/mchp_pfsoc_mmuart: QOM'ify PolarFire MMUART

- Embed SerialMM in MchpPfSoCMMUartState and QOM-initialize it
- Alias SERIAL_MM 'chardev' property on MCHP_PFSOC_UART
- Forward SerialMM sysbus IRQ in mchp_pfsoc_mmuart_realize()
- Add DeviceReset() method
- Add vmstate structure for migration
- Register device in 'input' category
- Keep mchp_pfsoc_mmuart_create() behavior

Note, serial_mm_init() calls qdev_set_legacy_instance_id().
This call is only needed for backwards-compatibility of incoming
migration data with old versions of QEMU which implemented migration
of devices with hand-rolled code. Since this device didn't previously
handle migration at all, then it doesn't need to set the legacy
instance ID.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Tested-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20210925133407.1259392-4-f4bug@amsat.org
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/char/mchp_pfsoc_mmuart.c
include/hw/char/mchp_pfsoc_mmuart.h