PCIe SATA controllers - what do they use SPI flash for? - Page 1
Forum section: electronics / projects

author: HwAoRrDk
author_rank: Super Contributor
timestamp: February 01, 2024, 02:19:20 pm
content: There are various PCIe SATA controller chips on the market, from the likes of ASMedia, JMicron, Marvell, etc. From what information is publicly available on these chips (seems detailed datasheets are private), I gather they all use an external SPI flash for some kind of configuration information. What exactly is it that is stored in this flash memory?For instance, the public datasheet for the Marvell 88SE9215 only says the following about the SPI flash: "Vendor specific information stored in the external device is read by the controller during the chip power-up". Is it basically just manufacturer name, model, IDs, etc. for the expansion card manufacturer?The SPI flash is also referred to as an "option ROM". Is this a boot ROM used by a PC BIOS so that the connected SATA drives are able to be booted from? So it might be, as the name suggests, optional if you either don't need the connected drives to be bootable, or are operating on a non-PC system?I've been looking at these devices because I have a crazy idea to make my own SATA expansion HAT for the new Raspberry Pi 5, using its PCIe connector. What I was thinking I might do is buy a cheap PCIe expansion card featuring one of these chips and remove the chip and transplant it to my own board. I'm wondering if I would need to also transplant (or copy the contents of) the SPI flash chip too.

author: coromonadalix
author_rank: Super Contributor
timestamp: February 01, 2024, 06:47:26 pm
content: not being rude but come solutions exists ??https://linuxgizmos.com/sata-hats-support-up-to-four-drives-on-raspberry-pi-4-or-rock-pi-4/

author: HwAoRrDk
author_rank: Super Contributor
timestamp: February 01, 2024, 08:07:14 pm
content: Yes, I know.But existing solutions aren't really the same (USB to SATA), or they're not actually for the Raspberry Pi (for other same-form-factor SBCs). What I'm thinking of is specifically for the Raspberry Pi 5, using its new PCIe expansion connector.Anyway, I'm not saying it's a sensible idea.I just thought it might be fun to try to build my own solution.I foundthis bit of reverse-engineeringconcerning the JMicron JMB585. And following the assertion given there that firmware update packages contain images for the SPI flash, I also found some for the ASMedia ASM106x series. It seems the SPI flash contents doesn't differ based on the board manufacturer, but is instead generic and only contains device IDs and configuration data, plus a boot ROM for legacy/UEFI BIOSes. But I'm a bit puzzled by the ROM images for the ASM106x, as they're 128kB, but all the cards I've seen thus far have 64kB (512k x 1) flash chips.

author: magic
author_rank: Super Contributor
timestamp: February 01, 2024, 09:56:02 pm
content: Hell knows what's there, maybe just PCI IDs or maybe firmware without which the chip won't do anything useful at all. 64KB is suspiciously large; I have seen tiny 1Kb or less EEPROMs on boards where it was only a matter of IDs.Considering the overall effort of your project, transplanting one extra SO8 chip is a walk in the park"Option ROM" does sound like the x86 boot code. This specific part shouldn't be necessary unless you are booting an x86.By the way, does it have to be a SATA hat? Perhaps make a PCIe hat and connect an off the shelf card to it. For a quick and dirty one-off, one could even hack something together using off the shelf PCIe riser cards.

author: Haenk
author_rank: Super Contributor
timestamp: February 02, 2024, 10:40:25 am
content: I assume there potentially *is* some Firmware included.If you are an oldschool Mac fan, you might know the trouble of booting from SATA-cards - to my knowledge, only FirmTek/SeriTek came with a firmware to support booting.So there certainly is going on more than only providing a VendorID/DeviceID.Will not help on the Pi, though.However AFAIK there are now 2(?) hats available to provide SATA, maybe takle a look how they did it.

author: coromonadalix
author_rank: Super Contributor
timestamp: February 02, 2024, 11:47:58 am
content: normally any hardware need to identify itself ... thats why you see vid / pids in windows and others in linux or other os'essome devices like mouse, KB, touch screens are under HID dclaration, os will immediately know how to handle themnormally once the chipset drivers "the most important one is installed", all others should declare at some point ... or get unknown status ??no experiences on linux or mac ... but should have some similartities