Hi,
I add one config 'IDE_TO_AHCI' in 'seabios\src\Kconfig' and modify 'seabios\src\ata.c'. Please help me to review and check-in.
This 'IDE_TO_AHCI' function can let SeaBIOS handle AHCI controller as IDE controller when 'ATA' enable, and also let Windows OS to load AHCI inbox driver or chipset vender's AHCI driver. In other words, it means that SATA Hard Disk ran as IDE mode in SeaBIOS but AHCI mode in Windows OS.
Best regards,
Alex
In 'seabios\src\Kconfig':
menu "Hardware support"
config ATA
depends on DRIVES
bool "ATA controllers"
default y
help
Support for IDE disk code.
config ATA_DMA
depends on ATA
bool "ATA DMA"
default n
help
Detect and try to use ATA bus mastering DMA controllers.
config ATA_PIO32
depends on ATA
bool "ATA 32bit PIO"
default n
help
Use 32bit PIO accesses on ATA (minor optimization on PCI transfers).
config IDE_TO_AHCI <- New add.
depends on ATA <- New add.
bool "IDE to AHCI support" <- New add.
default n <- New add.
help <- New add.
Handle AHCI controller as ATA controller when POST. <- New add.
config AHCI
depends on DRIVES
bool "AHCI controllers"
default n
help
Support for AHCI disk code.
In 'seabios\src\ata.c':
static void
ata_init(void)
{
// Scan PCI bus for ATA adapters
int count=0, pcicount=0;
int bdf, max;
foreachpci(bdf, max) {
pcicount++;
if (pci_config_readw(bdf, PCI_CLASS_DEVICE) != PCI_CLASS_STORAGE_IDE)
if ((! CONFIG_IDE_TO_AHCI) || (pci_config_readw(bdf, PCI_CLASS_DEVICE) != 0x0106)) <- New add.
continue;
u8 pciirq = pci_config_readb(bdf, PCI_INTERRUPT_LINE);
u8 prog_if = pci_config_readb(bdf, PCI_CLASS_PROG);
if (CONFIG_IDE_TO_AHCI && (pci_config_readw(bdf, PCI_CLASS_DEVICE) == 0x0106)) <- New add.
prog_if = 0x8F; <- New add.
int master = 0;
Alex Chuang wrote:
]Hi, ] ]I add one config IDE_TO_AHCI in seabios\src\Kconfig and modify ]seabios\src\ata.c. Please help me to review and check-in. ] ]This IDE_TO_AHCI function can let SeaBIOS handle AHCI controller as IDE ]controller when ATA enable, and also let Windows OS to load AHCI inbox ]driver or chipset venders AHCI driver. In other words, it means that SATA ]Hard Disk ran as IDE mode in SeaBIOS but AHCI mode in Windows OS.
Hello Alex,
Thanks for this contribution. Also thanks for explaining IDE_TO_AHCI. I have seen it in BIOS setup before, but without explanation.
Before diving into the details of this change, what benefit can be expected from using it? I assume its purpose is to gain the benefits of OS use of AHCI interface while avoiding the need for an AHCI option ROM. Avoiding option ROMs is certainly a good thing. But why not use AHCI mode for both SeaBIOS and OS? SeaBIOS AHCI support works on AMD hardware when this patch is used: http://comments.gmane.org/gmane.comp.bios.coreboot.seabios/1663
] if ((! CONFIG_IDE_TO_AHCI) || (pci_config_readw(bdf, PCI_CLASS_DEVICE) ]!= 0x0106)) <- New add.
You could improve readability by replacing 0x0106 with PCI_CLASS_STORAGE_SATA.
Thanks, Scott
Hi Scott,
Yes, the purpose is to gain the benefits of OS use of AHCI interface. And I met the same problem when I enabled the config AHCI. I will try to add your AHCI patch code in my side, but please kindly send the final ahci.c to me.
Best regards, Alex
-----Original Message----- From: Scott Duplichan [mailto:scott@notabs.org] Sent: Friday, May 27, 2011 2:44 PM To: Chuang, Alex; seabios@seabios.org Subject: RE: [SeaBIOS] [coreboot] Add IDE_TO_AHCI config
Alex Chuang wrote:
]Hi, ] ]I add one config 'IDE_TO_AHCI' in 'seabios\src\Kconfig' and modify ]'seabios\src\ata.c'. Please help me to review and check-in. ] ]This 'IDE_TO_AHCI' function can let SeaBIOS handle AHCI controller as IDE ]controller when 'ATA' enable, and also let Windows OS to load AHCI inbox ]driver or chipset vender's AHCI driver. In other words, it means that SATA ]Hard Disk ran as IDE mode in SeaBIOS but AHCI mode in Windows OS.
Hello Alex,
Thanks for this contribution. Also thanks for explaining IDE_TO_AHCI. I have seen it in BIOS setup before, but without explanation.
Before diving into the details of this change, what benefit can be expected from using it? I assume its purpose is to gain the benefits of OS use of AHCI interface while avoiding the need for an AHCI option ROM. Avoiding option ROMs is certainly a good thing. But why not use AHCI mode for both SeaBIOS and OS? SeaBIOS AHCI support works on AMD hardware when this patch is used: http://comments.gmane.org/gmane.comp.bios.coreboot.seabios/1663
] if ((! CONFIG_IDE_TO_AHCI) || (pci_config_readw(bdf, PCI_CLASS_DEVICE) ]!= 0x0106)) <- New add.
You could improve readability by replacing 0x0106 with PCI_CLASS_STORAGE_SATA.
Thanks, Scott
Hi,
Attach my modified files that are used "git format-patch" format.
Best regards, Alex
-----Original Message----- From: Chuang, Alex Sent: Friday, May 27, 2011 5:08 PM To: 'Scott Duplichan'; seabios@seabios.org Subject: RE: [SeaBIOS] [coreboot] Add IDE_TO_AHCI config
Hi Scott,
Yes, the purpose is to gain the benefits of OS use of AHCI interface. And I met the same problem when I enabled the config AHCI. I will try to add your AHCI patch code in my side, but please kindly send the final ahci.c to me.
Best regards, Alex
-----Original Message----- From: Scott Duplichan [mailto:scott@notabs.org] Sent: Friday, May 27, 2011 2:44 PM To: Chuang, Alex; seabios@seabios.org Subject: RE: [SeaBIOS] [coreboot] Add IDE_TO_AHCI config
Alex Chuang wrote:
]Hi, ] ]I add one config 'IDE_TO_AHCI' in 'seabios\src\Kconfig' and modify ]'seabios\src\ata.c'. Please help me to review and check-in. ] ]This 'IDE_TO_AHCI' function can let SeaBIOS handle AHCI controller as IDE ]controller when 'ATA' enable, and also let Windows OS to load AHCI inbox ]driver or chipset vender's AHCI driver. In other words, it means that SATA ]Hard Disk ran as IDE mode in SeaBIOS but AHCI mode in Windows OS.
Hello Alex,
Thanks for this contribution. Also thanks for explaining IDE_TO_AHCI. I have seen it in BIOS setup before, but without explanation.
Before diving into the details of this change, what benefit can be expected from using it? I assume its purpose is to gain the benefits of OS use of AHCI interface while avoiding the need for an AHCI option ROM. Avoiding option ROMs is certainly a good thing. But why not use AHCI mode for both SeaBIOS and OS? SeaBIOS AHCI support works on AMD hardware when this patch is used: http://comments.gmane.org/gmane.comp.bios.coreboot.seabios/1663
] if ((! CONFIG_IDE_TO_AHCI) || (pci_config_readw(bdf, PCI_CLASS_DEVICE) ]!= 0x0106)) <- New add.
You could improve readability by replacing 0x0106 with PCI_CLASS_STORAGE_SATA.
Thanks, Scott
Alex Chuang wrote:
]Hi, ] ]Attach my modified files that are used "git format-patch" format. ] ]Best regards, ]Alex
Hello Alex,
I tested this patch on AMD Persimmon. In SeaBIOS, I enabled your new IDE_TO_AHCI option, enabled ATA and ATA DMA, and disabled AHCI.
In coreboot, I hid the IDE controller at device 14h function 1 and enabled the SATA AHCI/IDE controller at device 11h function 0.
Windows 7 installs and device manager reports device 11h function 0 as "Standard AHCI 1.0 Serial ATA Controller". This show that the feature is working as intended.
Thanks, Scott