Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sandpoint/stand/altboot - add preliminary code to s...
details: https://anonhg.NetBSD.org/src/rev/ecbf1e1ab1b6
branches: trunk
changeset: 761794:ecbf1e1ab1b6
user: nisimura <nisimura%NetBSD.org@localhost>
date: Tue Feb 08 00:33:05 2011 +0000
description:
- 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.
diffstat:
sys/arch/sandpoint/stand/altboot/brdsetup.c | 52 ++++++++++++++++++++++++++++-
sys/arch/sandpoint/stand/altboot/globals.h | 3 +-
sys/arch/sandpoint/stand/altboot/pciide.c | 7 ++-
3 files changed, 58 insertions(+), 4 deletions(-)
diffs (136 lines):
diff -r 3563b5c7912b -r ecbf1e1ab1b6 sys/arch/sandpoint/stand/altboot/brdsetup.c
--- a/sys/arch/sandpoint/stand/altboot/brdsetup.c Mon Feb 07 23:56:18 2011 +0000
+++ b/sys/arch/sandpoint/stand/altboot/brdsetup.c Tue Feb 08 00:33:05 2011 +0000
@@ -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)
{
diff -r 3563b5c7912b -r ecbf1e1ab1b6 sys/arch/sandpoint/stand/altboot/globals.h
--- a/sys/arch/sandpoint/stand/altboot/globals.h Mon Feb 07 23:56:18 2011 +0000
+++ b/sys/arch/sandpoint/stand/altboot/globals.h Tue Feb 08 00:33:05 2011 +0000
@@ -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 {
diff -r 3563b5c7912b -r ecbf1e1ab1b6 sys/arch/sandpoint/stand/altboot/pciide.c
--- a/sys/arch/sandpoint/stand/altboot/pciide.c Mon Feb 07 23:56:18 2011 +0000
+++ b/sys/arch/sandpoint/stand/altboot/pciide.c Tue Feb 08 00:33:05 2011 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index