[SeaBIOS] [PATCH] Ignore AHCI NPORTS

Kevin O'Connor kevin at koconnor.net
Tue Mar 11 15:55:03 CET 2014


On Tue, Mar 04, 2014 at 12:35:00AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On Easynote LM85 under both coreboot and vendor BIOS NPORTS is 3, yet
> port 4 is used for CD-ROM. NPORTS is RO on this chipset and has same
> value on vendor BIOS as well, so it's not a coreboot bug.
> Linux does essentially the same, by increasing nports variable if bits
> in PI are set above nports-1. GRUB ignores PI since this problem was
> detected.
> 
> diff --git a/src/hw/ahci.c b/src/hw/ahci.c
> index ff5d5f9..3193d81 100644
> --- a/src/hw/ahci.c
> +++ b/src/hw/ahci.c
> @@ -601,7 +601,7 @@ ahci_controller_setup(struct pci_device *pci)
>      dprintf(2, "AHCI: cap 0x%x, ports_impl 0x%x\n",
>              ctrl->caps, ctrl->ports);
> 
> -    max = ctrl->caps & 0x1f;
> +    max = 0x1f;
>      for (pnr = 0; pnr <= max; pnr++) {
>          if (!(ctrl->ports & (1 << pnr)))
>              continue;

Gerd, any thoughts on this?

-Kevin



More information about the SeaBIOS mailing list