Re: [PATCH v2 4/6] dwc-hsotg USB host controller emulation

2020-04-20 Thread Paul Zimmerman
Hi Philippe, On Mon, Apr 20, 2020 at 12:16 AM Philippe Mathieu-Daudé wrote: > Hi Paul, > > On 3/29/20 1:17 AM, Paul Zimmerman wrote: > > Add the dwc-hsotg (dwc2) USB host controller emulation code. > > Based on hw/usb/hcd-ehci.c and hw/usb/hcd-ohci.c. > > > > Note that to use this with the dwc-o

Re: [PATCH v2 4/6] dwc-hsotg USB host controller emulation

2020-04-20 Thread Paul Zimmerman
Hi Philippe, As the label says, these are the host FIFOs. The controller has a mode where DMA is not used, and instead the driver reads the data directly from the FIFOs. I have not implemented this feature yet, but as I recall one of the BSDs uses this in their driver, so I plan to implement this

Re: [PATCH v2 4/6] dwc-hsotg USB host controller emulation

2020-04-20 Thread Philippe Mathieu-Daudé
On 3/29/20 1:17 AM, Paul Zimmerman wrote: > Add the dwc-hsotg (dwc2) USB host controller emulation code. > Based on hw/usb/hcd-ehci.c and hw/usb/hcd-ohci.c. > > Note that to use this with the dwc-otg driver in the Raspbian > kernel, you must pass the option "dwc_otg.fiq_fsm_enable=0" on > the kern

Re: [PATCH v2 4/6] dwc-hsotg USB host controller emulation

2020-04-20 Thread Philippe Mathieu-Daudé
Hi Paul, On 3/29/20 1:17 AM, Paul Zimmerman wrote: > Add the dwc-hsotg (dwc2) USB host controller emulation code. > Based on hw/usb/hcd-ehci.c and hw/usb/hcd-ohci.c. > > Note that to use this with the dwc-otg driver in the Raspbian > kernel, you must pass the option "dwc_otg.fiq_fsm_enable=0" on

Re: [PATCH v2 4/6] dwc-hsotg USB host controller emulation

2020-04-18 Thread Paul Zimmerman
Hi Peter, On 4/16/20 8:45 AM, Peter Maydell wrote: On Sun, 29 Mar 2020 at 00:18, Paul Zimmerman wrote: < snip > +/* nifty macros from Arnon's EHCI version */ +#define get_field(data, field) \ +(((data) & field##_MASK) >> field##_SHIFT) + +#define set_field(data, newval, field) do { \ +

Re: [PATCH v2 4/6] dwc-hsotg USB host controller emulation

2020-04-16 Thread Paul Zimmerman
On 4/16/20 9:30 AM, Philippe Mathieu-Daudé wrote: On 4/16/20 5:47 PM, Peter Maydell wrote: On Thu, 16 Apr 2020 at 16:45, Peter Maydell wrote: On Sun, 29 Mar 2020 at 00:18, Paul Zimmerman wrote: +    s->as = &address_space_memory; Ideally this should be a device property. (hw/dma/pl080.c

Re: [PATCH v2 4/6] dwc-hsotg USB host controller emulation

2020-04-16 Thread Philippe Mathieu-Daudé
On 4/16/20 5:47 PM, Peter Maydell wrote: On Thu, 16 Apr 2020 at 16:45, Peter Maydell wrote: On Sun, 29 Mar 2020 at 00:18, Paul Zimmerman wrote: +s->as = &address_space_memory; Ideally this should be a device property. (hw/dma/pl080.c has an example of how to declare a TYPE_MEMORY_REG

Re: [PATCH v2 4/6] dwc-hsotg USB host controller emulation

2020-04-16 Thread Peter Maydell
On Thu, 16 Apr 2020 at 16:45, Peter Maydell wrote: > > On Sun, 29 Mar 2020 at 00:18, Paul Zimmerman wrote: > > +s->as = &address_space_memory; > > Ideally this should be a device property. (hw/dma/pl080.c > has an example of how to declare a TYPE_MEMORY_REGION > property and then create an A

Re: [PATCH v2 4/6] dwc-hsotg USB host controller emulation

2020-04-16 Thread Peter Maydell
On Sun, 29 Mar 2020 at 00:18, Paul Zimmerman wrote: > > Add the dwc-hsotg (dwc2) USB host controller emulation code. > Based on hw/usb/hcd-ehci.c and hw/usb/hcd-ohci.c. > > Note that to use this with the dwc-otg driver in the Raspbian > kernel, you must pass the option "dwc_otg.fiq_fsm_enable=0" o

[PATCH v2 4/6] dwc-hsotg USB host controller emulation

2020-03-28 Thread Paul Zimmerman
Add the dwc-hsotg (dwc2) USB host controller emulation code. Based on hw/usb/hcd-ehci.c and hw/usb/hcd-ohci.c. Note that to use this with the dwc-otg driver in the Raspbian kernel, you must pass the option "dwc_otg.fiq_fsm_enable=0" on the kernel command line. Emulation of slave mode and of descr