On Tue, 22 Oct 2019 at 17:42, Marc-André Lureau <marcandre.lur...@redhat.com> wrote: > > Hi > > On Tue, Oct 22, 2019 at 6:32 PM Peter Maydell <peter.mayd...@linaro.org> > wrote: > > > > On Tue, 22 Oct 2019 at 17:23, Marc-André Lureau > > <marcandre.lur...@redhat.com> wrote: > > Devices shouldn't have properties to set their MMIO base > > address -- instead the memory-mapped serial device should > > be a child of TYPE_SYSBUS_DEVICE, and should provide > > a sysbus mmio region, which users of the device can > > map at the address they want to map the registers. > > > Can we make serial a sysbus device? It seems to be embedded from > various places, in various buses. Not sure that makes sense, please > advise me :)
You want the SerialMMState to be is-a sysbus-device, and to has-a SerialState, I think. > "base" is mostly needed to set qdev_set_legacy_instance_id(), I should > have added a commit comment. Otherwise, it can be passed to > serial_mm_connect() directly. serial_mm_connect() shouldn't exist at all, though -- we want to end up with a normal sysbus device whose users create it and wire up its MMIO and IRQ in the same way they do any other sysbus device. thanks -- PMM