Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sandpoint/pci add StorCenter heuristic by PCI vendo...



details:   https://anonhg.NetBSD.org/src/rev/5c2e668a0030
branches:  trunk
changeset: 761779:5c2e668a0030
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Mon Feb 07 13:35:21 2011 +0000

description:
add StorCenter heuristic by PCI vendor ID detection.

diffstat:

 sys/arch/sandpoint/pci/pci_machdep.c |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (58 lines):

diff -r d710e2e8c37a -r 5c2e668a0030 sys/arch/sandpoint/pci/pci_machdep.c
--- a/sys/arch/sandpoint/pci/pci_machdep.c      Mon Feb 07 13:11:41 2011 +0000
+++ b/sys/arch/sandpoint/pci/pci_machdep.c      Mon Feb 07 13:35:21 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.20 2010/12/20 00:25:42 matt Exp $    */
+/*     $NetBSD: pci_machdep.c,v 1.21 2011/02/07 13:35:21 nisimura Exp $        */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.20 2010/12/20 00:25:42 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.21 2011/02/07 13:35:21 nisimura Exp $");
 
 #include "opt_pci.h"
 
@@ -94,6 +94,7 @@
 #define BRD_KUROBOX            100
 #define BRD_QNAPTS101          101
 #define BRD_SYNOLOGY           102
+#define BRD_STORCENTER         103
 #define BRD_UNKNOWN            -1
 
 #define        PCI_CONFIG_ENABLE       0x80000000UL
@@ -103,7 +104,7 @@
     struct pcibus_attach_args *pba)
 {
        pcitag_t tag;
-       pcireg_t dev11, dev22, dev15;
+       pcireg_t dev11, dev22, dev15, dev13;
 
        tag = pci_make_tag(pba->pba_pc, pba->pba_bus, 11, 0);
        dev11 = pci_conf_read(pba->pba_pc, tag, PCI_CLASS_REG);
@@ -142,6 +143,14 @@
                brdtype = BRD_SYNOLOGY;
                return;
        }
+       tag = pci_make_tag(pba->pba_pc, pba->pba_bus, 13, 0);
+       dev13 = pci_conf_read(pba->pba_pc, tag, PCI_ID_REG);
+       if (PCI_VENDOR(dev13) == PCI_VENDOR_VIATECH) {
+               /* VIA 6410 PCIIDE at dev 13 */
+               brdtype = BRD_STORCENTER;
+               return;
+       }
+       
        brdtype = BRD_UNKNOWN;
 }
 
@@ -327,6 +336,7 @@
                /* map line 12,13-15 to EPIC IRQ4,0-2 */
                *ihp = (line == 12) ? 4 : line - 13;
                break;
+       case BRD_STORCENTER:
        default:
                /* map line 12-15 to EPIC IRQ0-3 */
                *ihp = line - 12;



Home | Main Index | Thread Index | Old Index