upd72020x-load icon indicating copy to clipboard operation
upd72020x-load copied to clipboard

ERROR: failed to set ROM parameter register

Open jm355 opened this issue 1 year ago • 7 comments

~/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 avatar Feb 29 '24 22:02 jm355

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 avatar Mar 01 '24 03:03 jm355

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 avatar Mar 01 '24 03:03 jm355

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?

jm355 avatar Jul 08 '24 01:07 jm355

@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:

  • Installed the AUR package upd72020x-fw and rebooted.

  • Git cloned the repo:

git clone https://github.com/markusj/upd72020x-load.git
cd upd72020x-load
  • Run the upd72020x-check-and-init script:
sudo ./upd72020x-check-and-init
  • Downloaded the firmware K2026090.mem and changed its name to K2026.mem and placed it at the upd72020x-load folder.

  • Built the upd72020x-load.c file with make:

make upd72020x-load
  • Unbounded the device (mine was 21):
sudo sh -c "echo -n 0000:21:00.0 > /sys/bus/pci/drivers/xhci_hcd/unbind"
  • Made the backup:
sudo ./upd72020x-load -b 21 -d 0 -f 0 -r -o backup
  • Uploaded the firmware:
sudo ./upd72020x-load -u -b 21 -d 0 -f 0 -i K2026.mem
  • Flashed it:
sudo ./upd72020x-load -w -b 21 -d 0 -f 0 -i K2026.mem
  • Bounded the device:
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 avatar Aug 13 '24 20:08 italoghost

Never mind, it has happened again.

italoghost avatar Aug 13 '24 21:08 italoghost

Okay, now I got it working!

First of all, I uninstalled the AUR packaged:

sudo pacman -Rdd upd72020x-fw
  • Then I entered the folder where my files were:
cd upd72020x-load
  • I already had compiled the upd72020x-load file - as specified on the steps of my previously comment -, so I unbounded the device (mine was 21):
sudo sh -c "echo -n 0000:21:00.0 > /sys/bus/pci/drivers/xhci_hcd/unbind"
  • Made the backup:
sudo ./upd72020x-load -b 21 -d 0 -f 0 -r -o backup
  • Uploaded the firmware:
sudo ./upd72020x-load -u -b 21 -d 0 -f 0 -i K2026.mem
  • Flashed it:
sudo ./upd72020x-load -w -b 21 -d 0 -f 0 -i K2026.mem
  • Bounded the device:
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!

italoghost avatar Aug 16 '24 22:08 italoghost

Hmm, still not working for me unfortunately.

jm355 avatar Aug 18 '24 16:08 jm355

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.

jm355 avatar Sep 13 '24 03:09 jm355