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

From: "Stefan Lehner" <[email-masked]>
Date: Thu, 27 Feb 2020 17:15:31 +0100

Hi!
I made a PCB according to the "StrongARM® SA-1111 Development Module Schematics" and wired everything up. So Hardware is 100% ok. 
Someone ever managed to get USB host working on a SA-1111?
In this case i tried with Kernel Version 4.8.7. But it also doesnt work with 3.16.82 or 4.9 ...
The funny thing is, sometimes it works for a short period of time. But most of the time I get this strange -110 timeout error...

Hopefully someone can help me.

Regards
Stefan Lehner

-----Ursprüngliche Nachricht-----
Von: linux-arm-kernel [mailto:[email-masked]] Im Auftrag von Stefan Lehner
Gesendet: Montag, 17. Februar 2020 10:20
An: 'Russell King - ARM Linux admin'
Cc: [email-masked]
Betreff: AW: SA-1111 USB OHCI driver (Jornada 720) - overcurrent condition

>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.

Thank you for your reply! 
You are absolutely right. With my wiring, according to the "StrongARM® SA-1111 Development Module Schematics" the power sense and control line has to be configured as active low. Sadly it does not work as expected...
The machine powers up the USB port and sometimes recognizes a USB device. But it is not mountable/accessible:

[  258.644698] usb 1-1: new full-speed USB device number 2 using sa1111-ohci
[  264.104687] usb 1-1: device descriptor read/64, error -110
[  269.774809] usb 1-1: unable to read config index 0 descriptor/start: -110
[  269.819320] usb 1-1: can't read configurations, error -110
[  270.054718] usb 1-1: new full-speed USB device number 3 using sa1111-ohci
[  280.728528] usb 1-1: New USB device found, idVendor=090c, idProduct=1000
[  280.772179] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  280.815679] usb 1-1: Product: USB DISK
[  280.857967] usb 1-1: Manufacturer: SMI Corporation
[  280.900261] usb 1-1: SerialNumber: AA04012700007537
[  281.310530] usb-storage 1-1:1.0: USB Mass Storage device detected
[  281.390081] scsi host0: usb-storage 1-1:1.0
[  281.434343] usbcore: registered new interface driver usb-storage
[  283.065640] scsi 0:0:0:0: Direct-Access     USB      Flash Disk       1100 PQ: 0 ANSI: 0 CCS
[  300.646937] sd 0:0:0:0: [sda] 15858688 512-byte logical blocks: (8.12 GB/7.56 GiB)
[  300.800529] sd 0:0:0:0: [sda] Write Protect is off
[  300.845434] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[  301.095147] sd 0:0:0:0: [sda] No Caching mode page found
[  301.095183] sd 0:0:0:0: [sda] Assuming drive cache: write through

Sometimes there are only errors like these:
[  175.554707] usb 1-1: new full-speed USB device number 2 using sa1111-ohci
[  180.884999] usb 1-1: device descriptor read/all, error -110
[  181.124717] usb 1-1: new full-speed USB device number 3 using sa1111-ohci
[  192.144682] usb 1-1: device not accepting address 3, error -110
[  192.384697] usb 1-1: new full-speed USB device number 4 using sa1111-ohci
[  197.525621] usb 1-1: unable to read config index 0 descriptor/all
[  197.569172] usb 1-1: can't read configurations, error -110
[  197.804709] usb 1-1: new full-speed USB device number 5 using sa1111-ohci
[  208.544679] usb 1-1: device not accepting address 5, error -110
[  208.586685] usb usb1-port1: unable to enumerate USB device

Tested with different (working) flash drives.
I dont know if this is a Kernel/driver problem or hardware related. I tested the 5V line to the usb port and there is no voltage drop or excessive current drawn.

lsusb output:
Bus 001 Device 003: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Flash Drive
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Regards
Stefan

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel