From: "Philippe Mathieu-Daudé" <f4bug@amsat.org> To: Peter Maydell <peter.maydell@linaro.org> Cc: "open list:RISC-V" <qemu-riscv@nongnu.org>, "Bin Meng" <bin.meng@windriver.com>, "Markus Armbruster" <armbru@redhat.com>, "Alistair Francis" <alistair23@gmail.com>, "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Paolo Bonzini" <pbonzini@redhat.com>, "Bin Meng" <bmeng.cn@gmail.com> Subject: Re: [PATCH] hw/char/mchp_pfsoc_mmuart: QOM'ify PolarFire MMUART Date: Thu, 23 Sep 2021 12:52:11 +0200 [thread overview] Message-ID: <58a51968-39b9-1477-5c18-db9638fa66e3@amsat.org> (raw) In-Reply-To: <CAFEAcA9aZ3HXmHc12X58N5k=1dfk6SZWEU9Uf1ErajNj0EHWxg@mail.gmail.com> 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. OK, I'll add that in a previous patch. Thanks, Phil.
WARNING: multiple messages have this Message-ID (diff)
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org> To: Peter Maydell <peter.maydell@linaro.org> Cc: "open list:RISC-V" <qemu-riscv@nongnu.org>, "Bin Meng" <bin.meng@windriver.com>, "Markus Armbruster" <armbru@redhat.com>, "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>, "Paolo Bonzini" <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Alistair Francis" <alistair23@gmail.com>, "Bin Meng" <bmeng.cn@gmail.com> Subject: Re: [PATCH] hw/char/mchp_pfsoc_mmuart: QOM'ify PolarFire MMUART Date: Thu, 23 Sep 2021 12:52:11 +0200 [thread overview] Message-ID: <58a51968-39b9-1477-5c18-db9638fa66e3@amsat.org> (raw) In-Reply-To: <CAFEAcA9aZ3HXmHc12X58N5k=1dfk6SZWEU9Uf1ErajNj0EHWxg@mail.gmail.com> 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. OK, I'll add that in a previous patch. Thanks, Phil.
next prev parent reply other threads:[~2021-09-23 10:53 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-18 18:07 [PATCH] hw/char/mchp_pfsoc_mmuart: QOM'ify PolarFire MMUART Philippe Mathieu-Daudé 2021-09-18 18:07 ` Philippe Mathieu-Daudé 2021-09-19 23:06 ` Alistair Francis 2021-09-19 23:06 ` Alistair Francis 2021-09-23 5:16 ` Bin Meng 2021-09-23 5:16 ` Bin Meng 2021-09-23 10:29 ` Philippe Mathieu-Daudé 2021-09-23 10:29 ` Philippe Mathieu-Daudé 2021-09-23 10:41 ` Peter Maydell 2021-09-23 10:41 ` Peter Maydell 2021-09-23 10:52 ` Philippe Mathieu-Daudé [this message] 2021-09-23 10:52 ` Philippe Mathieu-Daudé 2021-09-23 10:56 ` Philippe Mathieu-Daudé 2021-09-23 10:56 ` Philippe Mathieu-Daudé 2021-09-25 12:30 ` Philippe Mathieu-Daudé 2021-09-25 12:30 ` Philippe Mathieu-Daudé 2021-09-26 7:59 ` Bin Meng 2021-09-26 7:59 ` Bin Meng
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=58a51968-39b9-1477-5c18-db9638fa66e3@amsat.org \ --to=f4bug@amsat.org \ --cc=alistair23@gmail.com \ --cc=armbru@redhat.com \ --cc=bin.meng@windriver.com \ --cc=bmeng.cn@gmail.com \ --cc=marcandre.lureau@redhat.com \ --cc=pbonzini@redhat.com \ --cc=peter.maydell@linaro.org \ --cc=qemu-devel@nongnu.org \ --cc=qemu-riscv@nongnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.