Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Fix a bug that PCI bridge's prefetchable memory ...



details:   https://anonhg.NetBSD.org/src/rev/08ec9430294e
branches:  trunk
changeset: 448295:08ec9430294e
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Jan 29 05:09:35 2019 +0000

description:
Fix a bug that PCI bridge's prefetchable memory area's configuration
didn't work correctly in pciconf.c::configure_bridge(). Note that this function
is only for "options PCI_NETBSD_CONFIGURE" machines.

diffstat:

 sys/dev/pci/pciconf.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (46 lines):

diff -r ca7c4006f64a -r 08ec9430294e sys/dev/pci/pciconf.c
--- a/sys/dev/pci/pciconf.c     Tue Jan 29 04:54:42 2019 +0000
+++ b/sys/dev/pci/pciconf.c     Tue Jan 29 05:09:35 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciconf.c,v 1.37 2014/09/05 05:29:16 matt Exp $        */
+/*     $NetBSD: pciconf.c,v 1.38 2019/01/29 05:09:35 msaitoh Exp $     */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.37 2014/09/05 05:29:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.38 2019/01/29 05:09:35 msaitoh Exp $");
 
 #include "opt_pci.h"
 
@@ -855,6 +855,7 @@
        pciconf_bus_t   *pb;
        pcireg_t        io, iohigh, mem, cmd;
        int             rv;
+       bool            isprefetchmem64;
 
        pb = pd->ppb;
        /* Configure I/O base & limit*/
@@ -919,8 +920,9 @@
                mem_limit = 0x000000;
        }
        mem = pci_conf_read(pb->pc, pd->tag, PCI_BRIDGE_PREFETCHMEM_REG);
+       isprefetchmem64 = PCI_BRIDGE_PREFETCHMEM_64BITS(mem);
 #if ULONG_MAX > 0xffffffff
-       if (!PCI_BRIDGE_PREFETCHMEM_64BITS(mem) && mem_limit > 0xFFFFFFFFULL) {
+       if (!isprefetchmem64 && mem_limit > 0xFFFFFFFFULL) {
                printf("Bus %d bridge does not support 64-bit PMEM.  ",
                    pb->busno);
                printf("Disabling prefetchable-MEM accesses\n");
@@ -936,7 +938,7 @@
        /*
         * XXX -- 64-bit systems need a lot more than just this...
         */
-       if (PCI_BRIDGE_PREFETCHMEM_64BITS(mem)) {
+       if (isprefetchmem64) {
                mem_base  = (uint64_t) mem_base  >> 32;
                mem_limit = (uint64_t) mem_limit >> 32;
                pci_conf_write(pb->pc, pd->tag, PCI_BRIDGE_PREFETCHBASE32_REG,



Home | Main Index | Thread Index | Old Index