I don't know where to post this so "general" it is... wish there was a section in hardware for this kind of discussion....
So, a little context. I've been messing around a lot with flashing firmware on SAS controllers. I've gotten to the point where I'm even using a CH341 /USB adapter to read/write the I2C EEPROM chip off the PCIe cards. The SBR of the SAS controllers is stored on this EEPROM and I've been using the EEPROM programmer to recover SAS cards that I've bricked in my experimentation.
In all this playing around, I've found that the SBR can be of 2 different sizes (maybe more? but I've observed at least 2), the typical seems to be 256-bytes, while *some times* on HW RAID cards, it is 512-bytes. In both cases, the contents of the SBR is usually stored twice in that 256 or 512 byte block of data. The EEPROM chips are usually 8k, so there's a lot of empty space filled with 0x00, but i guess also means it might be possible to have larger SBR? The SBR contains various "configuration" data it seems, among them are things like:
PCI class ID
PCI vendor ID
PCI product ID
PCI subsystem vendor ID
PCI subsystem product ID
and other bytes seem to be used by the firmware code as configuration settings it seems. The various PCI ids of course are pretty typical for any PCIe card. what i've noticed is that the offset for the various PCI ids in the SBR is different in the 256B vs 512B formats. so, for the host system to detect these PCI ids isn't simply reading the bytes at a pre-determined offset without knowing which format SBR is in use.
Also, i can add junk bytes after the 256B SBR format and it doesn't cause a problem. So however the data in the SBR is read by the host system, it knows when to stop reading. The "megarec" program also seems to know when to read 256B or 512B when reading the SBR to a file.
Which brings me to my question, how does one programmatically determine which format SBR is in use? Is there some byte near the beginning of the SBR to determines if the SBR is 256B or 512B? And consequently, to know at which offsets to find the PCI class ID, vendor ID, etc.?
BTW, this is mostly on varieties of the LSI SAS2208/2308 based SAS controllers. I'm finding even the same model controllers can have different SBR sizes in *some* cases, but work just fine. For example, on a SAS2208 with a 512B SBR, if I put the 256B SBR on it, it breaks. But I also have SAS2208 cards that come natively with 256B SBR and work just fine. So, even though both are the same hardware, they are expecting different SBRs....
Any ideas?
So, a little context. I've been messing around a lot with flashing firmware on SAS controllers. I've gotten to the point where I'm even using a CH341 /USB adapter to read/write the I2C EEPROM chip off the PCIe cards. The SBR of the SAS controllers is stored on this EEPROM and I've been using the EEPROM programmer to recover SAS cards that I've bricked in my experimentation.
In all this playing around, I've found that the SBR can be of 2 different sizes (maybe more? but I've observed at least 2), the typical seems to be 256-bytes, while *some times* on HW RAID cards, it is 512-bytes. In both cases, the contents of the SBR is usually stored twice in that 256 or 512 byte block of data. The EEPROM chips are usually 8k, so there's a lot of empty space filled with 0x00, but i guess also means it might be possible to have larger SBR? The SBR contains various "configuration" data it seems, among them are things like:
PCI class ID
PCI vendor ID
PCI product ID
PCI subsystem vendor ID
PCI subsystem product ID
and other bytes seem to be used by the firmware code as configuration settings it seems. The various PCI ids of course are pretty typical for any PCIe card. what i've noticed is that the offset for the various PCI ids in the SBR is different in the 256B vs 512B formats. so, for the host system to detect these PCI ids isn't simply reading the bytes at a pre-determined offset without knowing which format SBR is in use.
Also, i can add junk bytes after the 256B SBR format and it doesn't cause a problem. So however the data in the SBR is read by the host system, it knows when to stop reading. The "megarec" program also seems to know when to read 256B or 512B when reading the SBR to a file.
Which brings me to my question, how does one programmatically determine which format SBR is in use? Is there some byte near the beginning of the SBR to determines if the SBR is 256B or 512B? And consequently, to know at which offsets to find the PCI class ID, vendor ID, etc.?
BTW, this is mostly on varieties of the LSI SAS2208/2308 based SAS controllers. I'm finding even the same model controllers can have different SBR sizes in *some* cases, but work just fine. For example, on a SAS2208 with a 512B SBR, if I put the 256B SBR on it, it breaks. But I also have SAS2208 cards that come natively with 256B SBR and work just fine. So, even though both are the same hardware, they are expecting different SBRs....
Any ideas?