How to flash 9211-8i into IT Mode

How to flash 9211-8i into IT Mode
Markus Spiske - Unsplash

I began by quest to git my 9211-8i into IT mode with an issue: I realized that the linux sas2flash would not convert IR to IT and vice versa. Documentation quickly revealed why: You must use sas2flsh.exe or sas2flash.efi (from an EFI Shell) to erase and flash.

The first thing I went about doing was gathering the components that I would need:

I included the links above to hopefully save you a little time in searching. I find it rather difficult to narrow down how to find things in the Broadcom support site when you are first visiting.

I started out cleaning off my USB stick, and making a FAT32 partition. Use your favorite partition too, but I just used trusty fdisk to get the job done:

[root@wraith ~]# fdisk /dev/sdd

Welcome to fdisk (util-linux 2.38).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-30489407, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-30489407, default 30489407): 

Created a new partition 1 of type 'Linux' and of size 14.5 GiB.

Command (m for help): t
Selected partition 1
Hex code or alias (type L to list all): L

00 Empty            27 Hidden NTFS Win  82 Linux swap / So  c1 DRDOS/sec (FAT-
01 FAT12            39 Plan 9           83 Linux            c4 DRDOS/sec (FAT-
02 XENIX root       3c PartitionMagic   84 OS/2 hidden or   c6 DRDOS/sec (FAT-
03 XENIX usr        40 Venix 80286      85 Linux extended   c7 Syrinx         
04 FAT16 <32M       41 PPC PReP Boot    86 NTFS volume set  da Non-FS data    
05 Extended         42 SFS              87 NTFS volume set  db CP/M / CTOS / .
06 FAT16            4d QNX4.x           88 Linux plaintext  de Dell Utility   
07 HPFS/NTFS/exFAT  4e QNX4.x 2nd part  8e Linux LVM        df BootIt         
08 AIX              4f QNX4.x 3rd part  93 Amoeba           e1 DOS access     
09 AIX bootable     50 OnTrack DM       94 Amoeba BBT       e3 DOS R/O        
0a OS/2 Boot Manag  51 OnTrack DM6 Aux  9f BSD/OS           e4 SpeedStor      
0b W95 FAT32        52 CP/M             a0 IBM Thinkpad hi  ea Linux extended 
0c W95 FAT32 (LBA)  53 OnTrack DM6 Aux  a5 FreeBSD          eb BeOS fs        
0e W95 FAT16 (LBA)  54 OnTrackDM6       a6 OpenBSD          ee GPT            
0f W95 Ext'd (LBA)  55 EZ-Drive         a7 NeXTSTEP         ef EFI (FAT-12/16/
10 OPUS             56 Golden Bow       a8 Darwin UFS       f0 Linux/PA-RISC b
11 Hidden FAT12     5c Priam Edisk      a9 NetBSD           f1 SpeedStor      
12 Compaq diagnost  61 SpeedStor        ab Darwin boot      f4 SpeedStor      
14 Hidden FAT16 <3  63 GNU HURD or Sys  af HFS / HFS+       f2 DOS secondary  
16 Hidden FAT16     64 Novell Netware   b7 BSDI fs          f8 EBBR protective
17 Hidden HPFS/NTF  65 Novell Netware   b8 BSDI swap        fb VMware VMFS    
18 AST SmartSleep   70 DiskSecure Mult  bb Boot Wizard hid  fc VMware VMKCORE 
1b Hidden W95 FAT3  75 PC/IX            bc Acronis FAT32 L  fd Linux raid auto
1c Hidden W95 FAT3  80 Old Minix        be Solaris boot     fe LANstep        
1e Hidden W95 FAT1  81 Minix / old Lin  bf Solaris          ff BBT            
24 NEC DOS        

Aliases:
   linux          - 83
   swap           - 82
   extended       - 05
   uefi           - EF
   raid           - FD
   lvm            - 8E
   linuxex        - 85
Hex code or alias (type L to list all): 0c
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

[root@wraith ~]# fdisk -l /dev/sdd
Disk /dev/sdd: 14.54 GiB, 15610576896 bytes, 30489408 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdd1        2048 30489407 30487360 14.5G  c W95 FAT32 (LBA)

Next, I quickly created a FAT filesystem on the USB partition and mounted it at /mnt  ( unetbootin asks for it to be mounted, so I obliged early):

❯ sudo mkfs.vfat /dev/sdd1
mkfs.fat 4.2 (2021-01-31)
❯ sudo mount /dev/sdd1 /mnt

As mentioned above, unetbootin was a simple way to get a bootable ms-dos on the disk:

sudo unetbootin

Select FreeDOS, and select the partition you created the FAT32 filesystem on the USB stick earlier.

Next, I copied the 9211-8i BIOS, Firmware, and sas2flsh.exe utility into the filesystem:

sudo cp 9211-8i_Package_P20_IR_IT_FW_BIOS_for_MSDOS_Windows/Firmware/HBA_9211_8i_IT/2118it.bin /mnt
sudo cp 9211-8i_Package_P20_IR_IT_FW_BIOS_for_MSDOS_Windows/sasbios_rel/mptsas2.rom /mnt
sudo cp 9211-8i_Package_P20_IR_IT_FW_BIOS_for_MSDOS_Windows/sas2flash_dos_rel/sas2flsh.exe /mnt

Hurray! I should have everything I need right? Kinda! I booted into FreeDOS, ran the sas2flsh.exe -listall command and it came back saying "ERROR: Failed to initialize PAL. Exiting the program." Bugger.

UEFI. Luckily, it wasn't difficult to remedy this problem. First, I downloaded the EFI Shell linked above, and copied it to the USB, making sure to name it shellx64.efiand also the UEFI SAS flash tool also linked above:

sudo cp Shell_Full.efi /mnt/shellx64.efi
sudo cp Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/sas2flash.efi

Just adding these 2 additional files unlocked what I needed. On my Asus motherboard, I was able to go into the UEFI BIOS, and tell it to "Launch EFI Sell from Filesystem". Doing this immediately took me into an EFI shell, and it performed a map command and showed me all the drives, the last of which was my USB. It had a long name, but the alias fs2 was all I needed:

efi> mount fs2
Success!
efi> fs2:
fs2:> ls
2118it.bin
sas2flash.efi
sas2flsh.exe
mptsas2.rom
<snip>

This is looking promising! The commands above mounted the USB drive, changed your directory into the mount, and showed the files on the USB, including all the files we had copied! Now it is finally flash time!

First, do a listall to make sure you select the correct card if you have more than 1:

sas2flash.efi -listall

If there are multiple cards, select the correct one with -c #

Next, clear off the old IR code. This can take several minutes. Let it run, and don't interrupt:

sas2flash.efi -o -e 6

Finally, flash it and put on the latest BIOS. Just like above, this will take a short amount of time, and don't interrupt:

sas2flash.efi -o -f 2118it.bin -b mptsas2.rom

Voila! You should now have a LSI 9211-8i flash with the IT firmware, the firmware required if you are going to be using cart to drive ZFS disks.

You should now be able to boot normally, and go about your ZFS business. In My case, I was exposing some drives for ZFS on Proxmox. What a beautiful world we live in these days!

-Haplo