[SeaBIOS] Loading Option ROM for SATA Controller Card

Adam Novak interfect at gmail.com
Mon Nov 27 03:28:01 CET 2017


I've installed a SI-PEX40064 SATA controller card
<http://www.sybausa.com/index.php?route=product/product&product_id=156>
in my system that I am trying to use with PCI passthrough via Xen, in
order to give a guest VM its own real SATA controller so as to not
have to deal with virtual disks. Moreover, I want to boot off of a
disk attached to the card.

The card implements (or pretends to implement) AHCI, so SeaBIOS starts
up and can see the attached disk. But SeaBIOS gets a timeout
communicating with the disk:

|eff9d000| WARNING - Timeout at ahci_port_setup:469!
|eff9d000| AHCI/2: device not ready (tf 0x58)

The card has a PCI Option ROM, and I think the Option ROM needs to be
loaded for the card to work and/or be bootable. But SeaBIOS refuses to
load the Option ROM. (My real physical system with Asus EFI firmware
and CSM enabled does load the Option ROM for the card when it is
installed.) I dug into the code, and it looks like it's the same issue
as is mentioned here:

https://mail.coreboot.org/pipermail/seabios/2017-June/011425.html

Basically, a device is not checked for an option ROM (or an
fw_fcg/CBFS-based Option ROM file), and its option ROM is not loaded,
if pci->have_driver is set for the device. That field gets set for
anything that apparently implements AHCI, so the Option ROMs for AHCI
controllers are skipped, even if they are useful. Removing that check
causes the option ROM for my card to be loaded, and allows the
bootloader stored on the disk attached to the card to start up.

I've attached a patch that implements this change, and adds a few more
debug messages to explain what is going on. I haven't observed any
problems with my patched SeaBIOS under Xen, but I'm not sure why the
check was there in the first place (as it wasn't commented), so I
can't speak to the repercussions of disabling it on everyone else's
machines.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Load-PCI-Option-ROMs-from-devices-even-if-we-have-a-.patch
Type: text/x-patch
Size: 1088 bytes
Desc: not available
URL: <http://mail.coreboot.org/pipermail/seabios/attachments/20171126/75894c5e/attachment.patch>


More information about the SeaBIOS mailing list