On Tue, Jan 14, 2025 at 11:10:26AM -0500, Christopher Lentocha wrote:
For whatever reason, when you compile SeaBIOS in Csm16 mode, and use it under EDK2's OvmfPkg, the ATA_CMD_IDENTIFY_PACKET_DEVICE command doesn't work properly,
Probably the device is in a different state due to the edk2 driver having talked to the device before.
Maybe add a controller reset to the initialization path? Currently the driver code only resets the ports.
In order to fix this bug, I decided to move the "detected as a disk" function to be a goto, so code isn't sloppy, by being copied and pasted 1:1 (though this can be changed back later if needed), and in the detected as CDROM function, when it fails at its point, assume its a harddisk, make sure it is with the ATA_CMD_IDENTIFY_DEVICE (which works fine in my testing) command, and continue from there.
That is more a workaround than a solution ...
take care, Gerd