Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sandpoint QNAP support (untested): PCI fixup and co...



details:   https://anonhg.NetBSD.org/src/rev/89f2fbff963d
branches:  trunk
changeset: 755226:89f2fbff963d
user:      phx <phx%NetBSD.org@localhost>
date:      Fri May 28 15:45:11 2010 +0000

description:
QNAP support (untested): PCI fixup and corrected PCI address lines (+1).
Patch submitted by Toru Nishimura.

diffstat:

 sys/arch/sandpoint/README.NAS               |   4 +-
 sys/arch/sandpoint/pci/pci_machdep.c        |   8 ++--
 sys/arch/sandpoint/stand/netboot/brdsetup.c |  42 +++++++++++++++++++++++++---
 3 files changed, 43 insertions(+), 11 deletions(-)

diffs (133 lines):

diff -r 5cfc3f929c21 -r 89f2fbff963d sys/arch/sandpoint/README.NAS
--- a/sys/arch/sandpoint/README.NAS     Fri May 28 13:25:54 2010 +0000
+++ b/sys/arch/sandpoint/README.NAS     Fri May 28 15:45:11 2010 +0000
@@ -1,4 +1,4 @@
-$NetBSD: README.NAS,v 1.6 2010/05/27 15:35:46 phx Exp $
+$NetBSD: README.NAS,v 1.7 2010/05/28 15:45:11 phx Exp $
 
 //// MPC8241/8245 NAS products ////
 
@@ -23,7 +23,7 @@
                PCI IDSEL          EPIC IRQ
 Kurobox                11, 12, 13, 14  -> 0, 1, 4, 3
 Synology       12, 13, 14, 15  -> 4, 0, 1, 2
-QNAP           12, 13, 14, 15  -> 0, 1, 2, 3
+QNAP           13, 14, 15, 16  -> 0, 1, 2, 3
 StorCenter     12, 13, 14, 15  -> 0, 1, 2, 3
 
 - USB EHCI is a multiple function PCI device which has
diff -r 5cfc3f929c21 -r 89f2fbff963d sys/arch/sandpoint/pci/pci_machdep.c
--- a/sys/arch/sandpoint/pci/pci_machdep.c      Fri May 28 13:25:54 2010 +0000
+++ b/sys/arch/sandpoint/pci/pci_machdep.c      Fri May 28 15:45:11 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.18 2010/05/27 14:54:42 phx Exp $     */
+/*     $NetBSD: pci_machdep.c,v 1.19 2010/05/28 15:45:11 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.18 2010/05/27 14:54:42 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.19 2010/05/28 15:45:11 phx Exp $");
 
 #include "opt_pci.h"
 
@@ -322,8 +322,8 @@
                *ihp = (line == 13) ? 4 : line - 11;
                break;
        case BRD_QNAPTS101:
-               /* map line 12-15 to EPIC IRQ0-3 */
-               *ihp = line - 12;
+               /* map line 13-16 to EPIC IRQ0-3 */
+               *ihp = line - 13;
                break;
        case BRD_SYNOLOGY:
                /* map line 12,13-15 to EPIC IRQ4,0-2 */
diff -r 5cfc3f929c21 -r 89f2fbff963d sys/arch/sandpoint/stand/netboot/brdsetup.c
--- a/sys/arch/sandpoint/stand/netboot/brdsetup.c       Fri May 28 13:25:54 2010 +0000
+++ b/sys/arch/sandpoint/stand/netboot/brdsetup.c       Fri May 28 15:45:11 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.19 2010/05/20 20:18:51 phx Exp $ */
+/* $NetBSD: brdsetup.c,v 1.20 2010/05/28 15:45:11 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -45,10 +45,11 @@
     void xxx ## pcifix(struct brdprop *); \
     void xxx ## reset(void)
 
+BRD_DECL(mot);
 BRD_DECL(enc);
-BRD_DECL(mot);
 BRD_DECL(kuro);
 BRD_DECL(syno);
+BRD_DECL(qnap);
 
 static struct brdprop brdlist[] = {
     {
@@ -57,14 +58,14 @@
        BRD_SANDPOINTX3,
        0,
        "com", 0x3f8, 115200,
-       motsetup, NULL, motpcifix },
+       motsetup, motbrdfix, motpcifix },
     {
        "encpp1",
        "EnCore PP1",
        BRD_ENCOREPP1,
        0,
        "com", 0x3f8, 115200,
-       encsetup, NULL, encpcifix },
+       encsetup, encbrdfix, encpcifix },
     {
        "kurobox",
        "KuroBox",
@@ -86,7 +87,7 @@
        BRD_QNAPTS101,
        0,
        "eumb", 0x4500, 115200,
-       NULL, NULL, NULL },
+       NULL, NULL, qnappcifix },
     {
        "iomega",
        "IOMEGA Storcenter",
@@ -668,6 +669,37 @@
 }
 
 void
+qnappcifix(struct brdprop *brd)
+{
+       unsigned ide, nic, usb, val;
+
+       ide = pcimaketag(0, 13, 0);
+       val = pcicfgread(ide, 0x3c) & 0xffffff00;
+       val |= 13;
+       pcicfgwrite(ide, 0x3c, val);
+
+       usb = pcimaketag(0, 14, 0);
+       val = pcicfgread(usb, 0x3c) & 0xffffff00;
+       val |= 14;
+       pcicfgwrite(usb, 0x3c, val);
+
+       usb = pcimaketag(0, 14, 1);
+       val = pcicfgread(usb, 0x3c) & 0xffffff00;
+       val |= 14;
+       pcicfgwrite(usb, 0x3c, val);
+
+       usb = pcimaketag(0, 14, 2);
+       val = pcicfgread(usb, 0x3c) & 0xffffff00;
+       val |= 14;
+       pcicfgwrite(usb, 0x3c, val);
+
+       nic = pcimaketag(0, 15, 0);
+       val = pcicfgread(nic, 0x3c) & 0xffffff00;
+       val |= 15;
+       pcicfgwrite(nic, 0x3c, val);
+}
+
+void
 synoreset()
 {
 



Home | Main Index | Thread Index | Old Index