what's the difference between flashing LSI firmware with megarec vs sas2flash?

BLinux

cat lover server enthusiast
Jul 7, 2016
2,514
950
113
artofserver.com
I'm familiar with using sas2flash. And I know as part of the cross flashing process, megarec is used to modify the SBR and erase the flash. But, I also noticed that megerac has a -m0flash option, which is used to flash firmware as well. so, what's the difference?

I notice a lot of mentions of using "megarec -m0flash" use firmware files that end in .rom, vs sas2flash uses files that are named with a .bin extension. are there any real differences here?
 

nezach

Active Member
Oct 14, 2012
204
105
43
Megarec probably does low level flashing, as in accessing and writing to flash chip directly. Sas2flash just calls one of the MPI functions, see my tech discussion thread for the list. It does not actually flash anything since that is done by existing firmware itself.

I am planning to cover this, as well as differences between firmware files, at some point in more detail.
 
  • Like
Reactions: cactus

BLinux

cat lover server enthusiast
Jul 7, 2016
2,514
950
113
artofserver.com
Megarec probably does low level flashing, as in accessing and writing to flash chip directly. Sas2flash just calls one of the MPI functions, see my tech discussion thread for the list. It does not actually flash anything since that is done by existing firmware itself.

I am planning to cover this, as well as differences between firmware files, at some point in more detail.
what "tech discussion thread" are you talking about?

I know sas2flash has to hostboot the firmware from a file first, and then uses that functionality to write firmware to flash. how does megarec do it, i'm not sure.

but, are you saying, the effective result, flashing with megarec or sas2flash is the same?
 

nezach

Active Member
Oct 14, 2012
204
105
43
what "tech discussion thread" are you talking about?
This one: https://forums.servethehome.com/ind...d-raid-controller-technical-discussion.24119/

I know sas2flash has to hostboot the firmware from a file first, and then uses that functionality to write firmware to flash. how does megarec do it, i'm not sure.

but, are you saying, the effective result, flashing with megarec or sas2flash is the same?
I still need to do a bit more research on this, so some things I say might be wrong. There are several different ways to flash LSI cards.

If card is running IT firmware and you are flashing IT firmware with sas2flash or similar tool, the tool sends MPI message MPI2_FUNCTION_FW_DOWNLOAD to the currently running firmware and firmware does the actual updating.

If you are flashing MegaRAID over MegaRAID using megacli or similar tool then the tool you are using sends DCMD command to the MegaRAID firmware.

If you are flashing card that is in an inoperable state, then it needs to be hostbooted before it can be flashed.

There are also tools/commands that just overwrite the whole flash with the data from the file that you provide. Megarec, I think, falls in to this category. These tools work at lower level than sas2flash/megacli because they don't send commands to the currently running firmware.
 
  • Like
Reactions: Vidmo and zxv