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). take care, Gerd