From: Guenter Roeck <linux@roeck-us.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
qemu-arm <qemu-arm@nongnu.org>, Gerd Hoffmann <kraxel@redhat.com>,
Jean-Christophe Dubois <jcd@tribudubois.net>
Subject: Re: [PATCH v2 2/3] hw/arm/fsl-imx6ul: Wire up USB controllers
Date: Thu, 12 Mar 2020 10:20:40 -0700 [thread overview]
Message-ID: <20200312172040.GA18358@roeck-us.net> (raw)
In-Reply-To: <CAFEAcA8QKwrVyBz-iGe0+1Kr7efJZC7nwwrTTV0FSUnmcEW=xA@mail.gmail.com>
On Thu, Mar 12, 2020 at 05:05:25PM +0000, Peter Maydell wrote:
> On Thu, 12 Mar 2020 at 16:55, Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > On Thu, Mar 12, 2020 at 01:19:41PM +0000, Peter Maydell wrote:
> > > On Tue, 10 Mar 2020 at 21:04, Guenter Roeck <linux@roeck-us.net> 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
next prev parent reply other threads:[~2020-03-12 17:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-10 21:04 [PATCH v2 0/3] Wire up USB controllers in i.MX6 emulations Guenter Roeck
2020-03-10 21:04 ` [PATCH v2 1/3] hw/usb: Add basic i.MX USB Phy support Guenter Roeck
2020-03-12 13:16 ` Peter Maydell
2020-03-10 21:04 ` [PATCH v2 2/3] hw/arm/fsl-imx6ul: Wire up USB controllers Guenter Roeck
2020-03-12 13:19 ` Peter Maydell
2020-03-12 16:55 ` Guenter Roeck
2020-03-12 17:05 ` Peter Maydell
2020-03-12 17:20 ` Guenter Roeck [this message]
2020-03-10 21:04 ` [PATCH v2 3/3] hw/arm/fsl-imx6: " Guenter Roeck
2020-03-12 13:29 ` Peter Maydell
2020-03-12 16:56 ` Guenter Roeck
2020-03-10 22:10 ` [PATCH v2 0/3] Wire up USB controllers in i.MX6 emulations no-reply
2020-03-10 22:54 ` Guenter Roeck
2020-03-12 12:07 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200312172040.GA18358@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jcd@tribudubois.net \
--cc=kraxel@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).