markusj / upd72020x-load

Firmware loader for Renesas uPD72020x USB 3.0 chipsets for Linux
72 stars 19 forks source link

ERROR: failed to set ROM parameter register #26

Closed jm355 closed 2 months ago

jm355 commented 8 months ago
~/g/upd72020x-load (master|✔) $ sudo ./upd72020x-check-and-init
egrep: warning: egrep is obsolescent; using grep -E
Found possible uPD72020x on 05:00.0
./upd72020x-check-and-init: line 37: echo: write error: No such device
Uploading firmware to 05:00.0
Doing the upload
bus = 5 
dev = 0 
fct = 0 
fname = K2026.mem 
Found an UPD720202 chipset
got firmware version: 200000
EEPROM installed
got rom_info: ef3013
got rom_config: 0
setting rom_config: 700
ERROR: failed to set ROM parameter register
./upd72020x-check-and-init: line 50: echo: write error: Connection timed out
Done with 05:00.0
Done with all devices

Any ideas on what could be going wrong or what I could do to fix it?

jm355 commented 8 months ago

This also prevents making a backup:

~/g/upd72020x-load (master|✚1) $ sudo ./upd72020x-load -b 5 -d 0 -f 0 -r -o backup
Doing the reading
bus = 5 
dev = 0 
fct = 0 
fname = backup 
Found an UPD720202 chipset
got firmware version: 200000
EEPROM installed
got rom_info: ef3013
got rom_config: 0
setting rom_config: 700
ERROR: failed to set ROM parameter register
~/g/upd72020x-load (master|✚1) [1]$ ll backup
ls: cannot access 'backup': No such file or directory
jm355 commented 8 months ago

installing upd72020x-fw from the aur, rebooting, manually unbinding the device, calling upd72020x-load, and binding the device again, seems to have worked.

After unbinding the device, I made a backup:

sudo ./upd72020x-load -b 5 -d 0 -f 0 -r -o backup

Then, I uploaded the firmware to make sure it would work:

sudo ./upd72020x-load -u -b 5 -d 0 -f 0 -i K2026.mem

When that work, I decided to flash it, since as you can see from my initial post, the firmware was pretty outdated, and I was getting issues with step 34 (copied here for SEO if anyone else has this issue)

xhci_hcd 0000:05:00.0: Timeout for Set DATAX step: 34
xhci_hcd 0000:05:00.0: ROM Download Step 34 failed at position 136 bytes with (-110)

The command to flash (do at your own risk!): sudo ./upd72020x-load -w -b 5 -d 0 -f 0 -i K2026.mem

and with that passing, I bound it again, uninstalled the AUR package, and rebooted. The reboot was noticeably faster, and I no longer get the error in logs.

jm355 commented 4 months ago

Looks like somehow the firmware got reverted, and now I'm running into this and my previous fix no longer works - it always says "ERROR: failed to set ROM parameter register" even when trying to make a backup. Any ideas on what might be going on or how to fix it?

italoghost commented 3 months ago

@jm355 I followed your guide at the ArchLinux Forums and it worked for me! The only thing that I did differently was to reinstall the AUR package. Here is what I did:

git clone https://github.com/markusj/upd72020x-load.git
cd upd72020x-load
sudo ./upd72020x-check-and-init
make upd72020x-load
sudo sh -c "echo -n 0000:21:00.0 > /sys/bus/pci/drivers/xhci_hcd/unbind"
sudo ./upd72020x-load -b 21 -d 0 -f 0 -r -o backup
sudo ./upd72020x-load -u -b 21 -d 0 -f 0 -i K2026.mem
sudo ./upd72020x-load -w -b 21 -d 0 -f 0 -i K2026.mem
sudo sh -c "echo -n 0000:21:00.0 > /sys/bus/pci/drivers/xhci_hcd/bind"

Then I removed the AUR package. The problem is that when I removed it, I faced the same problem as you had, with the errors can't setup: -110 and init 0000:05:00.0 fail, -110.

Installing the firmware again after the boot, properly shutting down the PC and turning it on again made the error disappear!

I believe that you can reinstall the firmware package from the AUR and it will work for you as well.

italoghost commented 3 months ago

Never mind, it has happened again.

italoghost commented 2 months ago

Okay, now I got it working!

First of all, I uninstalled the AUR packaged:

sudo pacman -Rdd upd72020x-fw
cd upd72020x-load
sudo sh -c "echo -n 0000:21:00.0 > /sys/bus/pci/drivers/xhci_hcd/unbind"
sudo ./upd72020x-load -b 21 -d 0 -f 0 -r -o backup
sudo ./upd72020x-load -u -b 21 -d 0 -f 0 -i K2026.mem
sudo ./upd72020x-load -w -b 21 -d 0 -f 0 -i K2026.mem
sudo sh -c "echo -n 0000:21:00.0 > /sys/bus/pci/drivers/xhci_hcd/bind"

It seems to have worked! I have shutdown my computer multiple times and the errors didn't appear!

jm355 commented 2 months ago

Hmm, still not working for me unfortunately.

jm355 commented 2 months ago

Not sure exactly what was causing the issue, but with upd72020x-fw uninstalled, here's some more info

kernel command line options when this was not working for me: nowatchdog nmi_watchdog=0 modprobe.blacklist=sp5100_tco vt.global_cursor_default=0 random.trust_cpu=off rd.system.show_status=auto lockdown=integrity intel_iommu=on amd_iommu=on slab_nomerge init_on_alloc=1 init_on_free=1 page_alloc.shuffle=1 pti=on randomize_kstack_offset=on vsyscall=none debugfs=off

kernel command line options when this worked: nowatchdog nmi_watchdog=0 modprobe.blacklist=sp5100_tco vt.global_cursor_default=0 random.trust_cpu=off rd.system.show_status=auto

After using the stripped down command line options I was able to write the firmware (-w option), and after going back to my full list of options (many are from https://madaidans-insecurities.github.io/guides/linux-hardening.html), re-running mkinitcpio, rebooting, and it seems to have stuck.