Module Name: src Committed By: tnn Date: Fri Oct 18 17:16:50 UTC 2019
Modified Files: src/sys/dev/pci: ahcisata_pci.c Log Message: ahcisata: make sure bus mastering and memory space are actually enabled This makes the "ROCKPro64 PCI-e to Dual SATA-II Interface Card" work. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pci/ahcisata_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ahcisata_pci.c diff -u src/sys/dev/pci/ahcisata_pci.c:1.55 src/sys/dev/pci/ahcisata_pci.c:1.56 --- src/sys/dev/pci/ahcisata_pci.c:1.55 Sun Jan 27 02:08:42 2019 +++ src/sys/dev/pci/ahcisata_pci.c Fri Oct 18 17:16:50 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ahcisata_pci.c,v 1.55 2019/01/27 02:08:42 pgoyette Exp $ */ +/* $NetBSD: ahcisata_pci.c,v 1.56 2019/10/18 17:16:50 tnn Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.55 2019/01/27 02:08:42 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.56 2019/10/18 17:16:50 tnn Exp $"); #ifdef _KERNEL_OPT #include "opt_ahcisata_pci.h" @@ -394,6 +394,7 @@ ahci_pci_attach(device_t parent, device_ struct ahci_softc *sc = &psc->ah_sc; bool ahci_cap_64bit; bool ahci_bad_64bit; + pcireg_t reg; sc->sc_atac.atac_dev = self; @@ -447,6 +448,10 @@ ahci_pci_attach(device_t parent, device_ AHCIDEBUG_PRINT(("%s: SATA mode\n", AHCINAME(sc)), DEBUG_PROBE); } + reg = pci_conf_read(psc->sc_pc, psc->sc_pcitag, PCI_COMMAND_STATUS_REG); + reg |= (PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE); + pci_conf_write(psc->sc_pc, psc->sc_pcitag, PCI_COMMAND_STATUS_REG, reg); + ahci_attach(sc); if (!pmf_device_register(self, NULL, ahci_pci_resume))