qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH v2 3/3] usb/hcd-xhci: Split pci wrapper for xhci base model


From: Sai Pavan Boddu
Subject: RE: [PATCH v2 3/3] usb/hcd-xhci: Split pci wrapper for xhci base model
Date: Tue, 30 Jun 2020 17:55:07 +0000

Hi Gred,

> -----Original Message-----
> From: Gerd Hoffmann <kraxel@redhat.com>
> Sent: Tuesday, June 30, 2020 1:09 AM
> To: Sai Pavan Boddu <saipava@xilinx.com>
> Cc: Markus Armbruster <armbru@redhat.com>; Peter Maydell
> <peter.maydell@linaro.org>; Thomas Huth <thuth@redhat.com>; Eduardo
> Habkost <ehabkost@redhat.com>; qemu-devel@nongnu.org; Alistair Francis
> <alistair.francis@wdc.com>; Paolo Bonzini <pbonzini@redhat.com>; Ying
> Fang <fangying1@huawei.com>; 'Marc-André Lureau'
> <marcandre.lureau@redhat.com>; 'Philippe Mathieu-Daudé'
> <philmd@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.lureau@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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]