SA-1111 USB OHCI driver (Jornada 720) - overcurrent condition
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?
dmesg output from a unmodified unit (Kernel 3.16.81):
--------linexec--------
LinExec: UART Initialized.
LinExec: UART Initialized.
LinExec: UART Initialized.
LinExec: Beginning boot_linux.
LinExec: Passing the point of no return.. Now.
LinExec: Entering DRAMloader...
Booting Linux on physical CPU 0x0
Linux version 3.16.81 (stefan@spnub1804work) (gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) ) #3 Fri Feb 7 11:15:16 UTC 2020
CPU: StrongARM-1110 [6901b118] revision 8 (ARMv4), cr=c020717f
CPU: VIVT data cache, VIVT instruction cache
Machine: HP Jornada 720
Memory policy: Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128 Kernel command line: root=/dev/hda2 mem=32m rootdelay=2 console=ttySA0,115200n8
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 28640K/32768K available (2735K kernel code, 121K rwdata, 736K rodata, 93K init, 77K bss, 4128K reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xffe00000 (2048 kB)
vmalloc : 0xc2800000 - 0xff000000 ( 968 MB)
lowmem : 0xc0000000 - 0xc2000000 ( 32 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0208000 - 0xc056be64 (3472 kB)
.init : 0xc056c000 - 0xc0583484 ( 94 kB)
.data : 0xc0584000 - 0xc05a2520 ( 122 kB)
.bss : 0xc05a2520 - 0xc05b5cd4 ( 78 kB)SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS:16 nr_irqs:49 49sched_clock: 32 bits at 3686kHz, resolution 271ns, wraps every 1165084444400ns
Console: colour dummy device 30x40
console [ttySA0] enabled
Calibrating delay loop... 136.60 BogoMIPS (lpj=683008)pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0xc04b1db8 - 0xc04b1e10
futex hash table entries: 256 (order: -1, 3072 bytes)
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations SA1111 Microprocessor Companion Chip: silicon revision 1, metal revision 1 sa1111 sa1111.0: Providing IRQ49-103
sa1111-rab 0400: dmabounce: registered device
sa1111-rab 0600: dmabounce: registered device
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switched to clocksource oscr
genirq: Setting trigger mode 3 for irq 100 failed (sa1111_type_highirq+0x0/0x80)
genirq: Setting trigger mode 3 for irq 102 failed (sa1111_type_highirq+0x0/0x80) jornada720_pcmcia_configure_socket(): config socket 0 vcc 0 vpp 0
genirq: Setting trigger mode 3 for irq 101 failed (sa1111_type_highirq+0x0/0x80)
genirq: Setting trigger mode 3 for irq 103 failed (sa1111_type_highirq+0x0/0x80) jornada720_pcmcia_configure_socket(): config socket 1 vcc 0 vpp 0
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
SSP: device initialized with irq
msgmni has been set to 55
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Epson S1D13XXX FB Driver
s1d13xxxfb: chip production id 4 = S1D13506
s1d13xxxfb: chip revision 1
s1d13xxxfb: regs mapped at 0xf0000000, fb 512 KiB mapped at 0xf1000000
Console: switching to colour frame buffer device 80x30
fb0: S1D13xxx frame buffer device
Serial: SA11x0 driver
sa11x0-uart.1: ttySA1 at MMIO 0x80010000 (irq = 15, base_baud = 230400) is a SA1100
sa11x0-uart.3: ttySA0 at MMIO 0x80050000 (irq = 17, base_baud = 230400) is a SA1100
loop: module loaded
nbd: registered device at major 43
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver sa1111-ohci 0400: SA-1111 OHCI
sa1111-ohci 0400: new USB bus registered, assigned bus number 1 sa1111-ohci 0400: irq 93, io mem 0x40000400 jornada720_pcmcia_configure_socket(): config socket 1 vcc 33 vpp 33 hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
mousedev: PS/2 mouse device common for all mice
input: HP Jornada 720 keyboard as /devices/platform/jornada720_kbd/input/input0
input: HP Jornada 7xx Touchscreen as /devices/platform/jornada_ts/input/input1
rtc (null): invalid alarm value: 1900-1-1 0:0:0
sa1100-rtc sa1100-rtc: rtc core: registered sa1100-rtc as rtc0
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
sa1100-rtc sa1100-rtc: setting system clock to 1970-01-01 00:01:33 UTC (93) Waiting 2 sec before mounting root device... jornada720_pcmcia_configure_socket(): config socket 1 vcc 33 vpp 33 jornada720_pcmcia_configure_socket(): config socket 1 vcc 33 vpp 33 pcmcia_socket pcmcia_socket1: pccard: PCMCIA card inserted into slot 1 pcmcia 1.0: pcmcia: registering new device pcmcia1.0 (IRQ: 99) jornada720_pcmcia_configure_socket(): config socket 1 vcc 33 vpp 0 jornada720_pcmcia_configure_socket(): config socket 1 vcc 33 vpp 0 hub 1-0:1.0: over-current condition
hda: TS8GCF133, CFA DISK drive
hdb: probing with STATUS(0x00) instead of ALTSTATUS(0x50)
hdb: probing with STATUS(0x00) instead of ALTSTATUS(0x50)
ide0 at 0xc2880000-0xc2880007,0xc288000e on irq 99
bounce: isa pool size: 16 pages
hda: max request size: 512KiB
hda: 15662304 sectors (8019 MB) w/1KiB Cache, CHS=15538/255/63
hda: hda1 hda2 hda3
ide-cs 1.0: ide-cs: hda: Vpp = 0.0
VFS: Mounted root (ext2 filesystem) on device 3:2.
Freeing unused kernel memory: 92K (c056c000 - c0583000)
modprobe: FATAL: Could not load /lib/modules/3.16.81/modules.dep: No such file or directory
INIT: version 2.86 booting...
...
Regards and Thanks
Stefan Lehner
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 14 lines · Stefan Lehner
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 turnsUSB_PWRCNTLhigh. So the USB power gets cut off.
I tested it on my modified mainboard and on two unmodified boards which have per defaultUSB_PWR_SENSEtied to 3,3V high. So from hardware side there is no current drawn and no overcurrent signal sent to the SA-1111 .
Quoted 1 line
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.
Signature · 8 lines
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 protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 26 lines
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);
Quoted 6 lines
So, bit 6 is left unset on Jornada 720, and hence this issue.
You probably also need to investigate whether the
USB_PWRCNTLsignal is also active high or active low, and consider whether the setting for that signal is also correct. IfUSB_RESET_PWRCTRLLOWis 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 protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
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 protected]] Im Auftrag von Stefan Lehner
Gesendet: Montag, 17. Februar 2020 10:20
An: 'Russell King - ARM Linux admin'
Cc: [email protected]
Betreff: AW: SA-1111 USB OHCI driver (Jornada 720) - overcurrent condition
Quoted 26 lines
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);
Quoted 6 lines
So, bit 6 is left unset on Jornada 720, and hence this issue.
You probably also need to investigate whether the
USB_PWRCNTLsignal is also active high or active low, and consider whether the setting for that signal is also correct. IfUSB_RESET_PWRCTRLLOWis 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 protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel