linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Stefan Lehner <stefan-lehner@aon.at>
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: SA-1111 USB OHCI driver (Jornada 720) - overcurrent condition
Date: Tue, 11 Feb 2020 16:24:39 +0000	[thread overview]
Message-ID: <20200211162439.GJ25745@shell.armlinux.org.uk> (raw)
In-Reply-To: <002e01d5ddb1$f5c95520$e15bff60$@at>

On Fri, Feb 07, 2020 at 01:27:27PM +0100, Stefan Lehner wrote:
> Hello!
> I am trying to get USB Host working on my HP Jornada 720. I did some
> hardware modifications to access the USB lines on the SA-1111. The hardware
> part should be ok, wiring is done as described in the SA-1111 development
> module schematics. 
> Tested on Kernel 3.16.81 (Debian 5) and Kernel 4.8.7 with BX emulation
> (Debian 9).
> The driver loads fine and turns on the USB port a short time during boot.
> But after that i always get  "hub 1-0:1.0: over-current condition" in dmesg.
> And it turns USB_PWRCNTL high. So the USB power gets cut off.
> I tested it on my modified mainboard and on two unmodified boards which have
> per default USB_PWR_SENSE tied to 3,3V high. So from hardware side there is
> no current drawn and no overcurrent signal sent to the SA-1111 .
> 
> Anyone has a glue whats wrong here?

Well, it seems this has never been tested properly.  The SA1111 docs
say:

• USB_PWR_SENSE - This is a dedicated active high input which is
normally used for sensing port over current fault conditions on
the USB power supply. ...

So, if it is tied high, then by default it is indicating an over-
current condition.  There is, however, a bit that can be used to
invert this signal, bit 6 of reset register.  The code does this:

        unsigned int usb_rst = 0;
...
        if (machine_is_xp860() ||
            machine_is_assabet() ||
            machine_is_pfs168() ||
            machine_is_badge4())
                usb_rst = USB_RESET_PWRSENSELOW | USB_RESET_PWRCTRLLOW;

        /*
         * Configure the power sense and control lines.  Place the USB
         * host controller in reset.
         */
        writel_relaxed(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET,
                      dev->mapbase + USB_RESET);

So, bit 6 is left unset on Jornada 720, and hence this issue.

You probably also need to investigate whether the USB_PWRCNTL signal
is also active high or active low, and consider whether the setting
for that signal is also correct.  If USB_RESET_PWRCTRLLOW is set,
then USB_PWRCTRL=low is supposed to turn _on_ the power.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-02-11 16:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 12:27 SA-1111 USB OHCI driver (Jornada 720) - overcurrent condition Stefan Lehner
2020-02-11 16:24 ` Russell King - ARM Linux admin [this message]
2020-02-17  9:19   ` AW: " Stefan Lehner
2020-02-27 16:15     ` Stefan Lehner

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=20200211162439.GJ25745@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=stefan-lehner@aon.at \
    /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).