Module Name:    src
Committed By:   phx
Date:           Thu Aug  3 19:22:15 UTC 2017

Modified Files:
        src/sys/arch/sandpoint/stand/altboot: brdsetup.c siisata.c version

Log Message:
Some Synology network devices show vendor 0x1148 (Schneider & Koch) instead
of 0x11ab (Marvell). Detect both.
Improve spinning up of both disk drives on Synology DS20x by adding some
more delays (directly at the start and after powering up the second drive).


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/stand/altboot/siisata.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sandpoint/stand/altboot/version

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.38 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.39
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.38	Thu Aug  3 09:42:34 2017
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Thu Aug  3 19:22:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.38 2017/08/03 09:42:34 phx Exp $ */
+/* $NetBSD: brdsetup.c,v 1.39 2017/08/03 19:22:15 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -269,7 +269,8 @@ brdsetup(void)
 				brdtype = BRD_KUROBOXT4;
 		}
 	}
-	else if (PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x11ab) {
+	else if (PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x1148
+	    || PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x11ab) {
 		/* SKnet/Marvell (sk) at dev 15 */
 		brdtype = BRD_SYNOLOGY;
 	}
@@ -873,8 +874,11 @@ synopcifix(struct brdprop *brd)
 		 * with several seconds delay, but no CPLD register to
 		 * monitor the power state. So all we can do is to
 		 * wait some more seconds during SATA-init.
+		 * Also wait some seconds now, to make sure the first
+		 * disk is ready after a cold start.
 		 */
 		sata_delay[1] = SYNO_DISK_DELAY;
+		delay(10 * 1024 * 1024);
 	}
 
   cpld_done:

Index: src/sys/arch/sandpoint/stand/altboot/siisata.c
diff -u src/sys/arch/sandpoint/stand/altboot/siisata.c:1.6 src/sys/arch/sandpoint/stand/altboot/siisata.c:1.7
--- src/sys/arch/sandpoint/stand/altboot/siisata.c:1.6	Wed Sep 30 14:14:32 2015
+++ src/sys/arch/sandpoint/stand/altboot/siisata.c	Thu Aug  3 19:22:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.6 2015/09/30 14:14:32 phx Exp $ */
+/* $NetBSD: siisata.c,v 1.7 2017/08/03 19:22:15 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -125,6 +125,15 @@ siisata_init(unsigned tag, void *data)
 			if (l->presense[n] == 0) {
 				DPRINTF(("port %d not present\n", n));
 				continue;
+			} else {
+				/*
+				 * XXX perform_atareset() does not work
+				 * when the drive is not completely spun up?
+				 * So insert another delay here.
+				 */
+				printf("Waiting 15 seconds for port %d "
+				    "to spin up.\n", n);
+				delay(15 * 1000 * 1000);
 			}
 		}
 		if (atachkpwr(l, n) != ATA_PWR_ACTIVE) {

Index: src/sys/arch/sandpoint/stand/altboot/version
diff -u src/sys/arch/sandpoint/stand/altboot/version:1.8 src/sys/arch/sandpoint/stand/altboot/version:1.9
--- src/sys/arch/sandpoint/stand/altboot/version:1.8	Wed Sep 30 14:14:32 2015
+++ src/sys/arch/sandpoint/stand/altboot/version	Thu Aug  3 19:22:15 2017
@@ -18,3 +18,5 @@
 	NIC.
 1.11:	Pass precise model information and flags with bootinfo.
 	Synology DS207/209 LED and 2nd disk power-up support.
+1.12:	Some more Synology DS20x fixes, to make sure both drives have been
+	spun up. Also detect PCI-vendor 0x1148 (S&K) as Synology.

Reply via email to