The officially official Devuan Forum!

You are not logged in.

#1 2021-03-19 22:51:50

Altoid
Member
Registered: 2017-05-07
Posts: 676  

[SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

Running up to date Devuan Beowulf 3.1.0:

groucho@devuan:~$ uname -a
Linux devuan 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux
groucho@devuan:~$ 

My Sun Ultra 24 box has six onboard USB 2.0 ports and I've added a 4 port USB 3.0 card to the empty PCIe 8x slot.
Card shows up in lspci:

groucho@devuan:~$ lspci
--- snip ---
04:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)
--- snip ---
groucho@devuan:~$ 

dmesg finds it at USB5:

groucho@devuan:~$ sudo dmesg | grep -i "usb usb"
--- snip ---
[    3.187425] usb usb5: We don't know the algorithms for LPM for this host, disabling LPM.        <------------ | ? |
[    3.187444] usb usb5: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19
[    3.187446] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.187447] usb usb5: Product: xHCI Host Controller
[    3.187448] usb usb5: Manufacturer: Linux 4.19.0-14-amd64 xhci-hcd
[    3.187449] usb usb5: SerialNumber: 0000:04:00.0
--- snip ---
groucho@devuan:~$ 

If I plug in an external USB3.0 HDD in any of the onboard USB2.0 ports , I get this in dmesg:

groucho@devuan:~$ sudo dmesg | tail -20
--- snip ---
[ 2090.462935] usb 6-5: new high-speed USB device number 4 using ehci-pci
[ 2090.624537] usb 6-5: New USB device found, idVendor=043e, idProduct=70f5, bcdDevice= 6.00
[ 2090.624541] usb 6-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2090.624544] usb 6-5: Product: LG External HDD
[ 2090.624547] usb 6-5: Manufacturer: LG Electronics Inc.
[ 2090.624549] usb 6-5: SerialNumber: A1204000000004C7
[ 2090.646562] usb-storage 6-5:1.0: USB Mass Storage device detected
[ 2090.646692] scsi host8: usb-storage 6-5:1.0
[ 2090.646818] usbcore: registered new interface driver usb-storage
[ 2095.346949] scsi 8:0:0:0: Direct-Access     Hitachi  HTS545050A7E     GG2O PQ: 0 ANSI: 2
[ 2095.347330] sd 8:0:0:0: Attached scsi generic sg6 type 0
[ 2095.351172] sd 8:0:0:0: [sdf] 976773164 512-byte logical blocks: (500 GB/466 GiB)
[ 2095.351792] sd 8:0:0:0: [sdf] Write Protect is off
[ 2095.351795] sd 8:0:0:0: [sdf] Mode Sense: 00 06 00 00
[ 2095.352416] sd 8:0:0:0: [sdf] No Caching mode page found
[ 2095.352419] sd 8:0:0:0: [sdf] Assuming drive cache: write through
[ 2095.384932]  sdf: sdf1
[ 2096.469187] sd 8:0:0:0: [sdf] Attached SCSI disk
groucho@devuan:~$ 

lsusb sees it:

groucho@devuan:~$ lsusb
Bus 006 Device 005: ID 043e:70f5 LG Electronics USA, Inc. External HDD
--- snip ---
groucho@devuan:~$ 

But ...

If I unplug it and plug into one of the USB3.0 card's ports, I don't get anything in dmesg ...

[ 2592.690873]  sdf: sdf1
[ 2593.767241] sd 8:0:0:0: [sdf] Attached SCSI disk
[ 3085.450843] usb 6-5: USB disconnect, device number 5

...  or lsusb.

Curiously enough, if I plug it into my Dell monitor's USB2.0 hub (plugged into one of the USB3.0 card's ports), dmesg sees it ...   

groucho@devuan:~$ sudo dmesg | tail -20
[ 2592.690873]  sdf: sdf1
[ 2593.767241] sd 8:0:0:0: [sdf] Attached SCSI disk
[ 3085.450843] usb 6-5: USB disconnect, device number 5

[ 3439.586951] usb 4-3.1: new high-speed USB device number 3 using xhci_hcd
[ 3439.694613] usb 4-3.1: New USB device found, idVendor=043e, idProduct=70f5, bcdDevice= 6.00
[ 3439.694617] usb 4-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3439.694620] usb 4-3.1: Product: LG External HDD
[ 3439.694622] usb 4-3.1: Manufacturer: LG Electronics Inc.
[ 3439.694625] usb 4-3.1: SerialNumber: A1204000000004C7
[ 3439.701034] usb-storage 4-3.1:1.0: USB Mass Storage device detected
[ 3439.701160] scsi host8: usb-storage 4-3.1:1.0
[ 3443.643398] scsi 8:0:0:0: Direct-Access     Hitachi  HTS545050A7E     GG2O PQ: 0 ANSI: 2
[ 3443.643741] sd 8:0:0:0: Attached scsi generic sg6 type 0
[ 3443.647507] sd 8:0:0:0: [sdf] 976773164 512-byte logical blocks: (500 GB/466 GiB)
[ 3443.648127] sd 8:0:0:0: [sdf] Write Protect is off
[ 3443.648132] sd 8:0:0:0: [sdf] Mode Sense: 00 06 00 00
[ 3443.648754] sd 8:0:0:0: [sdf] No Caching mode page found
[ 3443.648757] sd 8:0:0:0: [sdf] Assuming drive cache: write through
[ 3443.681214]  sdf: sdf1
[ 3444.749112] sd 8:0:0:0: [sdf] Attached SCSI disk
groucho@devuan:~$ 

... so does lsusb:

groucho@devuan:~$ lsusb
--- snip ---
Bus 004 Device 003: ID 043e:70f5 LG Electronics USA, Inc. External HDD
--- snip ---
groucho@devuan:~$ 

But as USBView says, it is working at USB2.0 speeds:

LG External HDD
Manufacturer: LG Electronics Inc.
Serial Number: A1204000000004C7
Speed: 480Mb/s (high)           <----
Bus:   4
Address:   3
USB Version:  2.10
Device Class: 00(>ifc )
Device Subclass: 00
Device Protocol: 00
Maximum Default Endpoint Size: 64
Number of Configurations: 1
Vendor Id: 043e
Product Id: 70f5
Revision Number:  6.00

The USB3.0 HDD drive works, the on board USB2.0 ports work, the USB3.0 card's ports work albeit through a hub and at USB2.0 speeds.
Thinking that there being a USB2.0 hub plugged into one of the card's ports, I unplugged it to check.
But nothing changed.

It would seem there is some sort of problem with the USB3.0 card working at USB3.0 speeds with USB3.0 devices.
Maybe it has to do with this line in dmsg?

[    3.187425] usb usb5: We don't know the algorithms for LPM for this host, disabling LPM.

Any ideas?

Thanks in advance,

A.

Last edited by Altoid (2021-03-19 22:56:03)

Offline

#2 2021-03-19 23:06:25

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,541  
Website

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

https://www.gentoofan.org/blog/index.ph … llers.html?

tl;dr: add iommu=soft as a kernel command line parameter.


Black Lives Matter

Online

#3 2021-03-19 23:32:06

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

Head_on_a_Stick wrote:

tl;dr: add iommu=soft as a kernel command line parameter.

Read my mind ...
My dmesg does have a reference to IOMMU:

groucho@devuan:~$ sudo dmesg | grep -i iommu
[    1.903203] AMD IOMMUv2 driver by Joerg Roedel <jroedel@suse.de>
[    1.903420] AMD IOMMUv2 functionality not available on this system
groucho@devuan:~$ 

Tried iommu=soft just now, but made no difference in what happens when I plug in the drive into a USB3.0 port.

Thanks for your input.

Cheers,

A.

Offline

#4 2021-03-19 23:35:59

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,541  
Website

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Add amd-iommu=off as well (as per my link).


Black Lives Matter

Online

#5 2021-03-20 01:12:21

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

Head_on_a_Stick wrote:

Add amd-iommu=off as well (as per my link).

Sorry ...
Confused it with another link where only iommu=soft was mentioned.

No change.
Also tried booting with the drive attached and also with pci=nomsi in the kernel command but no luck.

See here:
https://github.com/torvalds/linux/commi … 11094b6f09

github.com @May 15, 2020  wrote:

usb: xhci: Add support for Renesas controller with memory

Some rensas controller like uPD720201 and uPD720202 need firmware to be
loaded. Add these devices in table and invoke renesas firmware loader
functions to check and load the firmware into device memory when
required.

See this post also: https://bbs.archlinux.org/viewtopic.php … 0#p1925250

Thanks for your input.

Cheers,

A.

Offline

#6 2021-03-20 12:34:00

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

Altoid wrote:

Any ideas?

The plot thickens.
I think there may be more to this USB problem than meets the eye.

This morning, the third or fourth time I rebooted my rig while in the course of running some tests, I was greeted by a non-working Logitech USB Optical mouse.
But not entirely as the mouse's LED was on with the pointer is visible on the desktop, albeit frozen.

I rebooted the box right there and then but nothing changed.

I then dropped into a virtual console with and checked dmesg.
It was not listed in dmsg, a is usual.

Back into X and without rebooting, I unplugged it from a rear socket of the onboard USB2.0 hub and plugged it in again in (same socket), to no avail.
I then plugged it into one of the front panel USB2.0 sockets and it came to life, as you can see here:

groucho@devuan:~$ sudo dmesg | tail -8
[   53.916788] fuse init (API version 7.27)
[  111.196029] usb 10-2: new low-speed USB device number 2 using uhci_hcd
[  111.391046] usb 10-2: New USB device found, idVendor=046d, idProduct=c077, bcdDevice=72.00
[  111.391051] usb 10-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  111.391054] usb 10-2: Product: USB Optical Mouse
[  111.391056] usb 10-2: Manufacturer: Logitech
[  111.406441] input: Logitech USB Optical Mouse as /devices/pci0000:00/0000:00:1d.2/usb10/10-2/10-2:1.0/0003:046D:C077.0002/input/input15
[  111.406624] hid-generic 0003:046D:C077.0002: input,hidraw1: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-0000:00:1d.2-2/input0
groucho@devuan:~$ 

As you can see here, the mouse was not there when I first booted:

groucho@devuan:~$ sudo dmesg | grep -i "Logitech USB"
[  111.406441] input: Logitech USB Optical Mouse as /devices/pci0000:00/0000:00:1d.2/usb10/10-2/10-2:1.0/0003:046D:C077.0002/input/input15
[  111.406624] hid-generic 0003:046D:C077.0002: input,hidraw1: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-0000:00:1d.2-2/input0
groucho@devuan:~$ 

A dmesg snip from this morning's first boot (as seen in /var/log/mesages) shows where, early in the boot sequence, it is found and initialised by the system:

Mar 20 06:58:41 [    4.964090] input: Logitech USB Optical Mouse as /devices/pci0000:00/0000:00:1d.1/usb9/9-2/9-2:1.0/0003:046D:C077.0002/input/input5
Mar 20 06:58:41 [    4.985718] hid-generic 0003:046D:C077.0002: input,hidraw1: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-0000:00:1d.1-2/input0

Now this non-working mouse problem had already happened a couple of times before.

I had it plugged into the Dell monitor's hub for less cable clutter at floor level and as I do not use a mouse outside X, it was not a problem if the BIOS did no initilalise it at boot.

I thought that being plugged into the monitor's hub could somehow be causing the problem, so I plugged it back into the rear port and it started working immediately.

Until this morning.

I have now unplugged it from the front panel after and plugged it in the back socket again: it works without issue.
If on reboot it the problem crops up again, I'll edit this post about it.

Edit:
No problem on reboot, was not reproduced.

groucho@devuan:~$ sudo dmesg | grep -i "Logitech USB"
[    4.477408] input: Logitech USB Optical Mouse as /devices/pci0000:00/0000:00:1d.1/usb9/9-1/9-1:1.0/0003:046D:C077.0001/input/input4
[    4.487583] hid-generic 0003:046D:C077.0001: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-0000:00:1d.1-1/input0
groucho@devuan:~$ 

Any ideas?

Thanks in advance,

A.

Last edited by Altoid (2021-03-20 14:00:36)

Offline

#7 2021-03-20 13:57:28

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

Altoid wrote:

Any ideas?

Some additional information.

I booted the box with an ubuntu fwts-live image which uses the 5.4.0 LTS kernel to see what showed up in dmesg:

[    0.000000] Linux version 5.4.0-66-generic (buildd@lgw01-amd64-039) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 (Ubuntu 5.4.0-66.74-generic 5.4.86)
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz root=LABEL=writable ro console=tty1 console=ttyS0 quiet
--- snip ---
[    0.628135] xhci_hcd 0000:04:00.0: xHCI Host Controller
[    0.628138] xhci_hcd 0000:04:00.0: new USB bus registered, assigned bus number 10
[    0.628141] xhci_hcd 0000:04:00.0: Host supports USB 3.0 SuperSpeed
[    0.631214] usb usb10: We don't know the algorithms for LPM for this host, disabling LPM.      <------------ | x |
[    0.631234] usb usb10: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.04
[    0.631236] usb usb10: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.631237] usb usb10: Product: xHCI Host Controller
[    0.631238] usb usb10: Manufacturer: Linux 5.4.0-66-generic xhci-hcd
[    0.631239] usb usb10: SerialNumber: 0000:04:00.0

Then in lspci:

04:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)

As before, nothing happened when I pugged in the external USB3.0 drive in the USB3.0 card socket.

Thanks in advance,

A.

Last edited by Altoid (2021-03-20 13:58:21)

Offline

#8 2021-03-20 20:37:04

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

Altoid wrote:

Any ideas?

More additional information.

Kernel configuration has the card ticked:

groucho@devuan:~$ grep -i renesas /boot/config-4.19.0-14-amd64
CONFIG_NET_VENDOR_RENESAS=y
CONFIG_RENESAS_PHY=m

The card is detected as PCI card ...

groucho@devuan:~$ lspci -nn | grep -i usb    
--- snip ---
04:00.0 USB controller [0c03]: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller [1912:0014] (rev 03)
groucho@devuan:~$ 

... and as a USB3.0 hub:

groucho@devuan:~$ lsusb | grep -i hub    
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 010 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 009 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub <--------- |x|
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
groucho@devuan:~$ 

Does it matter that it is not referenced in the same way the Dell monitor's hub is?
eg:

Bus 002 Device 001: ID 1d6b:0003 Renesas Technology Corp.USB 3.0 Hub

Edit:

groucho@devuan:~$ locate renesas
/usr/src/linux-headers-4.19.0-14-amd64/include/config/renesas
/usr/src/linux-headers-4.19.0-14-amd64/include/config/net/vendor/renesas.h
/usr/src/linux-headers-4.19.0-14-amd64/include/config/renesas/phy.h
/usr/src/linux-headers-4.19.0-14-common/arch/arm/include/debug/renesas-scif.S
/usr/src/linux-headers-4.19.0-14-common/include/dt-bindings/clock/renesas-cpg-mssr.h
/usr/src/linux-headers-4.19.0-14-common/include/linux/clk/renesas.h
/usr/src/linux-headers-4.19.0-14-common/include/linux/soc/renesas
/usr/src/linux-headers-4.19.0-14-common/include/linux/soc/renesas/rcar-rst.h
/usr/src/linux-headers-4.19.0-14-common/include/linux/soc/renesas/rcar-sysc.h
/usr/src/linux-headers-4.19.0-14-common/include/linux/usb/renesas_usbhs.h
/usr/src/linux-headers-4.19.0-14-common/include/media/drv-intf/renesas-ceu.h
groucho@devuan:~$ 

Thanks in advance.

Best,

A.

Last edited by Altoid (2021-03-20 21:39:07)

Offline

#9 2021-03-21 17:26:56

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

I think I found the necessary bits/data for a solution to this but to be honest, have no idea as to how to go about it.
ie: properly and without bricking something.

Here's the link that has what seems to be a solution:
https://github.com/markusj/upd72020x-load

Here's a blog with the hows and whys:
https://mjott.de/blog/881-renesas-usb-3 … -vs-linux/

The uPD720202 chipset requires additional firmware to operate.
It must be either uploaded by the driver during initialization, or can be stored on an external EEPROM.
--- snip ---
For the first case, there exists a patch for the Linux kernel driver for this chipset to support uploading the firmware image at boot time.
But apparently, this patch never made it into the kernel and I have not found the firmware image in the linux-firmware repository.

Here's the link to the firmware file:
https://raw.githubusercontent.com/chunk … 120615.zip

Firmware file Release Note:

****************************************************************************
******* D720201 & D720202 Design Resources Release *******
****************************************************************************
Release Note                                                   June 15.2012

Renesas Electronics D720201 & uPD720202
USB3.0 Host Controller Firmware

Version : 2.0.1.3 :June 15th, 2012
Copyright (C) 2011-2012 Renesas Electronics Corporation All Rights Reserved
***************************************************************************************************

Note : This firmware is for the following devices.
      - uPD720201 ES 2.0 sample whose revision ID (in the PCI Configuration
       Register) is 2h.
      - uPD720201 ES 2.1 sample & CS sample & Mass product whose revision
       ID (in the PCI Configuration Register) is 3h.
      - uPD720202 ES 2.0 sample & CS sample & Mass product whose revision
       ID (in the PCI Configuration Register) is 2h.

This is all I could find.

Anyone care to have alook/comment?

Thanks in advance,

A.

Last edited by Altoid (2021-03-21 17:35:01)

Offline

#10 2021-03-21 19:07:05

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,541  
Website

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

The GitHub repository supplies a systemd[0] unit file to load the firmware at boot but that won't work for Devuan.

You could call the upd72020x-check-and-init script using /etc/rc.local instead. Change this line so that it points to the correct location of the firmware file.

EDIT: and change this line so that it points to the correct location of the upd72020x-load executable.

[0] Not "SystemD"! mad

Last edited by Head_on_a_Stick (2021-03-21 19:11:16)


Black Lives Matter

Online

#11 2021-03-21 22:41:14

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

Head_on_a_Stick wrote:

... supplies a systemd[0] unit file to load the firmware at boot but that won't work for Devuan.

The readme says:

For using SystemD, please adjust the paths/environment variables in the unit file according to your install locations of script, loader and firmware image.
If no environment variables are set, the script presumes that loader and firmware image are co-located with itself in the same directory.

For testing, I have everything in the same directory:

groucho@devuan:~/Downloads/renesas/work$ ls
K2013080.mem
README.md
upd72020x-check-and-init
upd72020x-load
upd72020x-load.c
Makefile
check-and-init
upd72020x-fwload.service
groucho@devuan:~/Downloads/renesas/work$ 
Head_on_a_Stick wrote:

Change ...
... and change

Like this?

For the firmware file ---> UPD72020X_FW=[path-to-file] K2026.mem

For the executable ---> UPD72020X_CMD=[path-to-file]./upd72020x-load

Q: where in the system should these two (firmware and executable) files be saved?

Head_on_a_Stick wrote:

You could call the script using /etc/rc.local instead.

Yes.
If it works.
Then I'll have to run it at every boot.

At least until the patch makes it into the kernel but I don't see that happening too soon.  8^/
This issue with Renesas USB .0 cards comes from way back.

I did a dry run to see if everything was in place:

[root@devuan work]# 
[root@devuan work]# ./upd72020x-load
upd72020x-load: version 0.1
usage: upd72020 -r -b bus -d dev -f fct -s -o outfile : read eeprom to file (size default is 0x10000 or 64KB)
usage: upd72020 -w -b bus -d dev -f fct -i infile : write file to eeprom
usage: upd72020 -u -b bus -d dev -f fct -i infile : upload file to firmware memory
[root@devuan work]# 

Usage is specified at GitHub as being this:

./upd72020x-load -u -b 0x02 -d 0x00 -f 0x0 -i Kxxxxxx.mem

But I still need to find the values for -u, -b and -f.

lspci says:

groucho@devuan:~/Downloads/renesas/work$ lspci
04:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)
groucho@devuan:~/Downloads/renesas/work$ 

So it would be PCI bus 04:00.0 
Yes?

lsusb says:

groucho@devuan:~/Downloads/renesas/work$ lsusb
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
groucho@devuan:~/Downloads/renesas/work$ 

So it would be Device 001 
Yes?

Is the function address 1d6b:0003?

I'm at a loss as to how to put together the line.
I'd appreciate some pointers as to how to do it.

---

Head_on_a_Stick wrote:

[0] Not "SystemD"!

Quite obvious ...
Just who do you take me for?
---

Thanks in advance.

Best,

A.

Last edited by Altoid (2021-03-21 22:44:20)

Offline

#12 2021-03-22 04:37:18

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 542  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

A PCI "adddress" has format "bus : device . function" so I would guess on

-b 0x04 -d 0x00 -f 0x00

The USB codes are vendor and product and those would not be the ones to use here, a neither the bus and device indices for the USB sub system.

Offline

#13 2021-03-22 17:52:31

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,541  
Website

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Altoid wrote:
Head_on_a_Stick wrote:

Change ...
... and change

Like this?

For the firmware file ---> UPD72020X_FW=[path-to-file] K2026.mem

For the executable ---> UPD72020X_CMD=[path-to-file]./upd72020x-load

Q: where in the system should these two (firmware and executable) files be saved?

I would place the script under /usr/local/bin/ and place the firmware under /usr/local/lib/firmware/ then change the script like this:

# set paths to loader and firmware, if not provided by environment
readonly UPD72020X_CMD="${UPD72020X_CMD:-/usr/local/bin/upd72020x-load}"
readonly UPD72020X_FW="${UPD72020X_FW:-/usr/local/lib/firmware/K2026.mem}"

^ That replaces lines 7-13 (inclusive) in the original script. It does the same thing without having to run two if...fi loops.

Altoid wrote:
Head_on_a_Stick wrote:

[0] Not "SystemD"!

Quite obvious ...
Just who do you take me for?

Sorry, that was a comment about the README in the linked GitHub repository. No offence intended.


Black Lives Matter

Online

#14 2021-03-22 17:53:03

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

ralph.ronnquist wrote:

... so I would guess on

-b 0x04 -d 0x00 -f 0x00

Right ...

But I am getting errors and cannot save the original or upload a new/different firmware.

According to the application, usage is like this:

[root@devuan work]# ./upd72020x-load
upd72020x-load: version 0.1

usage: upd72020 -r -b bus -d dev -f fct -s -o outfile : read eeprom to file (size default is 0x10000 or 64KB)
usage: upd72020 -w -b bus -d dev -f fct -i infile : write file to eeprom
usage: upd72020 -u -b bus -d dev -f fct -i infile : upload file to firmware memory
[root@devuan work]# 

Reading:

[root@devuan work]# ./upd72020x-load -r -b 0x04 -d 0x00 -f 0x00 -s -o original.mem
Doing the reading     <---- must be right because it says it is reading.
bus = 4 
dev = 0 
fct = 0 
fname = (null) 
ERROR: wrong vendorid/devid. Expected an UPD720201 or UPD720202 chip and this is not one!
       reported vendorid/devid: 1912:0014 
 ======> FAILED

Writing:

[root@devuan work]#   ./upd72020x-load -u -b 0x04 -d 0x00 -f 0x00 -i K2013080.mem
Doing the upload      <---- must be right because it says it is uploading.
bus = 4 
dev = 0 
fct = 0 
fname = K2013080.mem 
ERROR: wrong vendorid/devid. Expected an UPD720201 or UPD720202 chip and this is not one!
       reported vendorid/devid: 1912:0014 
 ======> FAILED
[root@devuan work]# 

or

[root@devuan work]# ./upd72020x-load -w -b 0x04 -d 0x00 -f 0x00 -i K2013080.mem
Doing the writing
bus = 4 
dev = 0 
fct = 0 
fname = K2013080.mem 
ERROR: wrong vendorid/devid. Expected an UPD720201 or UPD720202 chip and this is not one!
       reported vendorid/devid: 1912:0014 
 ======> FAILED
[root@devuan work]# 

I've posted at GitHub to see if I can get a solution.

Thanks for your input.

A.

Offline

#15 2021-03-22 18:07:43

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

Head_on_a_Stick wrote:

I would place the script under /usr/local/bin/ and place the firmware under /usr/local/lib/firmware/ then change the script like this:

# set paths to loader and firmware, if not provided by environment
readonly UPD72020X_CMD="${UPD72020X_CMD:-/usr/local/bin/upd72020x-load}"
readonly UPD72020X_FW="${UPD72020X_FW:-/usr/local/lib/firmware/K2026.mem}"

^ That replaces lines 7-13 (inclusive) in the original script. It does the same thing without having to run two if...fi loops.

Right, will do.
But it's still not working, some problem with the application and the card's ID and some missing data somewhere.
Hopefully I won't brick the damn thing.

Not as easy as it seemed at first.
But I got to use "make" for the first time.

Head_on_a_Stick wrote:
Altoid wrote:

Just who do you take me for?

Sorry, that was a comment about ...

Sorry?
Hmm ...
Have you had your tea yet? 

I was just taking the piss ... 8^D!
Can't take me that seriously.

Right.
Once I get this working manually, I'll fix that.
Thanks a lot for your input.

Best,

A.

Offline

#16 2021-03-22 19:38:47

rolfie
Member
Registered: 2017-11-25
Posts: 485  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Also got a PCIe card with a Renesas 720201 installed. Used the same tools and failed:

05:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)

Copied the files to /lib/firmware/renesas. I got:

/lib/firmware/renesas# ./upd72020x-load -r -b 05 -d 00 -f 0 -s -o 720201.org
Doing the reading
bus = 5 
dev = 0 
fct = 0 
fname = (null) 
ERROR: wrong vendorid/devid. Expected an UPD720201 or UPD720202 chip and this is not one!
       reported vendorid/devid: 1912:0014 
 ======> FAILED

I would claim the program finds the chip, but maybe still has the old NEC vendor ID coded? I tried to understand the .c file, buit couldn't find any reference to the expected/accepted vendor IDs. 1912:0014 is the correct ID for a 72020x device according https://pci-ids.ucw.cz/read/PC/1912/0014.

Program too old?

rolfie

Last edited by rolfie (2021-03-22 19:39:52)

Online

#17 2021-03-22 21:08:52

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

rolfie wrote:

Also got a PCIe card with a Renesas 720201 installed. Used the same tools and failed:

05:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)

It seems to be a problematic card, to say the least.

It seems that application has a bug.
See here: https://github.com/markusj/upd72020x-load/issues/16 <- fourth post

rtreffer wrote:

So if you compiled the project in the past edit that line to read `is_x1 = true, is_x2 = true;`,
then compile as usual (`make` is enough - the task of make is to figure out what changed an needs to be recompiled)
Then use the new binary to upload.

Now the application apparently works.
But I am doing something wrong.
ie: -w is a no-no and I'm downgrading which apparently won'r work.

See the rest of the thread there, that chap seems to know about it.

Could you send me a link to the firmware you have?

Thanks in advance.

Best,

A.

Offline

#18 2021-03-23 18:04:54

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

I (think) I have been able to solve the riddle but not the problem.
Of great help was rtreffer @Github.

On a whim, I connected another 500Gb USB3.0 drive I have, unused in a box.

It worked: same cable, same USB3.0 card, same port.
Both USB3.0 drives are Toshiba but they are different models.

The one that works is model HXD7 USB 3.0.
The one that does not work is model HXE4 USB 3.0.

dmesg

[ 2420.760462] usb 2-1: new SuperSpeed Gen 1 USB device number 4 using xhci_hcd
[ 2420.787113] usb 2-1: New USB device found, idVendor=043e, idProduct=70f5, bcdDevice= 1.00
[ 2420.787117] usb 2-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[ 2420.787120] usb 2-1: Product: LG External HDD
[ 2420.787123] usb 2-1: Manufacturer: LG Electronics Inc.
[ 2420.787125] usb 2-1: SerialNumber: A3110300000A
[ 2420.791771] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 2420.791953] scsi host9: usb-storage 2-1:1.0
[ 2424.446142] scsi 9:0:0:0: Direct-Access LG External HDD AX00 PQ: 0 ANSI: 5
[ 2424.446523] sd 9:0:0:0: Attached scsi generic sg7 type 0
[ 2424.446645] sd 9:0:0:0: [sdg] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[ 2424.447552] sd 9:0:0:0: [sdg] Write Protect is off
[ 2424.447555] sd 9:0:0:0: [sdg] Mode Sense: 23 00 00 00

So the USB3.0 card and both USB3.0 drives work properly.
It's just that one of them does not do it at USB3.0 speeds.

Since both drives work with the same cable and the same USB3.0 card, I thought the problem had to be with whatever gets done between the card and the SATA/USB bridge.
Nothing else came to mind.

So I opened up the cases (a real PITA) and saw the difference between them:

Model HXD7 has a ASM1053 SATA/USB controller chip.
[http://j5d2v7d7.stackpathcdn.com/wp-con … SM1051.gif] (url) photo from the web

Model HXD7 has a VIA Labs VL 701-04
[https://www.via-labs.com/archive/images … VL701_.jpg] (url) photo from tthe web

Plugged in the way I knew worked, printout from uhubctl* was clear: both drives are detected
---
*An interesting utility to control USB ports in compatible cards.  ->  https://github.com/mvp/uhubctl
---

groucho@devuan:~ $ sudo uhubctl
Current status for hub 2 [1d6b:0003 Linux 4.19.0-14-amd64 xhci-hcd xHCI Host Controller 0000:04:00.0, USB 3.00, 4 ports, ppps]
Port 1: 0203 power 5gbps U0 enable connect [043e:70f5 LG Electronics Inc. LG External HDD A3110300000A]      <----- | x |
Port 2: 02a0 power 5gbps Rx.Detect
Port 3: 02a0 power 5gbps Rx.Detect
Port 4: 02a0 power 5gbps Rx.Detect
Current status for hub 1-3 [0424:2514, USB 2.00, 4 ports, ppps]
Port 1: 0503 power highspeed enable connect [043e:70f5 LG Electronics Inc. LG External HDD A1204000000004C7] <----- | x |
Port 2: 0100 power
Port 3: 0100 power
Port 4: 0100 power
Current status for hub 1 [1d6b:0002 Linux 4.19.0-14-amd64 xhci-hcd xHCI Host Controller 0000:04:00.0, USB 2.00, 4 ports, ppps]
Port 1: 0100 power
Port 2: 0100 power
Port 3: 0503 power highspeed enable connect [0424:2514, USB 2.00, 4 ports, ppps]
Port 4: 0100 power
groucho@devuan:~ $

But when I switch them around, the one with the VIA SATA/USB bridge is no longer detected:

groucho@devuan:~ $ sudo uhubctl
Current status for hub 2 [1d6b:0003 Linux 4.19.0-14-amd64 xhci-hcd xHCI Host Controller 0000:04:00.0, USB 3.00, 4 ports, ppps]
Port 1: 02a0 power 5gbps Rx.Detect                                                                        <----- | o |   
Port 2: 02a0 power 5gbps Rx.Detect
Port 3: 02a0 power 5gbps Rx.Detect
Port 4: 02a0 power 5gbps Rx.Detect
Current status for hub 1-3 [0424:2514, USB 2.00, 4 ports, ppps]
Port 1: 0503 power highspeed enable connect [043e:70f5 LG Electronics Inc. LG External HDD A3110300000A]  <----- | x |
Port 2: 0100 power
Port 3: 0100 power
Port 4: 0100 power
Current status for hub 1 [1d6b:0002 Linux 4.19.0-14-amd64 xhci-hcd xHCI Host Controller 0000:04:00.0, USB 2.00, 4 ports, ppps]
Port 1: 0100 power
Port 2: 0100 power
Port 3: 0503 power highspeed enable connect [0424:2514, USB 2.00, 4 ports, ppps]
Port 4: 0100 power
groucho@devuan:~ $

That seems to be what it is all about.

lsusb -vv can reveal interesting things:

groucho@devuan:~$ sudo lsusb -vv 
--- snip ---
Bus 002 Device 007: ID 043e:70f5 LG Electronics USA, Inc. External HDD
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x043e LG Electronics USA, Inc.
  idProduct          0x70f5 External HDD
  bcdDevice            1.00
  iManufacturer           2 LG Electronics Inc.
  iProduct                3 LG External HDD
  iSerial                 1 A3110300000A
--- snip ---
 wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)    <---
      Device can operate at High Speed (480Mbps)   <---
      Device can operate at SuperSpeed (5Gbps)     <---
--- snip ---  
Bus 001 Device 006: ID 043e:70f5 LG Electronics USA, Inc. External HDD
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x043e LG Electronics USA, Inc.
  idProduct          0x70f5 External HDD
  bcdDevice            6.00
  iManufacturer           1 LG Electronics Inc.
  iProduct                2 LG External HDD
  iSerial                 3 A1204000000004C7
--- snip ---
   wSpeedsSupported   0x000c
      Device can operate at High Speed (480Mbps)    <---
      Device can operate at SuperSpeed (5Gbps)      <---
--- snip ---

lsusb reveals that both external USB3.0 drives support USB3.0 speeds.
I'd think that data that comes from somewhere in the drive's SATA/USB3.0 bridge, not the HDD.

If I had to make an (un)educated guess, I'd say that one SATA/USB bridge has a problem with the USB3.0 ports' Rx.Detect.
And if this were true, could it be a xHCI_PCI module problem/setting causing this?

But it is all over my head.

Any comments of suggestions will be welcome.

Thanks in advance,

Best,

A.

Offline

#19 2021-03-23 20:52:18

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 542  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Did you try using the USB "address"? The above example shows bus 2 device 7 funciton 0 (well, the last is not shown but my guess).

Offline

#20 2021-03-23 21:19:18

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] USB 3.0 card, external drive and unknown algorithms

Hello:

ralph.ronnquist wrote:

... try using the USB "address" ...

Well ...
I'll be quick so my mood does not get worse yet.

---

I really deserve to be mocked to extintion.

I got these USB drives long ago to do some installations that were eventually cancelled.
Got to keep them but have since had very little use.
They are in pristine condition.

Each drive came with it's own OEM cable in the box.

These cables are, as far as I can see, identical and have the same markings: AWM 2725   80°C   30V  VM-1
One says "USB 3.0 HighSpeed Cable Broad" and the other says "Universal Serial Bus 3.0", only difference.

But the drives are both USB3.0 ...

Having no reason to think otherwise, I assumed that they were also electrically identical.
More so coming from the same OEM that sells these drives.

So ...
USB cable A bundled with USB3.0 drive A is the same as USB cable B bundled with USB3.0 drive B, in every sense.
Same OEM, same USB standard, same capacity drive, same markings ...
And as such, obviously interchangeable.
Right?

---
BTW: I was asked about the cable at GitHub.
But as they both worked, there wasn't anything wrong with them.
---

Well ...
Tl,dr: I switched the cables and now both drives are recognised.

groucho@devuan:~ $ sudo uhubctl
[sudo] password for groucho:
Current status for hub 5 [1d6b:0003 Linux 4.19.0-14-amd64 xhci-hcd xHCI Host Controller 0000:04:00.0, USB 3.00, 4 ports, ppps]
Port 1: 0203 power 5gbps U0 enable connect [043e:70f5 LG Electronics Inc. LG External HDD A3110300000A]      <--- | x |
Port 2: 0203 power 5gbps U0 enable connect [043e:70f5 LG Electronics Inc. LG External HDD A1204000000004C7]  <--- | x |
Port 3: 02a0 power 5gbps Rx.Detect
Port 4: 02a0 power 5gbps Rx.Detect
Current status for hub 3-3 [0424:2514, USB 2.00, 4 ports, ppps]
Port 1: 0100 power
Port 2: 0100 power
Port 3: 0100 power
Port 4: 0100 power
Current status for hub 3 [1d6b:0002 Linux 4.19.0-14-amd64 xhci-hcd xHCI Host Controller 0000:04:00.0, USB 2.00, 4 ports, ppps]
Port 1: 0100 power
Port 2: 0100 power
Port 3: 0507 power highspeed suspend enable connect [0424:2514, USB 2.00, 4 ports, ppps]
Port 4: 0100 power
groucho@devuan:~ $

For whatever reason, drive A will only work properly with cable A but drive B will work properly with cable A or cable B.
Seems that "USB 3.0 HighSpeed" is not the same as "Universal Serial Bus 3.0"

[rant]
Is it possible that Toshiba skimped $0.05 on a 30cm USB3.0 cable for their #$%& external USB3.0 drives?
Unbelievable ...
[/rant]

So that's it.
Tomorrow I'll feel better.

Thanks for your input.

A.

Last edited by Altoid (2021-03-23 21:20:25)

Offline

Board footer