Module Name:    src
Committed By:   martin
Date:           Wed Oct 23 18:09:18 UTC 2019

Modified Files:
        src/sys/dev/pci [netbsd-9]: ahcisata_pci.c

Log Message:
Pull up following revision(s) (requested by tnn in ticket #358):

        sys/dev/pci/ahcisata_pci.c: revision 1.56

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.55.4.1 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.55.4.1
--- src/sys/dev/pci/ahcisata_pci.c:1.55	Sun Jan 27 02:08:42 2019
+++ src/sys/dev/pci/ahcisata_pci.c	Wed Oct 23 18:09:18 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.55.4.1 2019/10/23 18:09:18 martin 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.55.4.1 2019/10/23 18:09:18 martin 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))

Reply via email to