linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: jamesg@zaltys.org, linux-usb@vger.kernel.org
Subject: Re: lpc32xx and stotg04
Date: Thu, 30 Jul 2020 14:51:50 -0400	[thread overview]
Message-ID: <20200730185150.GA1419@linux-uys3> (raw)
In-Reply-To: <20200729172829.GA3679@piout.net>

Hi Alexandre,

I so greatly appreciate your thoughts on this!

On Wed 2020-07-29 @ 07:28:29 PM, Alexandre Belloni wrote:
> Hi,
> 
> On 23/07/2020 17:27:43-0400, Trevor Woerner wrote:
> > I too am working with a board that uses the lpc32xx SoC (the lpc3240, to be
> > specific) and has a stotg04 for the USB transceiver instead of the isp1301.
> > 
> > I can't get the USB to work.
> > 
> > My guess is that I don't have the device tree correct.
> > 
> > I could embarrass myself by showing you what combinations I've tried but I
> > thought maybe I'd ask and see if either of you could provide a DT snippet
> > describing how to hook up the stotg04 to the i2cusb. Admittedly I'm quite
> > fuzzy when it comes to device trees.
> > 
> 
> This is what I had that is relevant:
> 
> &i2cusb {
> 	clock-frequency = <100000>;
> 
> 	isp1301: usb-transceiver@2d {
> 		compatible = "nxp,isp1301";
> 		reg = <0x2d>;
> 	};
> };
> 
> /* Here, choose exactly one from: ohci, usbd */
> &usbd {
> // &ohci {
> 	transceiver = <&isp1301>;
> 	status = "okay";
> };

It looks like my DTS is correct after all.

> > I'm also a bit fuzzy on USB. I want to plug usb sticks into my device (which,
> > by my understanding, is the opposite of OTG). So additionally I want to enable
> > ohci and not usbd?
> > 
> 
> Indeed, you want ohci (as you can see this is commented out in my device
> tree)
> 
> > In one DT incantation (the one showing the most promise so far) on startup
> > 'lsusb' shows two usb devices. The moment I plug a USB drive into my device I
> > get:
> > 
> > 	[  433.268009] usb-ohci 31020000.ohci: controller won't resume
> > 	[  433.273603] usb-ohci 31020000.ohci: HC died; cleaning up
> > 	[  433.280566] usb 1-1: USB disconnect, device number 2
> > 
> > And afterwards only one device is listed by 'lsusb'.
> > 
> > Currently I'm using a 5.0 kernel and a 5.4 kernel, but I could use any kernel
> > (upstream, ideally). In either case, it doesn't seem possible to deselect the
> > isp1301 from the kernel config? It gets selected automatically. If I'm using
> > the stotg04 instead of the isp1301, do I need a way to turn off the isp1301?
> > 
> 
> The platform I was working on is on v5.1 and has an stotg04. Honnestly,
> the whole thing is a mess and you have to use the isp1301 driver. Then
> the difference between isp1301 and stotg04 is handled in lpc32xx_udc.c.
> 
> So I would say you are missing something similar to what I did in
> 2a60f5eafa74 ("usb: gadget: udc: lpc32xx: add support for stotg04 phy")
> but in drivers/usb/host/ohci-nxp.c:isp1301_configure_lpc32xx()
> 
> I guess your issue is MC2_SPD_SUSP_CTRL line 75 ;) You can try to
> remove it.

Thank you very much for your insights and clarifications! Your patch will be
very useful to me.

Best regards,
	Trevor

      parent reply	other threads:[~2020-07-30 18:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 21:27 lpc32xx and stotg04 Trevor Woerner
2020-07-29 17:28 ` Alexandre Belloni
2020-07-29 17:49   ` [PATCH] usb: ohci-nxp: add support for stotg04 phy Alexandre Belloni
2020-07-29 18:00     ` Sergei Shtylyov
2020-07-30  6:43       ` Greg KH
2020-07-30 11:35         ` Alexandre Belloni
2020-07-30 18:51   ` Trevor Woerner [this message]

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=20200730185150.GA1419@linux-uys3 \
    --to=twoerner@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=jamesg@zaltys.org \
    --cc=linux-usb@vger.kernel.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).