qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH v2 2/3] hw/arm/fsl-imx6ul: Wire up USB controllers


From: Guenter Roeck
Subject: Re: [PATCH v2 2/3] hw/arm/fsl-imx6ul: Wire up USB controllers
Date: Thu, 12 Mar 2020 10:20:40 -0700
User-agent: Mutt/1.9.4 (2018-02-28)

On Thu, Mar 12, 2020 at 05:05:25PM +0000, Peter Maydell wrote:
> On Thu, 12 Mar 2020 at 16:55, Guenter Roeck <address@hidden> wrote:
> >
> > On Thu, Mar 12, 2020 at 01:19:41PM +0000, Peter Maydell wrote:
> > > On Tue, 10 Mar 2020 at 21:04, Guenter Roeck <address@hidden> wrote:
> > > > diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
> > > > @@ -456,6 +467,28 @@ static void fsl_imx6ul_realize(DeviceState *dev, 
> > > > Error **errp)
> > > >                                              
> > > > FSL_IMX6UL_ENETn_TIMER_IRQ[i]));
> > > >      }
> > > >
> > > > +    /* USB */
> > > > +    for (i = 0; i < FSL_IMX6UL_NUM_USBS; i++) {
> > > > +        static const int FSL_IMX6UL_USBn_IRQ[] = {
> > > > +            FSL_IMX6UL_USB2_IRQ,
> > > > +            FSL_IMX6UL_USB1_IRQ,
> > > > +        };
> > >
> > > Do we really want to wire up USB1 to USB2_IRQ and USB2 to USB1_IRQ ?
> > > If so, a comment explaining that it is deliberate would be useful.
> > >
> > Yes. I think the definitions may be incorrect (or the Linux dts files are
> > incorrect, but that seems unlikely). I tried the other way but then I get
> > unhandled interrupt errors when trying to access a USB flash drive.
> 
> I guess we should check the datasheet and see if we just
> have our #define names the wrong way around...
> 

>From "i.MX 6UltraLite Applications Processor Reference Manual":

74 USB USBO2 USB OTG2
75 USB USBO2 USB OTG1
76 USB_PHY UTMI0 interrupt request
77 USB_PHY UTMI1 interrupt request

So it looks like the dts files in the Linux kernel are correct.

> > > Side note: not used here, but in the header file we define:
> > >     FSL_IMX6UL_USB1_IRQ     = 42,
> > >     FSL_IMX6UL_USB2_IRQ     = 43,
> > >     FSL_IMX6UL_USB_PHY1_IRQ = 44,
> > >     FSL_IMX6UL_USB_PHY2_IRQ = 44,
> > >
> > > Is that last one correct, or a cut-n-paste error that should be "45" ?
> > >
> > From Linux devicetree files:
> >
> >         usbphy1: usbphy@20c9000 {
> >                 compatible = "fsl,imx6ul-usbphy", "fsl,imx23-usbphy";
> >                 reg = <0x020c9000 0x1000>;
> >                 interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
> >         usbphy2: usbphy@20ca000 {
> >                 compatible = "fsl,imx6ul-usbphy", "fsl,imx23-usbphy";
> >                 reg = <0x020ca000 0x1000>;
> >                 interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
> >         usbotg1: usb@2184000 {
> >                 compatible = "fsl,imx6ul-usb", "fsl,imx27-usb";
> >                 reg = <0x02184000 0x200>;
> >                 interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
> >         usbotg2: usb@2184200 {
> >                 compatible = "fsl,imx6ul-usb", "fsl,imx27-usb";
> >                 reg = <0x02184200 0x200>;
> >                 interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
> >
> > Should I maybe fix the definitions in a separate patch ?
> 
> Yes please.
> 
Ok, will do. And, sorry, I should have done that in the first place.

Thanks,
Guenter



reply via email to

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