Module Name:    src
Committed By:   phx
Date:           Fri May 28 15:45:11 UTC 2010

Modified Files:
        src/sys/arch/sandpoint: README.NAS
        src/sys/arch/sandpoint/pci: pci_machdep.c
        src/sys/arch/sandpoint/stand/netboot: brdsetup.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/README.NAS
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sandpoint/pci/pci_machdep.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sandpoint/stand/netboot/brdsetup.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/README.NAS
diff -u src/sys/arch/sandpoint/README.NAS:1.6 src/sys/arch/sandpoint/README.NAS:1.7
--- src/sys/arch/sandpoint/README.NAS:1.6	Thu May 27 15:35:46 2010
+++ src/sys/arch/sandpoint/README.NAS	Fri May 28 15:45:11 2010
@@ -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

Index: src/sys/arch/sandpoint/pci/pci_machdep.c
diff -u src/sys/arch/sandpoint/pci/pci_machdep.c:1.18 src/sys/arch/sandpoint/pci/pci_machdep.c:1.19
--- src/sys/arch/sandpoint/pci/pci_machdep.c:1.18	Thu May 27 14:54:42 2010
+++ src/sys/arch/sandpoint/pci/pci_machdep.c	Fri May 28 15:45:11 2010
@@ -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 */

Index: src/sys/arch/sandpoint/stand/netboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/netboot/brdsetup.c:1.19 src/sys/arch/sandpoint/stand/netboot/brdsetup.c:1.20
--- src/sys/arch/sandpoint/stand/netboot/brdsetup.c:1.19	Thu May 20 20:18:51 2010
+++ src/sys/arch/sandpoint/stand/netboot/brdsetup.c	Fri May 28 15:45:11 2010
@@ -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(enc);
 BRD_DECL(mot);
+BRD_DECL(enc);
 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()
 {
 

Reply via email to