Enable SATA ports 5 and 6 on Intel ICH8 and ICH9 based

systems, and possibly enable ports 7 and 8 in the future.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22869 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Marcus Overhagen 2007-11-10 16:25:49 +00:00
parent 65621982c9
commit 8d722116c2

View File

@ -251,9 +251,13 @@ AHCIController::ResetController()
if (fPCIVendorID == PCI_VENDOR_INTEL) {
// Intel PCS—Port Control and Status
// In AHCI enabled systems, bits[3:0] must always be set
gPCI->write_pci_config(fPCIDevice, 0x92, 2,
0xf | gPCI->read_pci_config(fPCIDevice, 0x92, 2));
// SATA port enable bits must be set
int portCount = 1 + ((fRegs->cap >> CAP_NP_SHIFT) & CAP_NP_MASK);
if (portCount > 8)
panic("Intel AHCI: too many SATA ports! Please report at http://dev.haiku-os.org");
uint16 pcs = gPCI->read_pci_config(fPCIDevice, 0x92, 2);
pcs |= (0xff >> (8 - portCount));
gPCI->write_pci_config(fPCIDevice, 0x92, 2, pcs);
}
return B_OK;
}