public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mvebu: usb: Add missing controller reset after initialization
Date: Mon, 4 Jan 2016 12:25:57 +0100	[thread overview]
Message-ID: <201601041225.57256.marex@denx.de> (raw)
In-Reply-To: <20160104030101.9F28661C74@mail.nwl.cc>

On Monday, January 04, 2016 at 04:02:26 AM, Phil Sutter wrote:
> Hi,
> 
> On Mon, Jan 04, 2016 at 12:47:37AM +0100, Marek Vasut wrote:
> > On Monday, January 04, 2016 at 12:38:07 AM, Phil Sutter wrote:
> > > The bit which really was missing is the USB mode setting I smuggled in
> > > along with my patch - setting the devices to host mode is sufficient
> > > for Linux to successfully enumerate the HCD.
> > 
> > OK, so the controller is OTG capable and upon reset, it's in Gadget mode?
> 
> Yes, seems it's capable. Upon reset, register 0x501a0 contains value 0.
> Trying to print register 0x511a0 freezes U-Boot for me.

0x501a0 and 0x511a0 are two different registers. Freeze usually indicates
disabled clock to the IP block or somesuch.

> > > Checking the logs of the vendor's U-Boot fork, it appears that devices
> > > 1 and 2 are configured to host mode, while the third is set to device
> > > mode. I changed my code to copy that, but am not sure it's necessary
> > > at all: The DS414 exports only a single port of the SoC's EHCI, and
> > > Linux
> > > 
> > > detects that:
> > > | orion-ehci f1050000.usb: EHCI Host Controller
> > > | orion-ehci f1050000.usb: new USB bus registered, assigned bus number
> > > | 3 orion-ehci f1050000.usb: irq 27, io mem 0xf1050000
> > > | orion-ehci f1050000.usb: USB 2.0 started, EHCI 1.00
> > > | hub 3-0:1.0: USB hub found
> > > | hub 3-0:1.0: 1 port detected
> > > 
> > > OTOH I'm not sure how far this configuration is device specific in the
> > > first place. What puzzles me is that I couldn't find a reference to
> > > this USB mode register at 0x501A8 in Marvell's MV78230 specs, still it
> > > seems to be crucial. Does anyone of you have this register referenced
> > > in some Marvell datasheet somewhere?
> > 
> > It's the USBMODE register, see for example [1] . It's part of EHCI cores
> > which are OTG capable.
> > 
> > [1] http://lxr.free-electrons.com/source/drivers/usb/host/ehci-hcd.c#L179
> 
> Interesting. I would have expected this to show up in MV78230 specs, but
> maybe I missed the part where it clarifies these offsets to be standard
> conformant.

It seems to be standard comformant, but I didn't see the datasheet.

> > > Maybe there's also a more generic way to do this, 'usb start' (which
> > > solves the problem without any changes to the SoC init code) seems to
> > > not address this register.
> > 
> > Probably add a fixup into ehci-orion.c in Linux or something along those
> > lines. It should configure the code according to the "dr_mode" DT prop.
> 
> Hmm. Searching through the relevant DT files didn't yield a result for
> "dr_mode". Seems like this property is missing, maybe that's why Linux
> fails here?

More likely it's not implemented for the MVEBU yet.

> Is this something generally user-configurable? (Note that I
> don't have the slightest idea of how device mode USB works in Linux).

Yes, you can run the core in either Host/Gadget/OTG mode. For that to work,
you need to configure the core mode.

Best regards,
Marek Vasut

  reply	other threads:[~2016-01-04 11:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-02 21:19 [U-Boot] [PATCH] mvebu: usb: Add missing controller reset after initialization Phil Sutter
2016-01-03  8:59 ` Wolfgang Denk
2016-01-03  9:35   ` Marek Vasut
2016-01-03 23:38   ` Phil Sutter
2016-01-03 23:47     ` Marek Vasut
2016-01-04  3:02       ` Phil Sutter
2016-01-04 11:25         ` Marek Vasut [this message]
2016-03-24  9:13           ` Stefan Roese
2016-03-24  9:47             ` Phil Sutter

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=201601041225.57256.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /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