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 c896 support. If the first mem bar is 64bit...



details:   https://anonhg.NetBSD.org/src/rev/bb6e09681a73
branches:  trunk
changeset: 499772:bb6e09681a73
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Nov 29 02:00:38 2000 +0000

description:
Fix c896 support.  If the first mem bar is 64bit, then the second one will
be too.  And offset for the 2nd being after the 1st by a 64-bit bar, not
32-bit.

diffstat:

 sys/dev/pci/siop_pci_common.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 320c954faec7 -r bb6e09681a73 sys/dev/pci/siop_pci_common.c
--- a/sys/dev/pci/siop_pci_common.c     Tue Nov 28 23:19:50 2000 +0000
+++ b/sys/dev/pci/siop_pci_common.c     Wed Nov 29 02:00:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siop_pci_common.c,v 1.3 2000/10/23 14:57:23 bouyer Exp $       */
+/*     $NetBSD: siop_pci_common.c,v 1.4 2000/11/29 02:00:38 matt Exp $ */
 
 /*
  * Copyright (c) 2000 Manuel Bouyer.
@@ -242,8 +242,16 @@
        }
 
        if (sc->siop.features & SF_CHIP_RAM) {
-               if (pci_mapreg_map(pa, 0x18,
-                   PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
+               int bar;
+               switch (memtype) {
+               case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
+                       bar = 0x18;
+                       break;
+               case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
+                       bar = 0x1c;
+                       break;
+               }
+               if (pci_mapreg_map(pa, bar, memtype, 0,
                     &sc->siop.sc_ramt, &sc->siop.sc_ramh,
                    &sc->siop.sc_scriptaddr, NULL) == 0) {
                        printf("%s: using on-board RAM\n",



Home | Main Index | Thread Index | Old Index