Hi Peter, > -----Original Message----- > From: Peter Maydell <peter.mayd...@linaro.org> > Sent: Wednesday, October 28, 2020 6:44 PM > To: Sai Pavan Boddu <saip...@xilinx.com> > Cc: Markus Armbruster <arm...@redhat.com>; Marc-André Lureau > <marcandre.lur...@redhat.com>; Paolo Bonzini <pbonz...@redhat.com>; > Gerd Hoffmann <kra...@redhat.com>; Edgar Iglesias <edg...@xilinx.com>; > Francisco Eduardo Iglesias <figle...@xilinx.com>; QEMU Developers <qemu- > de...@nongnu.org>; Alistair Francis <alistair.fran...@wdc.com>; Eduardo > Habkost <ehabk...@redhat.com>; Ying Fang <fangyi...@huawei.com>; > Philippe Mathieu-Daudé <phi...@redhat.com>; Vikram Garhwal > <f...@xilinx.com>; Paul Zimmerman <pauld...@gmail.com> > Subject: Re: [PATCH v12 1/3] misc: Add versal-usb2-ctrl-regs module > > On Wed, 28 Oct 2020 at 12:58, Sai Pavan Boddu <saip...@xilinx.com> wrote: > > > > Hi Peter, > > > > > -----Original Message----- > > > From: Sai Pavan Boddu > > > Sent: Monday, October 26, 2020 10:59 PM > > > To: Peter Maydell <peter.mayd...@linaro.org> > > > Cc: Markus Armbruster <arm...@redhat.com>; Marc-André Lureau > > > <marcandre.lur...@redhat.com>; Paolo Bonzini <pbonz...@redhat.com>; > > > Gerd Hoffmann <kra...@redhat.com>; Edgar Iglesias > > > <edg...@xilinx.com>; Francisco Eduardo Iglesias > > > <figle...@xilinx.com>; QEMU Developers <qemu- de...@nongnu.org>; > > > Alistair Francis <alistair.fran...@wdc.com>; Eduardo Habkost > > > <ehabk...@redhat.com>; Ying Fang <fangyi...@huawei.com>; Philippe > > > Mathieu-Daudé <phi...@redhat.com>; Vikram Garhwal > <f...@xilinx.com>; > > > Paul Zimmerman <pauld...@gmail.com> > > > Subject: RE: [PATCH v12 1/3] misc: Add versal-usb2-ctrl-regs module > > > > > > Hi Peter, > > > > > > > -----Original Message----- > > > > From: Peter Maydell <peter.mayd...@linaro.org> > > > > Sent: Monday, October 26, 2020 9:33 PM > > > > To: Sai Pavan Boddu <saip...@xilinx.com> > > > > Cc: Markus Armbruster <arm...@redhat.com>; Marc-André Lureau > > > > <marcandre.lur...@redhat.com>; Paolo Bonzini > > > > <pbonz...@redhat.com>; Gerd Hoffmann <kra...@redhat.com>; Edgar > > > > Iglesias <edg...@xilinx.com>; Francisco Eduardo Iglesias > > > > <figle...@xilinx.com>; QEMU Developers > > > > <qemu- de...@nongnu.org>; Alistair Francis > > > > <alistair.fran...@wdc.com>; Eduardo Habkost <ehabk...@redhat.com>; > > > > Ying Fang <fangyi...@huawei.com>; Philippe Mathieu-Daudé > > > > <phi...@redhat.com>; Vikram Garhwal <f...@xilinx.com>; Paul > > > > Zimmerman > > > <pauld...@gmail.com>; > > > > Sai Pavan Boddu <saip...@xilinx.com> > > > > Subject: Re: [PATCH v12 1/3] misc: Add versal-usb2-ctrl-regs > > > > module > > > > > > > > On Thu, 22 Oct 2020 at 13:11, Sai Pavan Boddu > > > > <sai.pavan.bo...@xilinx.com> > > > > wrote: > > > > > > > > > > This module emulates control registers of versal usb2 > > > > > controller, this is added just to make guest happy. In general > > > > > this module would control the phy-reset signal from usb > > > > > controller, data coherency of the transactions, signals the host > > > > > system > errors received from controller. > > > > > > > > > > Signed-off-by: Sai Pavan Boddu <sai.pavan.bo...@xilinx.com> > > > > > Signed-off-by: Vikram Garhwal <fnu.vik...@xilinx.com> > > > > > --- > > > > > hw/misc/meson.build | 1 + > > > > > hw/misc/xlnx-versal-usb2-ctrl-regs.c | 229 > > > > +++++++++++++++++++++++++++ > > > > > include/hw/misc/xlnx-versal-usb2-ctrl-regs.h | 45 ++++++ > > > > > > > > This seems a bit odd. If it's a USB device (or part of a USB > > > > device) then it should be under hw/usb, shouldn't it? > > > [Sai Pavan Boddu] This is a top level wrapper over hcd-dwc3 device, > > > which is specific to versal soc. It's mostly dummy which controls > > > the phy-reset and does frame length adjustments. It was added just > > > to make guest happy, that is the reason it has been added to misc devices. > > > > > > > > > +static void ir_status_postw(RegisterInfo *reg, uint64_t val64) { > > > > > + VersalUsb2CtrlRegs *s = XILINX_VERSAL_USB2_CTRL_REGS(reg- > > > >opaque); > > > > > + /* > > > > > + * TODO: This should also clear USBSTS.HSE field in USB XHCI > register. > > > > > + * May be combine both the modules. > > > > > + */ > > > > > > > > What does the hardware for this look like? You've modelled it as > > > > two completely separate devices (this one and the > > > > TYPE_USB_DWC3) but would it be closer to the hardware structure to > > > > have a top-level device which has-a DWC3 ? > > > [Sai Pavan Boddu] Yes, we can look at it such way. But as its > > > specific to versal SOC, we have crafted it out and stitched them in SOC > > > file. > > > > > > Regards, > > > Sai Pavan > > [Sai Pavan Boddu] I would be sending V13 without doing any changes with > this patch and addressing other comments, Please review over V13. > > You have my review comments above. I think the way you've structured this > isn't really the best way to do it. [Sai Pavan Boddu] Ok, I would move this into USB folder as its related. But this device is not like a top level module of DWC3 model, is used for handling phy-reset signal & power management of usb port. It's not a good idea to embedded this device into DWC3 module.
Anyway, I would attempt to create a subsystem by making dwc3 and usb2-ctrl-regs child of one device. Regards, Sai Pavan > > thanks > -- PMM