CVS commit: src/sys/arch/sandpoint/pci
Module Name:src Committed By: rin Date: Wed Mar 17 14:58:16 UTC 2021 Modified Files: src/sys/arch/sandpoint/pci: pciide_machdep.c Log Message: Make this distinguishable with native PCI interrupt. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/pci/pciide_machdep.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/arch/sandpoint/pci/pciide_machdep.c diff -u src/sys/arch/sandpoint/pci/pciide_machdep.c:1.6 src/sys/arch/sandpoint/pci/pciide_machdep.c:1.7 --- src/sys/arch/sandpoint/pci/pciide_machdep.c:1.6 Wed Mar 17 14:50:11 2021 +++ src/sys/arch/sandpoint/pci/pciide_machdep.c Wed Mar 17 14:58:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_machdep.c,v 1.6 2021/03/17 14:50:11 rin Exp $ */ +/* $NetBSD: pciide_machdep.c,v 1.7 2021/03/17 14:58:16 rin Exp $ */ /* * Copyright (c) 1998 Christopher G. Demetriou. All rights reserved. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.6 2021/03/17 14:50:11 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.7 2021/03/17 14:58:16 rin Exp $"); #include #include @@ -63,10 +63,12 @@ pciide_machdep_compat_intr_establish(dev #if NISA > 0 int irq; void *cookie; + char intr_xname[INTRDEVNAMEBUF]; irq = PCIIDE_COMPAT_IRQ(chan); + snprintf(intr_xname, sizeof(intr_xname), "%s isa", device_xname(dev)); cookie = isa_intr_establish_xname(NULL, irq, IST_LEVEL, IPL_BIO, func, - arg, device_xname(dev)); + arg, intr_xname); if (cookie == NULL) return (NULL); aprint_normal_dev(dev, "%s channel interrupting at irq %d\n",
CVS commit: src/sys/arch/sandpoint/pci
Module Name:src Committed By: nonaka Date: Sat Nov 26 15:03:23 UTC 2016 Modified Files: src/sys/arch/sandpoint/pci: pci_machdep.c Log Message: PCI MSI/MSI-X manipulation stub functions are not provided as weak alias. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sandpoint/pci/pci_machdep.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/arch/sandpoint/pci/pci_machdep.c diff -u src/sys/arch/sandpoint/pci/pci_machdep.c:1.35 src/sys/arch/sandpoint/pci/pci_machdep.c:1.36 --- src/sys/arch/sandpoint/pci/pci_machdep.c:1.35 Wed Oct 19 00:08:42 2016 +++ src/sys/arch/sandpoint/pci/pci_machdep.c Sat Nov 26 15:03:23 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.35 2016/10/19 00:08:42 nonaka Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.36 2016/11/26 15:03:23 nonaka Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.35 2016/10/19 00:08:42 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.36 2016/11/26 15:03:23 nonaka Exp $"); #include "opt_pci.h" @@ -497,6 +497,31 @@ pci_conf_interrupt(pci_chipset_tag_t pc, } #endif +pci_intr_type_t +pci_intr_type(pci_chipset_tag_t pc, pci_intr_handle_t ih) +{ + + return PCI_INTR_TYPE_INTX; +} + +int +pci_intr_alloc(const struct pci_attach_args *pa, pci_intr_handle_t **ihps, +int *counts, pci_intr_type_t max_type) +{ + + if (counts != NULL && counts[PCI_INTR_TYPE_INTX] == 0) + return EINVAL; + + return pci_intx_alloc(pa, ihps); +} + +void +pci_intr_release(pci_chipset_tag_t pc, pci_intr_handle_t *pih, int count) +{ + + kmem_free(pih, sizeof(*pih)); +} + int pci_intx_alloc(const struct pci_attach_args *pa, pci_intr_handle_t **ihpp) {
CVS commit: src/sys/arch/sandpoint/pci
Module Name:src Committed By: phx Date: Sat Apr 30 11:12:59 UTC 2011 Modified Files: src/sys/arch/sandpoint/pci: pci_machdep.c Log Message: Detect QNAP board last, because a Realtek chip at pci device 15 is used on several boards. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/sandpoint/pci/pci_machdep.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/arch/sandpoint/pci/pci_machdep.c diff -u src/sys/arch/sandpoint/pci/pci_machdep.c:1.26 src/sys/arch/sandpoint/pci/pci_machdep.c:1.27 --- src/sys/arch/sandpoint/pci/pci_machdep.c:1.26 Mon Apr 4 20:37:53 2011 +++ src/sys/arch/sandpoint/pci/pci_machdep.c Sat Apr 30 11:12:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.26 2011/04/04 20:37:53 dyoung Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.27 2011/04/30 11:12:58 phx 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.26 2011/04/04 20:37:53 dyoung Exp $); +__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.27 2011/04/30 11:12:58 phx Exp $); #include opt_pci.h @@ -135,12 +135,6 @@ } tag = pci_make_tag(pba-pba_pc, pba-pba_bus, 15, 0); dev15 = pci_conf_read(pba-pba_pc, tag, PCI_ID_REG); - if (PCI_VENDOR(dev15) == PCI_VENDOR_INTEL - || PCI_VENDOR(dev15) == PCI_VENDOR_REALTEK) { - /* Intel or Realtek GbE at dev 15 */ - brdtype = BRD_QNAPTS; - return; - } if (PCI_VENDOR(dev15) == PCI_VENDOR_MARVELL) { /* Marvell GbE at dev 15 */ brdtype = BRD_SYNOLOGY; @@ -165,6 +159,12 @@ brdtype = BRD_NH230NAS; return; } + if (PCI_VENDOR(dev15) == PCI_VENDOR_INTEL + || PCI_VENDOR(dev15) == PCI_VENDOR_REALTEK) { + /* Intel or Realtek GbE at dev 15 */ + brdtype = BRD_QNAPTS; + return; + } brdtype = BRD_UNKNOWN; }
CVS commit: src/sys/arch/sandpoint/pci
Module Name:src Committed By: phx Date: Sat Mar 26 22:20:04 UTC 2011 Modified Files: src/sys/arch/sandpoint/pci: pci_machdep.c Log Message: Recognize QNAP V200 board, used in the TS-201 and newer TS-101 models. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sandpoint/pci/pci_machdep.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/arch/sandpoint/pci/pci_machdep.c diff -u src/sys/arch/sandpoint/pci/pci_machdep.c:1.24 src/sys/arch/sandpoint/pci/pci_machdep.c:1.25 --- src/sys/arch/sandpoint/pci/pci_machdep.c:1.24 Sat Mar 19 19:54:02 2011 +++ src/sys/arch/sandpoint/pci/pci_machdep.c Sat Mar 26 22:20:04 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.24 2011/03/19 19:54:02 phx Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.25 2011/03/26 22:20:04 phx 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.24 2011/03/19 19:54:02 phx Exp $); +__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.25 2011/03/26 22:20:04 phx Exp $); #include opt_pci.h @@ -92,7 +92,7 @@ #define BRD_SANDPOINTX3 3 #define BRD_ENCOREPP1 10 #define BRD_KUROBOX 100 -#define BRD_QNAPTS101 101 +#define BRD_QNAPTS 101 #define BRD_SYNOLOGY 102 #define BRD_STORCENTER 103 #define BRD_DLINKDSM 104 @@ -135,9 +135,10 @@ } tag = pci_make_tag(pba-pba_pc, pba-pba_bus, 15, 0); dev15 = pci_conf_read(pba-pba_pc, tag, PCI_ID_REG); - if (PCI_VENDOR(dev15) == PCI_VENDOR_INTEL) { - /* Intel GbE at dev 15 */ - brdtype = BRD_QNAPTS101; + if (PCI_VENDOR(dev15) == PCI_VENDOR_INTEL + || PCI_VENDOR(dev15) == PCI_VENDOR_REALTEK) { + /* Intel or Realtek GbE at dev 15 */ + brdtype = BRD_QNAPTS; return; } if (PCI_VENDOR(dev15) == PCI_VENDOR_MARVELL) { @@ -342,7 +343,7 @@ /* map line 11,12,13,14 to EPIC IRQ0,1,4,3 */ *ihp = (line == 13) ? 4 : line - 11; break; - case BRD_QNAPTS101: + case BRD_QNAPTS: /* map line 13-16 to EPIC IRQ0-3 */ *ihp = line - 13; break;
CVS commit: src/sys/arch/sandpoint/pci
Module Name:src Committed By: phx Date: Sat Mar 19 19:54:03 UTC 2011 Modified Files: src/sys/arch/sandpoint/pci: pci_machdep.c Log Message: DLink DSM-G600 IDSEL-14 (USB) needs special handling: Pin A is mapped to EPIC-IRQ 1, but Pin C must be mapped to IRQ 2. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sandpoint/pci/pci_machdep.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/arch/sandpoint/pci/pci_machdep.c diff -u src/sys/arch/sandpoint/pci/pci_machdep.c:1.23 src/sys/arch/sandpoint/pci/pci_machdep.c:1.24 --- src/sys/arch/sandpoint/pci/pci_machdep.c:1.23 Mon Feb 14 09:00:04 2011 +++ src/sys/arch/sandpoint/pci/pci_machdep.c Sat Mar 19 19:54:02 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.23 2011/02/14 09:00:04 nisimura Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.24 2011/03/19 19:54:02 phx 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.23 2011/02/14 09:00:04 nisimura Exp $); +__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.24 2011/03/19 19:54:02 phx Exp $); #include opt_pci.h @@ -353,6 +353,8 @@ case BRD_DLINKDSM: /* map line 13,14,15,16 to EPIC IRQ0,1,3,4 */ *ihp = (line 15) ? line - 13 : line - 12; + if (line == 14 pin == 3) + *ihp += 1; /* USB pin C (EHCI) uses next IRQ */ break; case BRD_NH230NAS: /* map line 13,14,15,16 to EPIC IRQ0,3,1,2 */
CVS commit: src/sys/arch/sandpoint/pci
Module Name:src Committed By: nisimura Date: Mon Feb 14 09:00:04 UTC 2011 Modified Files: src/sys/arch/sandpoint/pci: pci_machdep.c Log Message: add EPIC definition for Netronics NH230/NH231 and the brothers. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/sandpoint/pci/pci_machdep.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/arch/sandpoint/pci/pci_machdep.c diff -u src/sys/arch/sandpoint/pci/pci_machdep.c:1.22 src/sys/arch/sandpoint/pci/pci_machdep.c:1.23 --- src/sys/arch/sandpoint/pci/pci_machdep.c:1.22 Thu Feb 10 13:54:45 2011 +++ src/sys/arch/sandpoint/pci/pci_machdep.c Mon Feb 14 09:00:04 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.22 2011/02/10 13:54:45 nisimura Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.23 2011/02/14 09:00:04 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.22 2011/02/10 13:54:45 nisimura Exp $); +__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.23 2011/02/14 09:00:04 nisimura Exp $); #include opt_pci.h @@ -96,6 +96,7 @@ #define BRD_SYNOLOGY 102 #define BRD_STORCENTER 103 #define BRD_DLINKDSM 104 +#define BRD_NH230NAS 105 #define BRD_UNKNOWN -1 #define PCI_CONFIG_ENABLE 0x8000UL @@ -158,6 +159,11 @@ brdtype = BRD_DLINKDSM; return; } + if (PCI_VENDOR(dev16) == PCI_VENDOR_ITE + || PCI_VENDOR(dev16) == PCI_VENDOR_CMDTECH) { + brdtype = BRD_NH230NAS; + return; + } brdtype = BRD_UNKNOWN; } @@ -348,6 +354,12 @@ /* map line 13,14,15,16 to EPIC IRQ0,1,3,4 */ *ihp = (line 15) ? line - 13 : line - 12; break; + case BRD_NH230NAS: + /* map line 13,14,15,16 to EPIC IRQ0,3,1,2 */ + *ihp = (line == 16) ? 2 : + (line == 15) ? 1 : + (line == 14) ? 3 : 0; + break; case BRD_STORCENTER: default: /* map line 12-15 to EPIC IRQ0-3 */
CVS commit: src/sys/arch/sandpoint/pci
Module Name:src Committed By: nisimura Date: Mon Feb 7 13:35:21 UTC 2011 Modified Files: src/sys/arch/sandpoint/pci: pci_machdep.c Log Message: add StorCenter heuristic by PCI vendor ID detection. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sandpoint/pci/pci_machdep.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/arch/sandpoint/pci/pci_machdep.c diff -u src/sys/arch/sandpoint/pci/pci_machdep.c:1.20 src/sys/arch/sandpoint/pci/pci_machdep.c:1.21 --- src/sys/arch/sandpoint/pci/pci_machdep.c:1.20 Mon Dec 20 00:25:42 2010 +++ src/sys/arch/sandpoint/pci/pci_machdep.c Mon Feb 7 13:35:21 2011 @@ -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 0x8000UL @@ -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;
CVS commit: src/sys/arch/sandpoint/pci
Module Name:src Committed By: phx Date: Thu May 27 14:54:42 UTC 2010 Modified Files: src/sys/arch/sandpoint/pci: pci_machdep.c Log Message: Disable EPIC_DEBUGIRQ. Reenable when needed. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sandpoint/pci/pci_machdep.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/arch/sandpoint/pci/pci_machdep.c diff -u src/sys/arch/sandpoint/pci/pci_machdep.c:1.17 src/sys/arch/sandpoint/pci/pci_machdep.c:1.18 --- src/sys/arch/sandpoint/pci/pci_machdep.c:1.17 Thu Jul 30 05:57:27 2009 +++ src/sys/arch/sandpoint/pci/pci_machdep.c Thu May 27 14:54:42 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.17 2009/07/30 05:57:27 nisimura Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.18 2010/05/27 14:54:42 phx 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.17 2009/07/30 05:57:27 nisimura Exp $); +__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.18 2010/05/27 14:54:42 phx Exp $); #include opt_pci.h @@ -87,7 +87,7 @@ _bus_dmamem_mmap, }; -#define EPIC_DEBUGIRQ +/*#define EPIC_DEBUGIRQ*/ static int brdtype; #define BRD_SANDPOINTX2 2 @@ -241,7 +241,7 @@ goto bad; } #ifdef EPIC_DEBUGIRQ -printf(line %d, pin %c, line, pin + '@'); + printf(line %d, pin %c, line, pin + '@'); #endif switch (brdtype) { /* Sandpoint has 4 PCI slots in a weird order. @@ -335,7 +335,7 @@ break; } #ifdef EPIC_DEBUGIRQ -printf( = EPIC %d\n, *ihp); + printf( = EPIC %d\n, *ihp); #endif return 0; bad: