[SeaBIOS] [coreboot] Add IDE_TO_AHCI config

Chuang, Alex Alex.Chuang at amd.com
Fri May 27 01:01:56 CEST 2011



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


Best regards,




In 'seabios\src\Kconfig':

menu "Hardware support"

    config ATA

        depends on DRIVES

        bool "ATA controllers"

        default y


            Support for IDE disk code.

   config ATA_DMA

        depends on ATA

        bool "ATA DMA"

        default n


            Detect and try to use ATA bus mastering DMA controllers.

    config ATA_PIO32

        depends on ATA

        bool "ATA 32bit PIO"

        default n


            Use 32bit PIO accesses on ATA (minor optimization on PCI

    config IDE_TO_AHCI
<- New add.

        depends on ATA
<- New add.

        bool "IDE to AHCI support"
<- New add.

        default n
<- New add.

<- New add.

            Handle AHCI controller as ATA controller when POST.  <- New

    config AHCI

        depends on DRIVES

        bool "AHCI controllers"

        default n


            Support for AHCI disk code.



In 'seabios\src\ata.c':

static void



    // Scan PCI bus for ATA adapters

    int count=0, pcicount=0;

    int bdf, max;

    foreachpci(bdf, max) {


        if (pci_config_readw(bdf, PCI_CLASS_DEVICE) !=

                        if ((! CONFIG_IDE_TO_AHCI) ||
(pci_config_readw(bdf, PCI_CLASS_DEVICE) != 0x0106))  <- New add.



        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;




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.seabios.org/pipermail/seabios/attachments/20110527/85402af8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ata.c
Type: application/octet-stream
Size: 30580 bytes
Desc: ata.c
URL: <http://www.seabios.org/pipermail/seabios/attachments/20110527/85402af8/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Kconfig
Type: application/octet-stream
Size: 10280 bytes
Desc: Kconfig
URL: <http://www.seabios.org/pipermail/seabios/attachments/20110527/85402af8/attachment-0003.obj>

More information about the SeaBIOS mailing list