From b65ff7406871e7f5c4311e935927dad3751c1859 Mon Sep 17 00:00:00 2001 From: phx Date: Sat, 26 Mar 2011 17:55:05 +0000 Subject: [PATCH] QNAP support. Detect wm(4) based V1.02 and re(4) based V200 boards. That should include all TS-101 and TS-201 models. Add reset-code and LED-illumination code for the QNAP PIC, which listens on the second UART with 19200 bps. --- sys/arch/sandpoint/stand/altboot/brdsetup.c | 31 ++++++++++++++------- sys/arch/sandpoint/stand/altboot/globals.h | 4 +-- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/sys/arch/sandpoint/stand/altboot/brdsetup.c b/sys/arch/sandpoint/stand/altboot/brdsetup.c index 215dc232821b..9be72e0c8a79 100644 --- a/sys/arch/sandpoint/stand/altboot/brdsetup.c +++ b/sys/arch/sandpoint/stand/altboot/brdsetup.c @@ -1,4 +1,4 @@ -/* $NetBSD: brdsetup.c,v 1.11 2011/03/13 01:56:21 phx Exp $ */ +/* $NetBSD: brdsetup.c,v 1.12 2011/03/26 17:55:05 phx Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -89,14 +89,14 @@ static struct brdprop brdlist[] = { NULL, synobrdfix, NULL, synoreset }, { "qnap", - "QNAP TS-101", - BRD_QNAPTS101, + "QNAP TS", + BRD_QNAPTS, 0, "eumb", 0x4500, 115200, - NULL, qnapbrdfix, NULL, NULL }, + NULL, qnapbrdfix, NULL, qnapreset }, { "iomega", - "IOMEGA StorCenter", + "IOMEGA StorCenter G2", BRD_STORCENTER, 0, "eumb", 0x4500, 115200, @@ -224,9 +224,10 @@ brdsetup(void) /* SKnet/Marvell (sk) at dev 15 */ brdtype = BRD_SYNOLOGY; } - else if (PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x8086) { - /* Intel (wm) at dev 15 */ - brdtype = BRD_QNAPTS101; + else if (PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x8086 + || PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x10ec) { + /* Intel (wm) or RealTek (re) at dev 15 */ + brdtype = BRD_QNAPTS; } else if (PCI_VENDOR(pcicfgread(dev13, PCI_ID_REG)) == 0x1106) { /* VIA 6410 (viaide) at dev 13 */ @@ -237,7 +238,7 @@ brdsetup(void) brdtype = BRD_DLINKDSM; } else if (PCI_VENDOR(pcicfgread(dev16, PCI_ID_REG)) == 0x1283 - || PCI_VENDOR(pcicfgread(dev16, PCI_ID_REG)) == 0x1095) { + || PCI_VENDOR(pcicfgread(dev16, PCI_ID_REG)) == 0x1095) { /* ITE (iteide) or SiI (satalink) at dev 16 */ brdtype = BRD_NH230NAS; } @@ -672,7 +673,17 @@ void qnapbrdfix(struct brdprop *brd) { - /* illuminate LEDs */ + init_uart(uart2base, 19200, LCR_8BITS | LCR_PNONE); + /* beep, status LED red */ + send_sat("PW"); +} + +void +qnapreset() +{ + + send_sat("f"); + /*NOTREACHED*/ } void diff --git a/sys/arch/sandpoint/stand/altboot/globals.h b/sys/arch/sandpoint/stand/altboot/globals.h index f67a2e78c184..d3831e625a71 100644 --- a/sys/arch/sandpoint/stand/altboot/globals.h +++ b/sys/arch/sandpoint/stand/altboot/globals.h @@ -1,4 +1,4 @@ -/* $NetBSD: globals.h,v 1.11 2011/03/13 01:56:21 phx Exp $ */ +/* $NetBSD: globals.h,v 1.12 2011/03/26 17:55:05 phx Exp $ */ #ifdef DEBUG #define DPRINTF(x) printf x @@ -17,7 +17,7 @@ extern int brdtype; #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