Hi Gred, > -----Original Message----- > From: Gerd Hoffmann <kra...@redhat.com> > Sent: Tuesday, June 30, 2020 1:09 AM > To: Sai Pavan Boddu <saip...@xilinx.com> > Cc: Markus Armbruster <arm...@redhat.com>; Peter Maydell > <peter.mayd...@linaro.org>; Thomas Huth <th...@redhat.com>; Eduardo > Habkost <ehabk...@redhat.com>; qemu-devel@nongnu.org; Alistair Francis > <alistair.fran...@wdc.com>; Paolo Bonzini <pbonz...@redhat.com>; Ying > Fang <fangyi...@huawei.com>; 'Marc-André Lureau' > <marcandre.lur...@redhat.com>; 'Philippe Mathieu-Daudé' > <phi...@redhat.com> > Subject: Re: [PATCH v2 3/3] usb/hcd-xhci: Split pci wrapper for xhci base > model > > Hi, > > > > >> Do you intend to add a "sysbus model" in a future patch? > > > > [Sai Pavan Boddu] Yes. I would be sending it along with that a > > > > device which would be using it. (i.e for zynqmp soc ) Let me know, > > > > if its good to > > > include hcd-xhci-sysbus.c here ? > > I think this would be useful, to see how the code separation plays out on the > sysbus side. > > > > Here's a clean way to provide different bus connectors (say PCI and > > > sysbus) for the same core device: > > > > > > Make the core device a TYPE_DEVICE. > > > > > > For each desired bus, have a bus-specific device that contains a core > device. > > > Use object_initialize_child() for the component. > > > This was my V1 implementation. > > Changed it to non-qom structure after some feedback from @Gred. Felt > like XHCIState will not be used standalone. > > > > Example: core device TYPE_SERIAL, PCI device TYPE_PCI_SERIAL, ISA > > > device TYPE_ISA_SERIAL, sysbus devices TYPE_SERIAL_IO. > TYPE_SERIAL_MM. > > /me goes check out the serial code ... > > For reference: commit which transforms serial into the structure above is > this: > > commit 7781b88ee458ff933459503ade0b0a6ddaad08de > Author: Marc-André Lureau <marcandre.lur...@redhat.com> > Date: Mon Oct 21 23:32:12 2019 +0200 > > serial: initial qom-ification > > Note that this patch doesn't change structs, so ISASerialState still looks > this > way: > > struct ISASerialState { > ISADevice parent_obj; > [ ... ] > SerialState state; > }; > > So you can likewise keep your current "struct XHCIPciState" struct layout and > still turn XHCIState into a device object. Which is nice to have as it better > models the hardware (xhci core behind pci connector). [Sai Pavan Boddu] Ok, as marcus pointed. We might be able to use it just as, child of a pci/sysbus based controller. Rather than using it standalone. I agree it looks nice that way.
Thanks, Sai Pavan > > take care, > Gerd