|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH] hw/char/mchp_pfsoc_mmuart: QOM'ify PolarFire MMUART |
Date: | Thu, 23 Sep 2021 12:56:01 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 |
On 9/23/21 12:52, Philippe Mathieu-Daudé wrote:
On 9/23/21 12:41, Peter Maydell wrote:On Thu, 23 Sept 2021 at 11:29, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:On 9/23/21 07:16, Bin Meng wrote:> On Sun, Sep 19, 2021 at 2:07 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:+static void mchp_pfsoc_mmuart_realize(DeviceState *dev, Error **errp) +{ + MchpPfSoCMMUartState *s = MCHP_PFSOC_UART(dev); + + qdev_prop_set_uint8(DEVICE(&s->serial_mm), "regshift", 2); + qdev_prop_set_uint32(DEVICE(&s->serial_mm), "baudbase", 399193); + qdev_prop_set_uint8(DEVICE(&s->serial_mm), "endianness", + DEVICE_LITTLE_ENDIAN);It looks like serial_mm_init() does one more thing: qdev_set_legacy_instance_id(DEVICE(smm), base, 2); I am not sure what that is.I'll defer on Paolo / Marc-André for that part, I think this is for migrating legacy (x86?) machines, which is not the case.Yes, this is only needed for backwards-compatibility of incoming migration data with old versions of QEMU which implemented migration of devices with hand-rolled code. If a device didn't previously handle migration at all then it should not now be setting the legacy instance ID.Thanks. I'll try to add that in the documentation somewhere.Speaking of migration, I notice that this QOM conversion does not add a vmstate, which usually we do as part of the QOM conversion. The device is also missing a reset method.
Sigh, you reminded me of this series: "hw: Mark devices with no migratable fields" https://lore.kernel.org/qemu-devel/20210117192446.23753-19-f4bug@amsat.org/
OK, I'll add that in a previous patch. Thanks, Phil.
[Prev in Thread] | Current Thread | [Next in Thread] |