Subject: Re: SA-1111 USB OHCI driver (Jornada 720) - overcurrent condition

From: Russell King - ARM Linux admin <[email-masked]>
Date: Tue, 11 Feb 2020 16:24:39 +0000

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
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel