diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-03-04 12:01:47 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-03-04 12:01:47 +0000 |
commit | 25a690cf834273e5fc802686267d49c6a06ea9f9 (patch) | |
tree | 2332677f9c6449755ff089fbe2709b40b840c89c /sys/dev | |
parent | c3400f7c472f8252c33e04b61da019adc3c01da3 (diff) |
HBAs by JMICRON have an additional "Controller Control Register" that
must be programmed to switch the ports into AHCI mode. Do so.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/ahci.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c index dcdbf73e6bd..abf3f532a1f 100644 --- a/sys/dev/pci/ahci.c +++ b/sys/dev/pci/ahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci.c,v 1.50 2007/03/04 05:06:28 dlg Exp $ */ +/* $OpenBSD: ahci.c,v 1.51 2007/03/04 12:01:46 pascoe Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -419,6 +419,20 @@ ahci_attach(struct device *parent, struct device *self, void *aux) u_int32_t reg; int i; + /* Switch JMICRON ports to AHCI mode */ + if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_JMICRON) { + u_int32_t ccr; + + ccr = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x40); + ccr &= ~0x0000ff00; + ccr |= 0x0000a100; + pci_conf_write(pa->pa_pc, pa->pa_tag, 0x40, ccr); + + /* Only function 0 is SATA */ + if (pa->pa_function != 0) + return; + } + if (ahci_map_regs(sc, pa) != 0) { /* error already printed by ahci_map_regs */ return; |