Go to file
Hector Martin 87d9ddaf46 Typofix 2018-03-28 16:02:31 +09:00
sample_sbr Initial commit 2018-03-28 02:28:58 +09:00
.gitignore Initial commit 2018-03-28 02:28:58 +09:00
LICENSE Initial commit 2018-03-28 02:28:58 +09:00
Makefile Initial commit 2018-03-28 02:28:58 +09:00
README.md Typofix 2018-03-28 16:02:31 +09:00
lsirec.c Initial commit 2018-03-28 02:28:58 +09:00
sbrtool.py Initial commit 2018-03-28 02:28:58 +09:00

README.md

lsirec - LSI SAS2008/2108 HBA low-level recovery tool for Linux

Currently supports reading and writing the SBR. In the future it may support cold-booting the adapter to recover bricked adapters or crossflash between firmwares directly from Linux.

Use lsiutil to crossflash between IT/IR firmwares from Linux, without vendor/product ID restrictions.

Quick guide to cleanly crossflash between IT/IR firmwares

# lsiutil -e

Select your adapter.

46. Upload FLASH section5. Complete (all sections)

Make a complete Flash backup to be safe.

67. Dump all port state

68. Show port state summary

Copy and paste these somewhere safe. Take special note of the SAS WWID.

33. Erase non-volatile adapter storage3. FLASH, then also 8. Persistent manufacturing config pages

Wipe the whole Flash. This will take a while. Option number 3 excludes the manufacturing config pages, so you need both.

2. Download firmware (update the FLASH)

Flash the new firmware. Optionally, use 4. Download/erase BIOS and/or FCode (update the FLASH) to flash the BIOS/EFI module (not necessary if you're not booting from the adapter).

Exit lsiutil.

# ./lsirec 0000:01:00.0 readsbr sbr_backup.bin

Where 0000:01:00.0 is your PCI device ID.

# python3 sbrtool.py parse sbr_backup.bin sbr.cfg

Edit sbr.cfg with your favorite text editor. You may want to add SASAddr = 0xYOUR_SAS_WWID to make the SAS WWID persist in the SBR (I'm not sure which firmwares use this, but I've seen it in some SBRs). You may want to change the Subsystem VID/PID, or use another SBR as a template.

# python3 sbrtool.py build sbr.cfg sbr_new.bin

# ./lsirec 0000:01:00.0 writesbr sbr_new.bin

Reboot and cross your fingers.

When the system comes back up, if all went well, launch lsiutil -e again and use 18. Change SAS WWID to update the WWID if necessary, then reboot again (this writes it to the config section in Flash, not to the SBR).

Disclaimer

This has barely been tested a couple of cards. Don't blame me if this bricks or smokes your HBA. For crossflashing MegaRAID cards to IT/IR, you'll still need to flash from DOS/UEFI for now, since lsiutil does not work with non-operational adapters under Linux.

DO NOT attempt to use this tool on non-SAS2x08 chipsets. It probably won't work and may do horrible things. This tool deliberately does not check the VID/PID so it can be used on cards with wacky SBRs, but that means it will happily try to write the SBR into any random PCI device too.

I have tested this on an LSI SAS2108-based MegaRAID card (Fujitsu D2616) with MegaRAID firmware and it successfully backed up the SBR, but the action triggered a PCI error in syslog (though the controller kept working). Your mileage may vary.

License

2-clause BSD. See the LICENSE file.