Module Name:    src
Committed By:   nisimura
Date:           Tue Feb  8 00:33:05 UTC 2011

Modified Files:
        src/sys/arch/sandpoint/stand/altboot: brdsetup.c globals.h pciide.c

Log Message:
- add preliminary code to support D-Link DSM-G600 rev.B NAS.
- it features 9600bps console, Moto MCU on the 2nd DUART channel,
  ACARD ATP865 PCIIDE and IP Plus IP1000A GbE.  It has MiniPCI
  slot.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/stand/altboot/globals.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sandpoint/stand/altboot/pciide.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/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.2 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.3
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.2	Mon Feb  7 12:45:21 2011
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Tue Feb  8 00:33:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.2 2011/02/07 12:45:21 nisimura Exp $ */
+/* $NetBSD: brdsetup.c,v 1.3 2011/02/08 00:33:05 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -53,6 +53,7 @@
 BRD_DECL(syno);
 BRD_DECL(qnap);
 BRD_DECL(iomega);
+BRD_DECL(dlink);
 
 static struct brdprop brdlist[] = {
     {
@@ -99,6 +100,13 @@
 	"eumb", 0x4500, 115200,
 	NULL, iomegabrdfix, iomegapcifix },
     {
+	"dlink",
+	"D-Link GSM-G600",
+	BRD_DLINKGSM,
+	0,
+	"eumb", 0x4500, 9600,
+	NULL, dlinkbrdfix, dlinkpcifix },
+    {
 	"unknown",
 	"Unknown board",
 	BRD_UNKNOWN,
@@ -205,6 +213,10 @@
 	    0x1106) {				/* PCI_VENDOR_VIA */
 		brdtype = BRD_STORCENTER;
 	}
+	else if (PCI_VENDOR(pcicfgread(pcimaketag(0, 16, 0), PCI_ID_REG)) ==
+	    0x1191) {				/* PCI_VENDOR_ACARD */
+		brdtype = BRD_DLINKGSM;
+	}
 
 	brdprop = brd_lookup(brdtype);
 
@@ -771,6 +783,44 @@
 }
 
 void
+dlinkbrdfix(struct brdprop *brd)
+{
+
+	init_uart(uart2base, 9600, LCR_8BITS | LCR_PNONE);
+}
+
+void
+dlinkpcifix(struct brdprop *brd)
+{
+	unsigned usb, nic, ide, 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);
+
+	ide = pcimaketag(0, 16, 0);
+	val = pcicfgread(ide, 0x3c) & 0xffffff00;
+	val |= 16;
+	pcicfgwrite(ide, 0x3c, val);
+}
+
+void
 _rtt(void)
 {
 

Index: src/sys/arch/sandpoint/stand/altboot/globals.h
diff -u src/sys/arch/sandpoint/stand/altboot/globals.h:1.3 src/sys/arch/sandpoint/stand/altboot/globals.h:1.4
--- src/sys/arch/sandpoint/stand/altboot/globals.h:1.3	Thu Jan 27 17:38:04 2011
+++ src/sys/arch/sandpoint/stand/altboot/globals.h	Tue Feb  8 00:33:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: globals.h,v 1.3 2011/01/27 17:38:04 phx Exp $ */
+/* $NetBSD: globals.h,v 1.4 2011/02/08 00:33:05 nisimura Exp $ */
 
 #ifdef DEBUG
 #define	DPRINTF(x)	printf x
@@ -20,6 +20,7 @@
 #define BRD_QNAPTS101		101
 #define BRD_SYNOLOGY		102
 #define BRD_STORCENTER		103
+#define BRD_DLINKGSM		104
 #define BRD_UNKNOWN		-1
 
 struct brdprop {

Index: src/sys/arch/sandpoint/stand/altboot/pciide.c
diff -u src/sys/arch/sandpoint/stand/altboot/pciide.c:1.1 src/sys/arch/sandpoint/stand/altboot/pciide.c:1.2
--- src/sys/arch/sandpoint/stand/altboot/pciide.c:1.1	Sun Jan 23 01:05:30 2011
+++ src/sys/arch/sandpoint/stand/altboot/pciide.c	Tue Feb  8 00:33:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pciide.c,v 1.1 2011/01/23 01:05:30 nisimura Exp $ */
+/* $NetBSD: pciide.c,v 1.2 2011/02/08 00:33:05 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 };
 static int cmdidefix(struct dkdev_ata *);
 static struct myops cmdideops = { cmdidefix, NULL };
-static struct myops *myops = &cmdideops;
+static struct myops *myops;
 
 int pciide_match(unsigned, void *);
 void *pciide_init(unsigned, void *);
@@ -56,10 +56,13 @@
 	v = pcicfgread(tag, PCI_ID_REG);
 	switch (v) {
 	case PCI_DEVICE(0x1095, 0x0680): /* SiI 0680 IDE */
+		myops = &cmdideops;
+		return 1;
 	case PCI_DEVICE(0x1283, 0x8211): /* ITE 8211 IDE */
 	case PCI_DEVICE(0x1106, 0x1571): /* VIA 82C586 IDE */
 	case PCI_DEVICE(0x10ad, 0x0105): /* Symphony Labs 82C105 IDE */
 	case PCI_DEVICE(0x10b8, 0x5229): /* ALi IDE */
+	case PCI_DEVICE(0x1191, 0x0008): /* ACARD ATP865 */
 		return 1;
 	}
 	return 0;

Reply via email to