Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci ahcisata: make sure bus mastering and memory spa...



details:   https://anonhg.NetBSD.org/src/rev/89b05e57f8cb
branches:  trunk
changeset: 966216:89b05e57f8cb
user:      tnn <tnn%NetBSD.org@localhost>
date:      Fri Oct 18 17:16:50 2019 +0000

description:
ahcisata: make sure bus mastering and memory space are actually enabled

This makes the "ROCKPro64 PCI-e to Dual SATA-II Interface Card" work.

diffstat:

 sys/dev/pci/ahcisata_pci.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r eb5a25fc0749 -r 89b05e57f8cb sys/dev/pci/ahcisata_pci.c
--- a/sys/dev/pci/ahcisata_pci.c        Fri Oct 18 16:26:38 2019 +0000
+++ b/sys/dev/pci/ahcisata_pci.c        Fri Oct 18 17:16:50 2019 +0000
@@ -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 @@
        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 @@
                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))



Home | Main Index | Thread Index | Old Index